/* ==========================================================================
   Omar Loubi — Portfolio
   Main stylesheet

   Visual system recreated from the "Dorbesh" reference: mint canvas, white
   rounded panels, Poppins type and a #448C74 accent. Sizes mirror the
   reference (desktop-first, Bootstrap-style breakpoints: 1400 / 1200 / 992 /
   768 / 576).

   01. Fonts
   02. Design tokens
   03. Base
   04. Layout
   05. Shared components
   06. Header & navigation
   07. Hero, profile card & stats
   08. Services
   09. Resume
   10. Skills
   11. Works
   12. Testimonials
   13. Contact
   14. Call to action
   15. Footer & back-to-top
   16. Preloader
   17. Lightbox
   18. Motion
   ========================================================================== */


/* 01. Fonts
   ========================================================================== */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url("../fonts/poppins-200.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}

/* Metric-matched fallback: keeps line lengths stable while Poppins loads. */
@font-face {
  font-family: "Poppins Fallback";
  src: local("Arial");
  size-adjust: 112.16%;
  ascent-override: 93.62%;
  descent-override: 31.21%;
  line-gap-override: 8.92%;
}


/* 02. Design tokens
   ========================================================================== */

:root {
  /* Colour */
  --c-primary: #448c74;
  --c-heading: #000;
  --c-text: #444;
  --c-page: #ecf3f1;
  --c-surface: #fff;
  --c-surface-muted: #f9f9f9;
  --c-tint: #f0f5f1;
  --c-border: rgb(119 119 125 / .2);
  --c-border-soft: rgb(0 0 0 / .05);
  --c-border-social: #eee;
  --c-divider: #eaefed;
  --c-dot: #cedcd3;
  --c-ink: #333;
  --c-error: #c62828;

  /* Type */
  --font-sans: "Poppins", "Poppins Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape */
  --radius-panel: 20px;
  --radius-card: 16px;
  --radius-btn: 15px;
  --radius-skill: 14px;
  --radius-tile: 12px;
  --radius-sm: 10px;

  /* Space */
  --gutter: 30px;
  --panel-pad: 40px;
  --header-offset: 90px;

  /* Depth & motion */
  --shadow-float: 0 18px 40px -24px rgb(18 54 42 / .22);
  --ease-out-quart: cubic-bezier(.165, .84, .44, 1);
}


/* 03. Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-offset);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  color: var(--c-text);
  background: var(--c-page);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 30px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5rem;
  color: var(--c-heading);
  font-weight: 500;
  line-height: 1.2;
}

p {
  margin: 0 0 1rem;
  line-height: 28px;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote {
  margin: 0;
}

img,
svg,
iframe {
  vertical-align: middle;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--c-text);
  text-decoration: none;
  transition: color .5s, background-color .5s, border-color .5s;
}

a:hover {
  color: var(--c-primary);
}

button,
input,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

::selection {
  background: rgb(68 140 116 / .2);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1001;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: #000;
  color: #fff;
  font-weight: 500;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -.125em;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}


/* 04. Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 12px;
}

.section {
  padding-block: 15px;
}

.panel {
  padding: var(--panel-pad);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-panel);
  background: var(--c-surface);
}

@media (max-width: 1399.98px) {
  .container { max-width: 1140px; }
}

@media (max-width: 1199.98px) {
  .container { max-width: 960px; }
}

@media (max-width: 991.98px) {
  .container { max-width: 720px; }
}

@media (max-width: 767.98px) {
  .container { max-width: 540px; }
}

@media (max-width: 575.98px) {
  .container { max-width: none; }
}


/* 05. Shared components
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-btn);
  background: var(--c-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  transition: background-color .3s, color .3s, border-color .3s;
}

.btn:hover,
.btn:focus-visible {
  background: #000;
  color: #fff;
}

.btn:active {
  box-shadow: inset 0 3px 5px rgb(0 0 0 / .125);
}

.btn[disabled] {
  opacity: .65;
  pointer-events: none;
}

.btn[aria-disabled="true"] {
  cursor: default;
}

/* Section titles */
.section-title {
  margin-bottom: 40px;
  text-align: center;
}

.section-title__eyebrow,
.section-title__lead {
  padding-inline: 300px;
}

.section-title__heading {
  margin-bottom: 15px;
  font-size: 50px;
}

/* Outlined display words (hero, call to action) */
.text-outline {
  color: var(--c-primary);
}

.text-outline--dark {
  color: #000;
}

@supports (-webkit-text-stroke: 1px #000) {
  .text-outline {
    color: transparent;
    -webkit-text-stroke: 1px var(--c-primary);
  }

  .text-outline--dark {
    color: transparent;
    -webkit-text-stroke-color: #000;
  }
}

@media (forced-colors: active) {
  .text-outline,
  .text-outline--dark {
    color: CanvasText;
    -webkit-text-stroke: 0;
  }
}

@media (max-width: 1280px) {
  .section-title__eyebrow,
  .section-title__lead {
    padding-inline: 100px;
  }
}

@media (max-width: 991.98px) {
  .section-title {
    margin-bottom: 30px;
  }

  .section-title__heading {
    font-size: 30px;
  }

  .section-title__eyebrow,
  .section-title__lead {
    margin-bottom: 0;
    padding-inline: 0;
  }
}


/* 06. Header & navigation
   ========================================================================== */

.site-header {
  --header-pad: 30px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color .5s ease;
}

.site-header.is-scrolled {
  --header-pad: 10px;
  background: var(--c-page);
}

.site-header__inner {
  display: flex;
  align-items: center;
  padding-block: var(--header-pad);
  box-shadow: inset 0 -1px 0 transparent;
  transition: padding .5s ease, box-shadow .5s ease;
}

.site-header.is-scrolled .site-header__inner {
  box-shadow: inset 0 -1px 0 var(--c-border);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: flex-start;
  color: #000;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
}

.brand:hover {
  color: #000;
}

.brand__dot {
  width: 8px;
  height: 8px;
  margin: 1px 0 0 3px;
  border-radius: 50%;
  background: var(--c-primary);
}

.site-nav {
  margin-inline: auto;
}

.site-nav__list {
  display: flex;
}

.site-nav__list li {
  padding: 12px 5px 12px 20px;
}

.site-nav__list a {
  display: block;
  color: #000;
  font-size: 16px;
  font-weight: 500;
  text-transform: capitalize;
  transition: color .5s ease;
}

.site-nav__list a:hover {
  color: var(--c-primary);
}

/* French does not title-case: "À propos", not "À Propos" (the English labels are capitalised in the HTML) */
html[lang="fr"] .site-nav__list a {
  text-transform: none;
}

.nav-toggle {
  display: none;
}

.site-header__cta {
  flex: none;
}

.site-header__cta .icon {
  font-size: 16px;
}

/* Language switch (FR / EN) */
.lang-switch {
  display: inline-flex;
  flex: none;
  margin-right: 16px;
  padding: 3px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
}

.lang-switch__btn {
  min-width: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: .04em;
  transition: background-color .3s, color .3s;
}

.lang-switch__btn:hover {
  color: var(--c-primary);
}

.lang-switch__btn[aria-pressed="true"] {
  background: var(--c-primary);
  color: #fff;
}

/* the French text is applied by the script: without JS the page is English and the switch would do nothing */
.no-js .lang-switch {
  display: none;
}

/* Until the French text is in place, keep the English hidden (never more than 1.5 s) */
.i18n-pending .site-header,
.i18n-pending main,
.i18n-pending .site-footer {
  visibility: hidden;
  animation: i18n-failsafe 0s 1.5s forwards;
}

@keyframes i18n-failsafe {
  to { visibility: visible; }
}

@media (max-width: 1399.98px) {
  .site-nav__list li {
    padding-inline: 10px;
  }
}

@media (max-width: 991.98px) {
  .site-header:not(.is-scrolled) {
    --header-pad: 15px;
  }

  .site-header__cta {
    display: none;
  }

  /* brand ... [FR|EN] [menu]: the language switch takes the auto margin */
  .lang-switch {
    order: 1;
    margin: 0 14px 0 auto;
  }

  .brand {
    font-size: 19px;
  }

  .brand__dot {
    width: 6px;
    height: 6px;
  }

  .site-nav {
    order: 2;
    margin: 0;
  }

  .nav-toggle {
    display: block;
    padding: 4px 0;
  }

  .nav-toggle__bar {
    display: block;
    width: 26px;
    height: 3px;
    margin: 5px 0;
    background: var(--c-text);
  }

  /* Dark drop-down panel, anchored to the fixed header like the reference */
  .site-nav__panel {
    position: absolute;
    top: calc(100% - var(--header-pad));
    left: 45%;
    display: grid;
    grid-template-rows: 0fr;
    width: 50%;
    visibility: hidden;
    transition: grid-template-rows .35s ease, visibility 0s linear .35s;
  }

  .site-nav.is-open .site-nav__panel {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows .35s ease, visibility 0s;
  }

  .site-nav__clip {
    min-height: 0;
    overflow: hidden;
  }

  .site-nav__list {
    display: block;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-block: 25px;
    background: var(--c-ink);
  }

  .site-nav__list li {
    padding: 0 15px;
    border-top: 1px solid var(--c-border);
  }

  .site-nav__list li:last-child {
    border-bottom: 1px solid var(--c-border);
  }

  .site-nav__list a {
    padding: 10px;
    color: #fff;
    line-height: 22px;
    opacity: .7;
  }
}

@media (max-width: 767.98px) {
  .site-header:not(.is-scrolled) {
    --header-pad: 10px;
  }
}


/* 07. Hero, profile card & stats
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 115px 0 15px;
  background:
    linear-gradient(180deg, transparent 78%, var(--c-page) 100%),
    radial-gradient(40% 55% at 100% 64%, rgb(207 229 219 / .55), transparent 72%),
    radial-gradient(42% 46% at 0% 100%, rgb(203 226 220 / .7), transparent 72%),
    linear-gradient(180deg, #fcfcfa 0%, #f8faf7 58%, var(--c-page) 100%);
}

.hero__decor {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__waves {
  position: absolute;
  fill: none;
  stroke: rgb(68 140 116 / .1);
  stroke-width: 1.2;
}

.hero__waves path {
  vector-effect: non-scaling-stroke;
}

.hero__waves--left {
  bottom: 30px;
  left: -40px;
  width: 46%;
  height: 300px;
}

.hero__waves--right {
  top: 52%;
  right: -60px;
  width: 40%;
  height: 260px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(290px, calc(25% - 22.5px)) 1fr;
  gap: var(--gutter);
}

/* Profile card */
.profile-card {
  position: relative;
  padding: 32px 30px 26px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-panel);
  background: var(--c-surface);
  box-shadow: var(--shadow-float);
  text-align: center;
}

.profile-card__status {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-primary);
}

.profile-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto 24px;
  padding: 10px;
  border: 2px dashed var(--c-primary);
  border-radius: 50%;
  object-fit: cover;
}

.profile-card__name {
  margin-bottom: 6px;
  color: #000;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.profile-card__role {
  margin-bottom: 6px;
  color: var(--c-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.profile-card__location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 22px;
}

.profile-card__location .icon {
  color: var(--c-primary);
  font-size: 15px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border-social);
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 18px;
}

.social-links a:hover {
  color: var(--c-primary);
}

/* Intro */
.hero__content {
  position: relative;
  padding: 36px 0 0 20px;
}

.dot-grid {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--c-dot) 1.5px, transparent 2px) 0 0 / 20px 20px;
}

.hero__hello {
  margin-bottom: 1rem;
  color: #000;
  font-weight: 500;
}

.hero__title {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  font-size: 42px;
  font-weight: 700;
  line-height: 52px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.hero__status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: #000;
  line-height: 30px;
}

.hero__title .text-outline {
  -webkit-text-stroke-width: 1.3px;
}

.status-dot {
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 9.5px; /* centred on the first 30px line, like the reference's inline dot */
  border-radius: 50%;
  background: var(--c-primary);
}

.hero__actions {
  position: relative;
  z-index: 1;
  margin-top: 30px;
}

/* Download CV menu: a native <details>, so it opens and every link works without JS */
.hero__actions:has(.cv-menu[open]) {
  z-index: 3; /* the open panel overlaps the stats card */
}

.cv-menu {
  position: relative;
  display: inline-block;
}

.cv-menu__toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.cv-menu__toggle::-webkit-details-marker {
  display: none;
}

.cv-menu[open] > .cv-menu__toggle {
  background: #000;
}

.cv-menu__chevron {
  font-size: 18px;
  transition: transform .3s;
}

.cv-menu[open] .cv-menu__chevron {
  transform: rotate(180deg);
}

.cv-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 260px;
  padding: 10px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-card);
  background: var(--c-surface);
  box-shadow: 0 24px 48px -20px rgb(18 54 42 / .3);
}

.cv-menu__group {
  margin: 4px 10px 4px;
  color: #6b6b6b;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cv-menu__list + .cv-menu__group {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--c-divider);
}

.cv-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.cv-menu__item .icon {
  color: var(--c-primary);
  font-size: 16px;
}

a.cv-menu__item:hover,
a.cv-menu__item:focus-visible {
  background: var(--c-tint);
  color: var(--c-primary);
}

a.cv-menu__item:focus-visible {
  outline-offset: -2px;
}

.cv-menu__item[aria-disabled="true"] {
  color: #9a9a9a;
  cursor: default;
}

.cv-menu__item[aria-disabled="true"] .icon {
  color: currentColor;
}

.cv-menu__soon {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f3f2;
  color: #6b6b6b;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

@keyframes cv-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cv-menu[open] .cv-menu__panel {
    animation: cv-menu-in .2s var(--ease-out-quart);
  }
}

.hero__visual {
  position: absolute;
  right: -110px;
  bottom: -74px;
  z-index: 0;
  width: 86%;
  max-width: 860px;
  pointer-events: none;
  user-select: none;
}

/* Key figures */
.stats {
  position: relative;
  z-index: 2;
  margin-top: 44px;
  padding-block: 15px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-panel);
  background: var(--c-surface);
  box-shadow: var(--shadow-float);
}

.stats__list {
  display: grid;
  grid-auto-columns: 25%;
  grid-auto-flow: column;
  justify-content: center;
}

.stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 15px 24px 15px 40px;
}

.stat::before,
.stat::after {
  content: "";
  position: absolute;
  background: var(--c-divider);
}

.stat::before {
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
}

.stat:first-child::before,
.stat::after {
  display: none;
}

.stat__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--c-tint);
  color: var(--c-primary);
  font-size: 28px;
}

.stat__text {
  margin: 0;
}

.stat__value {
  display: block;
  color: var(--c-primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
}

.stat__label {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 22px;
}

@media (max-width: 1199.98px) {
  .hero__grid {
    grid-template-columns: calc(100% / 3 - 20px) 1fr;
  }

  .hero__title {
    font-size: 36px;
    line-height: 46px;
  }

  .hero__visual {
    right: -70px;
    width: 88%;
  }

  .stat {
    gap: 16px;
    padding: 15px 16px 15px 22px;
  }

  .stat__icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .stat__value {
    font-size: 24px;
  }

  .stat__label {
    font-size: 14px;
    line-height: 20px;
  }
}

@media (max-width: 991.98px) {
  .hero {
    padding-top: 80px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__content {
    padding: 10px 0 0;
  }

  .hero__title {
    font-size: 40px;
    line-height: 54px;
  }

  .hero__visual {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: 100%;
    max-width: 680px;
    margin: 24px -40px -74px auto;
  }

  .stats__list {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: row;
    justify-content: stretch;
  }

  .stat:nth-child(odd)::before {
    display: none;
  }

  .stat:nth-child(n + 3)::after {
    display: block;
    top: 0;
    right: 0;
    left: 0;
    height: 1px;
  }

  .stat:nth-child(3)::after {
    left: 24px;
  }

  .stat:nth-child(4)::after {
    right: 24px;
  }
}

@media (max-width: 767.98px) {
  .hero {
    padding-top: 60px;
  }

  .hero__title {
    font-size: 30px;
    line-height: 40px;
  }

  .dot-grid {
    display: none;
  }

  .hero__visual {
    margin: 20px -12px -60px auto;
    width: calc(100% + 24px);
    max-width: none;
  }

  .stat {
    flex-direction: column;
    gap: 10px;
    padding: 15px 10px;
    text-align: center;
  }

  .stat__icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .stat__value {
    font-size: 22px;
  }

  .stat__label {
    font-size: 13px;
    line-height: 18px;
  }
}


/* 08. Services
   ========================================================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.service-card {
  padding: 60px 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  transition: border-color .5s;
}

.service-card:hover {
  border-color: var(--c-primary);
}

.service-card__icon {
  display: block;
  width: 60px;
  height: 60px;
  margin: -14px 0 1px;
  fill: var(--c-primary);
}

.service-card__title {
  margin: 20px 0;
  color: var(--c-text);
  font-size: 20px;
  line-height: 1.1;
}

.service-card__text {
  margin: 0;
}

@media (max-width: 991.98px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767.98px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .service-card {
    padding-inline: 25px;
  }
}


/* 09. Resume
   ========================================================================== */

.resume-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: var(--gutter);
}

.resume-panel__title {
  margin-bottom: .5rem;
  font-size: 22px;
}

.resume-list {
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-sm);
}

.resume-item {
  display: flex;
  padding-block: 30px;
  border-bottom: 1px solid var(--c-border);
}

.resume-item:last-child {
  border-bottom: 0;
}

.resume-item__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-right: 20px;
  border-radius: var(--radius-tile);
  background: var(--c-surface-muted);
  color: var(--c-primary);
  font-size: 20px;
}

.resume-item__years {
  margin-bottom: 20px;
  line-height: 1;
}

.resume-item__title {
  margin: 12px 0;
  color: var(--c-text);
  font-size: 20px;
  line-height: 1.1;
}

.resume-item__meta {
  margin: 0;
  line-height: 30px;
}

@media (max-width: 991.98px) {
  .section--resume {
    padding-top: 50px;
  }

  .resume-panel {
    margin-bottom: 30px;
  }
}

@media (max-width: 767.98px) {
  .section--resume {
    padding-top: 15px;
  }

  .resume-grid {
    grid-template-columns: 1fr;
  }

  .resume-panel {
    margin-bottom: 0;
  }

  .resume-list {
    margin-top: 30px;
  }
}

@media (max-width: 479.98px) {
  .resume-item__title {
    line-height: 1.3;
  }
}


/* 10. Skills
   ========================================================================== */

/* Sits between the hero and Services: with their 15px paddings, 100px above the title and
   70px (+30px card margin) below the cards make the same 115px gap on both sides, at every width */
.section--skills {
  padding: 100px 0 70px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gutter);
}

.skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  padding: 25px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-skill);
  text-align: center;
  transition: border-color .5s;
}

.skill-card:hover {
  border-color: var(--c-primary);
}

.skill-card__logo {
  width: 56px;
  height: 56px;
}

.skill-card__name {
  margin: 15px 0 16px;
  color: var(--c-text);
  font-size: 16px;
  line-height: 19px;
}

.skill-card__level {
  align-self: stretch;
  margin: auto 0 0;
  padding: 10px;
  border-radius: var(--radius-skill);
  background: var(--c-primary);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .5s;
}

.skill-card:hover .skill-card__level {
  background: #000;
}

@media (max-width: 1199.98px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991.98px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 767.98px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 575.98px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* 11. Works
   ========================================================================== */

.works-filter {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -20px;
  padding-bottom: 15px;
}

.works-filter__btn {
  position: relative;
  margin: 0 20px 20px;
  padding: 0 0 15px;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: color .5s;
}

.works-filter__btn::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--c-primary);
  opacity: 0;
  transition: opacity .5s;
}

.works-filter__btn.is-active {
  color: var(--c-primary);
}

.works-filter__btn.is-active::after {
  opacity: 1;
}

.works-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--gutter);
}

/* Masonry flow like the reference (isotope): each card spans as many 1px rows as it is tall */
.works-grid.is-masonry {
  grid-auto-rows: 1px;
  align-items: start;
}

.work-card {
  margin-bottom: 30px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  background: var(--c-surface);
}

.work-card__media {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.work-card__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.work-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

/* The link covers the whole image (easy to tap); only the circle is visible */
.work-card__btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}

.work-card__btn:focus-visible {
  outline-offset: -4px;
}

.work-card__btn-icon {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 20px;
  opacity: 0;
  transition: opacity .3s, color .5s;
}

.work-card:hover .work-card__media::before,
.work-card__media:focus-within::before {
  opacity: .65;
}

.work-card:hover .work-card__btn-icon,
.work-card__btn:focus-visible .work-card__btn-icon {
  opacity: 1;
}

.work-card__body {
  padding: 0 0 20px 20px;
}

.work-card__tag {
  margin: 0;
  line-height: 30px;
}

.work-card__title {
  margin-bottom: .5rem;
  color: var(--c-text);
  font-size: 20px;
  line-height: 1.3;
}

@media (max-width: 1199.98px) {
  .work-card__body {
    padding-inline: 25px;
  }
}

@media (max-width: 991.98px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767.98px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479.98px) {
  .work-card__title {
    font-size: 25px;
  }
}


/* 12. Testimonials
   ========================================================================== */

.carousel__viewport {
  margin-inline: -15px;
  overflow: hidden;
}

.carousel__track {
  display: flex;
  touch-action: pan-y;
}

.carousel__slide {
  flex: 0 0 calc(50% - 30px);
  margin-inline: 15px;
}

.testimonial-card {
  height: 100%;
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  transition: border-color .5s;
}

.testimonial-card:hover {
  border-color: var(--c-primary);
}

.testimonial-card__avatar {
  display: block;
  width: 60px;
  height: 60px;
  margin-bottom: 25px;
  border-radius: 50%;
}

.testimonial-card__quote p {
  margin-bottom: 30px;
  line-height: 30px;
}

.testimonial-card__name {
  display: block;
  color: var(--c-text);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.testimonial-card__role {
  display: block;
  font-size: 14px;
  line-height: 22px;
}

.carousel__controls {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding-top: 40px;
}

.carousel__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 16px;
  transition: background-color .5s, border-color .5s;
}

.carousel__btn:hover,
.carousel__btn:focus-visible {
  border-color: var(--c-primary);
  background: #000;
}

@media (max-width: 1199.98px) {
  .testimonial-card {
    padding-inline: 25px;
  }
}

@media (max-width: 991.98px) {
  .section--testimonials {
    padding-top: 50px;
  }
}

@media (max-width: 767.98px) {
  .section--testimonials {
    padding-top: 15px;
  }

  .carousel__slide {
    flex-basis: calc(100% - 30px);
  }
}


/* 13. Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: calc(100% / 3 - 20px) 1fr;
  align-items: start;
  gap: var(--gutter);
}

.contact-info {
  padding: 50px 30px 20px 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}

.contact-info__item {
  padding-bottom: 20px;
}

.contact-info__icon {
  display: block;
  width: 20px;
  height: 33px;
  color: var(--c-primary);
}

.contact-info__label {
  margin: 5px 0;
  color: var(--c-text);
  font-size: 16px;
}

/* Long unbreakable values (e-mail addresses) wrap instead of widening the card on small phones */
.contact-info__value {
  overflow-wrap: anywhere;
}

.contact-form {
  padding: 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}

.contact-form__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--gutter);
}

.form-field {
  margin-bottom: 32px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field__label {
  display: block;
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 500;
  line-height: 30px;
}

.form-field__control {
  display: block;
  width: 100%;
  padding: 19px 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface-muted);
  color: #000;
  font-size: 16px;
  line-height: 1.3;
  transition: border-color .3s, box-shadow .3s;
}

.form-field__control::placeholder {
  color: #000;
  opacity: .4;
}

.form-field__control:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgb(68 140 116 / .15);
}

.form-field__control[aria-invalid="true"] {
  border-color: var(--c-error);
}

textarea.form-field__control {
  min-height: 122px;
  resize: vertical;
}

.form-field__error {
  margin: 8px 0 0;
  color: var(--c-error);
  font-size: 14px;
  line-height: 20px;
}

.form-status {
  margin: 10px 0 0;
  padding: 8px 14px;
  border: 1px solid;
  border-radius: 4px;
  text-align: center;
}

.form-status--success {
  border-color: #01b500;
}

.form-status--error {
  border-color: #f00;
}

@media (max-width: 991.98px) {
  .section--contact {
    padding-block: 15px 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .section--contact {
    padding-block: 15px;
  }

  .contact-form__grid {
    grid-template-columns: 1fr;
  }
}


/* 14. Call to action
   ========================================================================== */

.cta {
  padding: 80px 200px;
  text-align: center;
}

.cta__title {
  margin-bottom: 20px;
  font-size: 40px;
  font-weight: 700;
  line-height: 50px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.cta__text {
  margin-bottom: 0;
}

.cta .btn {
  margin-top: 30px;
}

@media (max-width: 1280px) {
  .cta {
    padding: 60px;
  }
}

@media (max-width: 991.98px) {
  .cta {
    padding: 50px;
  }
}

@media (max-width: 767.98px) {
  .cta {
    padding: 30px;
  }

  .cta__title {
    font-size: 30px;
    line-height: 40px;
  }
}


/* 15. Footer & back-to-top
   ========================================================================== */

.site-footer {
  padding: 50px 0 40px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--gutter);
}

.site-footer p {
  font-size: 14px;
  font-weight: 500;
}

.site-footer a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: rgb(68 140 116 / .45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-footer__credit {
  text-align: right;
}

@media (max-width: 991.98px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer__credit {
    text-align: center;
  }
}

.back-to-top {
  position: fixed;
  right: 10px;
  bottom: 20px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity .4s linear, visibility .4s linear, transform .4s linear;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.back-to-top__ring path {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
}

.back-to-top .icon {
  position: absolute;
  top: 9.5px;
  left: 9.5px;
  font-size: 25px;
}


/* 16. Preloader
   ========================================================================== */

.preloader {
  display: none;
}

.js .preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Failsafe: never trap the page if the script cannot run its exit sequence */
  animation: preloader-failsafe .3s linear 8s forwards;
}

.preloader__curtain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110vh;
  fill: #000;
}

.preloader__text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 200;
  letter-spacing: 15px;
  text-transform: uppercase;
}

.preloader__text span {
  animation: preloader-blink 1s infinite alternate;
}

.preloader__text span:nth-child(2) { animation-delay: .1s; }
.preloader__text span:nth-child(3) { animation-delay: .2s; }
.preloader__text span:nth-child(4) { animation-delay: .3s; }
.preloader__text span:nth-child(5) { animation-delay: .4s; }
.preloader__text span:nth-child(6) { animation-delay: .5s; }
.preloader__text span:nth-child(7) { animation-delay: .6s; }
.preloader__text span:nth-child(8) { animation-delay: .7s; }
.preloader__text span:nth-child(9) { animation-delay: .8s; }
.preloader__text span:nth-child(10) { animation-delay: .9s; }

/* "Loading" / "Chargement": only the page language's word is shown */
html:not([lang="fr"]) .preloader__text[lang="fr"],
html[lang="fr"] .preloader__text[lang="en"] {
  display: none;
}

@keyframes preloader-blink {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes preloader-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .preloader {
    display: none;
  }
}


/* 17. Project preview
   ========================================================================== */

/* The dialog covers the viewport; the white panel sits inside it, the zoom layer above it */
.preview {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--c-text);
}

.preview[open] {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); /* a fixed area, so the panel's 100% never grows with its content */
  place-items: center;
}

.preview::backdrop {
  background: rgb(11 11 11 / .8);
}

/* Desktop: gallery left, case study right, sized to the viewport */
.preview__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr);
  column-gap: 40px;
  width: min(1320px, 100%);
  height: min(900px, 100%);
  padding: var(--panel-pad);
  border-radius: var(--radius-panel);
  background: var(--c-surface);
}

.preview__bar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
}

.preview__bar-title {
  display: none;
}

.preview__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  color: #000;
  font-size: 22px;
  transition: color .5s, background-color .5s, border-color .5s;
}

.preview__close:hover,
.preview__close:focus-visible {
  border-color: #000;
  background: #000;
  color: #fff;
}

/* Gallery */
.preview__media {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.preview__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--c-page);
}

.preview__track {
  position: relative;
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.preview__track::-webkit-scrollbar {
  display: none;
}

.preview__track:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-card);
}

.preview__slide {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  padding: 32px 64px;
  container-type: size;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* The frame takes the screenshot's exact shape, as large as the slide allows */
.preview__frame {
  position: relative;
  flex: none;
  width: min(100cqw, 100cqh * var(--r));
  aspect-ratio: var(--r);
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  box-shadow: var(--shadow-float);
  cursor: zoom-in;
}

.preview__slide[data-type="phone"] .preview__frame {
  border-radius: calc(min(100cqw, 100cqh * var(--r)) * .07);
}

.preview__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 28px;
  height: 28px;
  margin: auto;
  border: 2px solid rgb(68 140 116 / .25);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: preview-spin .8s linear infinite;
}

.preview__slide.is-loaded .preview__frame::after {
  display: none;
}

.preview__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}

.preview__slide.is-loaded .preview__img {
  opacity: 1;
}

/* Same round buttons as the testimonials carousel */
.preview__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 16px;
  transition: background-color .5s, border-color .5s, opacity .3s, visibility .3s;
}

.preview__arrow:hover,
.preview__arrow:focus-visible {
  border-color: var(--c-primary);
  background: #000;
}

.preview__arrow--prev {
  left: 12px;
}

.preview__arrow--next {
  right: 12px;
}

.preview__arrow[aria-disabled="true"] {
  opacity: .35;
  cursor: default;
}

.preview__arrow[aria-disabled="true"]:not(:focus-visible) {
  visibility: hidden;
  opacity: 0;
}

.preview__expand {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  color: #000;
  font-size: 18px;
  transition: color .5s, background-color .5s, border-color .5s;
}

.preview__expand:hover,
.preview__expand:focus-visible {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

.preview__caption {
  display: flex;
  gap: 12px;
  min-width: 0;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 20px;
}

.preview__caption > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview__count {
  flex: none;
  color: #000;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.preview__thumbs {
  position: relative;
  display: flex;
  flex: none;
  gap: 10px;
  margin-top: 10px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.preview__thumb {
  flex: none;
  width: 88px;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  opacity: .55;
  transition: opacity .3s, border-color .3s, box-shadow .3s;
}

.preview__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview__thumb:hover {
  opacity: 1;
}

.preview__thumb[aria-current="true"] {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary);
  opacity: 1;
}

/* Case study: the text scrolls on short screens, previous/next project stays in view */
.preview__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.preview__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.preview__body.has-more {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 48px), transparent);
}

.preview__category {
  margin: 0 52px 4px 0;
  color: var(--c-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.preview__title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}

.preview__title:focus {
  outline: none;
}

.preview__desc {
  margin: 0;
}

.preview__heading {
  margin: 24px 0 12px;
  font-size: 18px;
  line-height: 1.3;
}

.preview__features li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  line-height: 24px;
}

.preview__features li + li {
  margin-top: 8px;
}

.preview__features .icon {
  position: absolute;
  top: 3px;
  left: 0;
  color: var(--c-primary);
  font-size: 18px;
}

.preview__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview__tech li {
  padding: 5px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  font-size: 14px;
  line-height: 20px;
}

.preview__action {
  margin-top: 24px;
}

.preview__availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #000;
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.preview__availability .icon {
  color: var(--c-primary);
  font-size: 20px;
}

.preview__pager {
  display: grid;
  flex: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--c-divider);
}

.preview__pager-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.preview__pager-btn--next {
  justify-content: flex-end;
  text-align: right;
}

.preview__pager-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  color: #000;
  font-size: 16px;
  transition: color .5s, background-color .5s, border-color .5s;
}

.preview__pager-btn:hover .preview__pager-icon,
.preview__pager-btn:focus-visible .preview__pager-icon {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

.preview__pager-text {
  display: grid;
  min-width: 0;
}

.preview__pager-label {
  font-size: 13px;
  line-height: 18px;
}

.preview__pager-name {
  overflow: hidden;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .5s;
}

.preview__pager-btn:hover .preview__pager-name {
  color: var(--c-primary);
}

/* Zoom view: the screenshot alone on a dark layer; click/tap toggles fit and 100 % */
.zoom {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0b0b0b;
  color: #f3f3f3;
}

.zoom__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 8px 8px 24px;
}

.zoom__caption {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom__count {
  margin-right: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.zoom__btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  opacity: .75;
  transition: opacity .2s, background-color .2s;
}

.zoom__btn:hover,
.zoom__btn:focus-visible {
  background: rgb(255 255 255 / .12);
  opacity: 1;
}

.zoom__viewport {
  display: flex;
  padding: 0 72px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}

.zoom__img {
  flex: none;
  max-width: none;
  margin: auto;
  background: #fff;
  transition: none; /* the size is read back right after it changes (also under reduced motion) */
  user-select: none;
  -webkit-user-drag: none;
}

.zoom.is-zoomable .zoom__img {
  cursor: zoom-in;
}

.zoom.is-actual .zoom__img {
  cursor: zoom-out;
}

.zoom.is-actual .zoom__viewport {
  touch-action: auto;
}

.zoom.is-dragging .zoom__img {
  cursor: grabbing;
}

.zoom__arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 50%;
  background: rgb(28 28 28 / .8);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2);
  color: #fff;
  font-size: 24px;
  transition: background-color .3s, opacity .3s, visibility .3s;
}

.zoom__arrow:hover,
.zoom__arrow:focus-visible {
  background: var(--c-primary);
}

.zoom__arrow--prev {
  left: 16px;
}

.zoom__arrow--next {
  right: 16px;
}

.zoom__arrow[aria-disabled="true"] {
  opacity: .35;
  cursor: default;
}

.zoom__arrow[aria-disabled="true"]:not(:focus-visible) {
  visibility: hidden;
  opacity: 0;
}

@keyframes preview-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 1400px) {
  .preview__panel {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

/* Tablet and phone: one scrolling column with a pinned title bar */
@media (max-width: 1199.98px) {
  .preview__panel {
    display: block;
    width: min(840px, 100%);
    height: auto;
    max-height: 100%;
    padding: 0 32px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .preview__bar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 -32px 8px;
    padding: 12px 16px 12px 32px;
    background: var(--c-surface);
    transition: box-shadow .3s;
  }

  .preview__panel.is-scrolled .preview__bar {
    box-shadow: 0 1px 0 var(--c-divider), 0 10px 20px -16px rgb(0 0 0 / .25);
  }

  .preview__bar-title {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview__stage {
    flex: none;
    aspect-ratio: 16 / 10;
  }

  .preview[data-layout="portrait"] .preview__stage {
    height: min(70svh, 640px);
    aspect-ratio: auto;
  }

  .preview__info {
    gap: 32px;
    margin-top: 32px;
  }

  .preview__body {
    overflow: visible;
  }

  .preview__body.has-more {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .preview__category {
    margin-right: 0;
  }
}

@media (max-width: 575.98px) {
  .preview {
    padding: 0;
  }

  .preview__panel {
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 0 16px 24px;
    border-radius: 0;
  }

  .preview__bar {
    margin: 0 -16px 4px;
    padding: 10px 8px 10px 16px;
  }

  .preview__slide {
    padding: 16px;
  }

  .preview__thumb {
    width: 72px;
  }

  .preview__title {
    font-size: 26px;
  }

  .zoom__bar {
    padding-left: 16px;
  }

  .zoom__viewport {
    padding: 0 0 76px;
  }

  .zoom__arrow {
    top: auto;
    bottom: 16px;
    margin-top: 0;
  }

  .zoom__arrow--prev {
    left: calc(50% - 56px);
  }

  .zoom__arrow--next {
    right: calc(50% - 56px);
  }
}

/* Touch screens swipe instead of using the stage arrows */
@media (pointer: coarse) {
  .preview__arrow {
    display: none;
  }

  .preview__slide {
    padding: 16px;
  }
}


/* 18. Motion
   ========================================================================== */

/* Scroll reveal (desktop pointers only): the reference's fadeInUp — 20px rise, 1s */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal-ready [data-reveal] {
  opacity: 0;
}

.reveal-ready [data-reveal].is-revealed {
  animation: fade-in-up 1s var(--reveal-delay, 0s) both;
}

@media (prefers-reduced-motion: no-preference) {
  .preview[open],
  .preview[open]::backdrop,
  .zoom:not([hidden]) {
    animation: fade-in .3s ease;
  }

  .preview[open] .preview__panel {
    animation: fade-in-up .4s var(--ease-out-quart);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
