/* =========================================================
   DAVID F. COSTA — Portfolio
   Edit colours, spacing and type scale in :root below.
   ========================================================= */

:root {
  /* Palette */
  --white: #ffffff;
  --black: #000000;
  --pink: #ffb6c1;
  --green: #5cdb76;
  --yellow: #ffcc00;
  --flower-light: #0A34EA; /* the flower's colour in each hero loop */
  --flower-dark: #DC0050;

  /* Theme tokens — light (default). Dark overrides are in [data-theme="dark"] below. */
  --bg: #E3E3E3;   /* exact backdrop of the light hero video — update if the video changes */
  --fg: #000000;
  --grey: #d3d3d3;
  --grey-text: #5c5c5c;
  --rule: #8a8a8a;
  --muted-fill: #b5b5b5;
  --scrim: rgba(0, 0, 0, .18);
  --scrollbar: rgba(0, 0, 0, .28);
  --hairline: rgba(0, 0, 0, .08);
  --toggle-bg: #101010;            /* the toggle previews the other theme */
  --toggle-fg: var(--flower-dark);


  /* Layout */
  --max: 1700px;
  --gutter: clamp(16px, 3.2vw, 56px);
  --rail: calc(28px + 3vw); /* extra left margin holding the vertical archive link; all content aligns after it */
  --header-h: 72px;
  --gap: clamp(16px, 2.4vw, 40px);
  --radius: 6px;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 15px;
  --fs-lg: clamp(16px, 1.25vw, 20px);
  --fs-xl: clamp(22px, 2vw, 30px);

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .55s;
}

/* Dark theme — background is the exact backdrop of the dark hero video */
:root[data-theme="dark"] {
  --bg: #101010;
  --fg: #ffffff;
  --grey: #262626;
  --grey-text: #9a9a9a;
  --rule: #5a5a5a;
  --muted-fill: #4a4a4a;
  --scrim: rgba(0, 0, 0, .5);
  --scrollbar: rgba(255, 255, 255, .3);
  --hairline: rgba(255, 255, 255, .08);
  --toggle-bg: #E3E3E3;
  --toggle-fg: var(--flower-light);
  color-scheme: dark;
}

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

/* Background set on html too, so the canvas, overscroll areas and scrollbar
   gutters never show a different colour */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color-scheme: light;
  scrollbar-color: var(--scrollbar) var(--bg);
  scrollbar-gutter: stable; /* no layout jump when overlays lock page scroll */
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit; color: inherit;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer;
}
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }

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

/* text on the pink / green / yellow blocks stays black in both themes */
.card-media, .archive-item, .product-thumb, .case-hero, .case-gallery .media,
.gallery, .cart-thumb, .about-accent { color: var(--black); }

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

/* every section shares this column: header, hero text, work grid, about, views */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail));
}

/* flower logo standing in for "@" inside email addresses */
.email { text-decoration: none; white-space: nowrap; }
.at-logo {
  display: inline-block;
  width: .74em; height: .74em;
  margin: 0 .05em;
  vertical-align: -.04em;
  transition: transform .8s var(--ease);
}
.at-logo svg { display: block; width: 100%; height: 100%; }
.email:hover .at-logo { transform: rotate(72deg); }

/* =========================================================
   HEADER — transparent standalone text, no boxes
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: transparent;
  pointer-events: none;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand, .nav { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -.01em;
}
.brand-icon {
  width: 20px; height: 20px;
  transition: transform .8s var(--ease);
}
.brand-icon svg { display: block; width: 100%; height: 100%; }
.brand:hover .brand-icon { transform: rotate(72deg); }

.nav { display: flex; gap: clamp(14px, 2vw, 32px); }
.nav-link {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

/* Hover micro-scale — the only hover feedback for text/UI controls (no underlines).
   Uses the standalone `scale` property so it composes with any existing transform. */
.brand, .nav-link, .close-btn, .back-link, .case-next a, .archive-link,
.contact-row, .btn, .gallery-btn, .qty button, .cart-remove, .mobile-menu-link {
  transition: scale .16s cubic-bezier(.2, .8, .2, 1);
}
.brand:hover, .nav-link:hover, .close-btn:hover, .back-link:hover, .case-next a:hover,
.archive-link:hover, .contact-row:hover, .btn:not([disabled]):hover, .gallery-btn:hover,
.qty button:hover, .cart-remove:hover, .mobile-menu-link:hover { scale: 1.05; }
.brand, .mobile-menu-link { transform-origin: left center; }

/* mobile-only controls, enabled in the < 768px block at the end */
.menu-toggle, .mobile-menu { display: none; }
.contact-row { transform-origin: right center; }

/* =========================================================
   A. HERO — video strictly contained
   ========================================================= */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}
/* box the video plays in: full-bleed behind the text on desktop, above it on phones */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
/* only the active theme's video is shown (kept rendered, not display:none, so it can
   load and line up with the current one before the switch) */
video.hero-video:not(.is-active) { opacity: 0; }

/* =========================================================
   THEME TOGGLE — bottom-right swatch of the other theme
   ========================================================= */
.theme-toggle {
  position: fixed;
  right: var(--gutter);
  bottom: 24px;
  z-index: 55; /* above views and the mobile menu, below the cart */
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  box-shadow: 0 0 0 1px var(--hairline);
  transition: scale .16s cubic-bezier(.2, .8, .2, 1);
}
.theme-toggle-icon { width: 24px; height: 24px; transition: transform .5s cubic-bezier(.2, .9, .25, 1); }
.theme-toggle-icon svg { display: block; width: 100%; height: 100%; }
.theme-toggle:hover { scale: 1.08; }
.theme-toggle:hover .theme-toggle-icon { transform: rotate(72deg); }
.theme-toggle:active { scale: .94; }
.theme-toggle.is-switching .theme-toggle-icon { transform: rotate(144deg); }
/* Never show native video controls or play buttons. Separate rules on purpose: a browser
   that doesn't know one of these pseudo-elements must not drop the others with it. */
.hero-video::-webkit-media-controls { display: none !important; }
.hero-video::-webkit-media-controls-panel { display: none !important; }
.hero-video::-webkit-media-controls-overlay-play-button { display: none !important; }
.hero-video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.hero-inner {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-bottom: clamp(28px, 5vh, 64px);
}
/* large, heavy editorial statement */
.hero-intro {
  max-width: 12.5em;
  font-size: clamp(30px, 4.6vw, 84px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}

/* =========================================================
   B. SELECTED WORK
   ========================================================= */
.work { padding: calc(var(--header-h) + 24px) 0 clamp(80px, 12vh, 160px); }

.work-inner { position: relative; }

/* rail sits in the left margin and spans the whole section; link sits at its end and sticks to the viewport bottom */
.archive-rail {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.archive-link {
  position: sticky;
  bottom: 32px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  white-space: nowrap;
  transition: color .3s var(--ease), scale .16s cubic-bezier(.2, .8, .2, 1);
}
.archive-link:hover { color: var(--green); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(48px, 7vw, 120px);
  align-items: start;
}
/* editorial stagger — right column sits lower */
.work-grid > .card:nth-child(2) { margin-top: clamp(80px, 14vw, 240px); }

.card { display: block; cursor: pointer; }
.card-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--green);
  aspect-ratio: var(--ratio, 4 / 5);
}
.card-media > img,
.card-media > video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.card-placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: var(--fs-lg);
  transition: transform 1s var(--ease), opacity .4s var(--ease);
}
.card-cue {
  position: absolute; left: 20px; bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.card:hover .card-media > img,
.card:hover .card-media > video,
.card:hover .card-placeholder { transform: scale(1.035); }
.card:hover .card-cue { opacity: 1; transform: none; }

.card-label {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.01em;
  display: flex; gap: .35em;
}
.card-label .card-title { font-weight: 700; }

/* =========================================================
   E. ABOUT
   ========================================================= */
.about {
  min-height: 100vh;
  padding: calc(var(--header-h) + 48px) 0 clamp(48px, 8vh, 96px);
  display: flex;
}
.about-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 80px;
}
.about-top { max-width: 720px; }
.about-bio {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.about-manifesto {
  margin-top: 1.6em;
  font-size: var(--fs-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.about-accent {
  margin-top: 36px;
  width: min(440px, 70%);
  height: 52px;
  border-radius: var(--radius);
  background: var(--yellow);
}

.contact-list {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.contact-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-xl);
  font-weight: 500;
  letter-spacing: -.02em;
}
.pill {
  display: inline-block;
  width: 48px; height: 26px;
  border-radius: 6px;
  background: var(--pill, var(--grey));
  transition: width .45s var(--ease);
}
.contact-row:hover .pill { width: 72px; }

.site-footer { padding: 24px 0 28px; }
.footer-inner {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  color: var(--grey-text);
}

/* =========================================================
   C. FULL-SCREEN VIEWS
   ========================================================= */
.view {
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--scrollbar) var(--bg);
  /* keep the view on its own GPU layer so scaling never repaints or flashes */
  will-change: transform;
  backface-visibility: hidden;
  /* macOS-style pop: scales up from the centre, no opacity fade */
  transform: scale(.94);
  transform-origin: 50% 50%;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
  transition:
    transform .2s cubic-bezier(.4, 0, 1, 1),
    border-radius .2s cubic-bezier(.4, 0, 1, 1),
    box-shadow .2s linear;
}
.view.is-open {
  z-index: 41; /* the incoming view sits above one that is closing */
  transform: none;
  border-radius: 0;
  box-shadow: none;
  transition:
    transform .34s cubic-bezier(.2, .9, .25, 1.04),
    border-radius .34s cubic-bezier(.2, .9, .25, 1),
    box-shadow .34s linear;
}

.view-inner {
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: 96px;
  position: relative;
}
.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}
.view-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .06em;
}
.close-btn {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .04em;
}
.back-link { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; transform-origin: left center; }

/* --- Case study --- */
.view-case .close-btn {
  position: absolute;
  right: var(--gutter);
  top: calc(var(--header-h) + 16px);
  z-index: 2;
}
.case-hero {
  border-radius: var(--radius);
  background: var(--green);
  aspect-ratio: 16 / 8;
  overflow: hidden;
  display: grid; place-items: center;
  margin-top: 44px;
  font-size: var(--fs-lg);
}
.case-hero > img, .case-hero > video { width: 100%; height: 100%; object-fit: cover; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin: clamp(32px, 5vw, 72px) 0;
}
.case-meta-title {
  grid-column: span 5;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.case-facts {
  grid-column: span 3;
  display: grid; gap: 10px;
  font-size: var(--fs-sm);
}
.case-facts dt { color: var(--grey-text); font-size: var(--fs-xs); letter-spacing: .06em; }
.case-facts dd { margin: 0 0 6px; }
.case-body {
  grid-column: span 4;
  font-size: var(--fs-md);
  line-height: 1.55;
}
.case-body p + p { margin-top: 1em; }

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.case-gallery .media {
  border-radius: var(--radius);
  background: var(--green);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.case-gallery .media.is-full { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.case-gallery .media > img,
.case-gallery .media > video { width: 100%; height: 100%; object-fit: cover; }

.case-next {
  margin-top: clamp(56px, 8vw, 120px);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--fs-sm);
}
.case-next a { font-weight: 600; }
.case-next a:first-child { transform-origin: left center; }
.case-next a:last-child { transform-origin: right center; }

/* --- Archive --- */
.archive-year {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: var(--gap);
  margin-bottom: clamp(32px, 4vw, 64px);
}
.archive-year-label {
  order: 2;
  font-size: var(--fs-sm);
  font-weight: 700;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  align-self: start;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}
.archive-item {
  position: relative;
  border-radius: var(--radius);
  background: var(--green);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: block;
  cursor: default;
}
.archive-item > img, .archive-item > video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s var(--ease), opacity .4s var(--ease);
}
.archive-item .archive-word,
.archive-item .archive-hover {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 16px;
  text-align: center;
  font-size: var(--fs-md);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.archive-item .archive-hover {
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
}
.archive-item:hover .archive-word { opacity: 0; transform: translateY(-6px); }
.archive-item:hover .archive-hover { opacity: 1; transform: none; }
.archive-item:hover > img,
.archive-item:hover > video { transform: scale(1.04); opacity: .25; }

/* --- Shop --- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 24px);
}
.product-card { display: block; }
.product-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--pink);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display: grid; place-items: center;
}
.product-thumb > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s var(--ease);
}
.product-thumb .ph { transition: transform .9s var(--ease); }
.product-card:hover .product-thumb > img,
.product-card:hover .product-thumb .ph { transform: scale(1.04); }

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px 9px;
  background: var(--grey);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: var(--fs-sm);
}
.product-meta .t { font-weight: 600; text-transform: uppercase; letter-spacing: -.01em; }
.product-meta .p { font-size: var(--fs-xs); white-space: nowrap; }
.product-meta .sold { color: var(--grey-text); }

/* --- Product detail --- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: calc(100vh - var(--header-h) - 140px);
}
.gallery {
  position: relative;
  background: var(--pink);
  min-height: 420px;
  overflow: hidden;
}
.gallery-track {
  position: absolute; inset: 0;
  display: flex;
  transition: transform .6s var(--ease);
}
.gallery-slide {
  flex: 0 0 100%;
  display: grid; place-items: center;
  font-weight: 600;
}
.gallery-slide > img { width: 100%; height: 100%; object-fit: cover; }
.gallery-btn {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 28px;
}
.gallery-btn.prev { left: 8px; }
.gallery-btn.next { right: 8px; }
.gallery-count {
  position: absolute; left: 16px; bottom: 14px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em;
}

.product-info {
  background: var(--grey);
  padding: clamp(20px, 2.4vw, 36px);
  display: flex;
  flex-direction: column;
}
.product-info h2 {
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.product-desc {
  margin-top: auto;
  padding-top: 20px;
  border-top: 2px solid var(--rule);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.product-desc p + p { margin-top: .8em; }
.product-specs {
  margin-top: 16px;
  font-size: var(--fs-xs);
  color: var(--grey-text);
  display: grid; gap: 4px;
}
.product-buy {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.product-price { font-size: var(--fs-lg); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .04em;
  transition: background .25s var(--ease), color .25s var(--ease), scale .16s cubic-bezier(.2, .8, .2, 1);
}
.btn:hover { background: var(--green); color: var(--black); }
.btn[disabled] { background: var(--muted-fill); color: var(--bg); cursor: not-allowed; }
.btn.is-added { background: var(--green); color: var(--black); }

/* =========================================================
   D. CART DRAWER
   ========================================================= */
.cart-scrim {
  position: fixed; inset: 0;
  z-index: 60;
  background: var(--scrim);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.cart-scrim.is-open { opacity: 1; }

.cart {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 70;
  width: min(440px, 100vw);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 24px;
  transform: translateX(100%);
  transition: transform .5s var(--ease);
  box-shadow: -1px 0 0 var(--hairline);
}
.cart.is-open { transform: none; }

.cart-head {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-title { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .04em; }

.cart-items { flex: 1; overflow-y: auto; }
.cart-empty { padding: 24px 0; font-size: var(--fs-sm); color: var(--grey-text); }
.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--grey);
  font-size: var(--fs-sm);
}
.cart-item:last-child { border-bottom: 1px solid var(--grey); }
.cart-thumb {
  aspect-ratio: 4 / 5;
  background: var(--pink);
  border-radius: 4px;
  overflow: hidden;
}
.cart-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-title { font-weight: 600; text-transform: uppercase; }
.cart-item-variant { color: var(--grey-text); font-size: var(--fs-xs); margin-top: 2px; }
.qty {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 12px;
  font-size: var(--fs-sm);
}
.qty button { width: 20px; height: 20px; font-weight: 600; }
.cart-item-side { text-align: right; display: flex; flex-direction: column; justify-content: space-between; }
.cart-remove { font-size: var(--fs-xs); color: var(--grey-text); }
.cart-remove:hover { color: var(--fg); }

.cart-foot { padding-top: 20px; display: grid; gap: 10px; }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: var(--fs-md); }
.cart-note { font-size: var(--fs-xs); color: var(--grey-text); }
.cart-foot .btn { width: 100%; margin-top: 6px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-meta-title { grid-column: 1 / -1; }
  .case-facts { grid-column: span 4; }
  .case-body { grid-column: span 8; }
}

@media (max-width: 800px) {
  :root { --header-h: 60px; --rail: 0px; }
  .nav { gap: 14px; }
  .nav-link { font-size: 12px; }
  .brand { font-size: 14px; }
  .card-label { font-size: 14px; }
  .brand-icon { width: 15px; height: 15px; }

  .work-inner { display: flex; flex-direction: column; gap: 40px; }
  .archive-rail { order: 2; position: static; }
  .archive-link {
    position: static; writing-mode: horizontal-tb;
    transform: none;
    font-size: var(--fs-sm);
  }
  .work-grid { grid-template-columns: 1fr; row-gap: 40px; }
  .work-grid > .card:nth-child(2) { margin-top: 0; }

  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-year { grid-template-columns: 1fr; }
  .archive-year-label { order: 0; position: static; }

  .product-detail { grid-template-columns: 1fr; min-height: 0; }
  .product-info h2 { margin-bottom: 40px; }
  .gallery { aspect-ratio: 4 / 5; min-height: 0; }

  .case-hero { aspect-ratio: 4 / 3; }
  .case-meta { grid-template-columns: 1fr; }
  .case-meta > * { grid-column: auto !important; }
  .case-gallery { grid-template-columns: 1fr; }
  .case-gallery .media.is-full { aspect-ratio: 4 / 3; }
}

@media (max-width: 520px) {
  .brand-text { font-size: 12px; }
  .nav { gap: 10px; }
  .nav-link { font-size: 11px; }
  .shop-grid { grid-template-columns: 1fr; }
  .contact-row { font-size: 20px; }
}

/* =========================================================
   PHONES (< 768px)
   ========================================================= */
@media (max-width: 767px) {
  /* brand always on one line */
  .brand { white-space: nowrap; flex-shrink: 0; }

  /* header: page links move into the MENU overlay; cart stays */
  .nav-page { display: none; }
  .menu-toggle { display: inline-block; }

  .mobile-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 48; /* above views, below the header (so CLOSE stays visible) and the cart */
    background-color: var(--bg);
    padding-top: calc(var(--header-h) + 32px);
    transform: translateY(-100%);
    transition: transform .4s cubic-bezier(.2, .9, .25, 1);
  }
  .mobile-menu.is-open { transform: none; }
  .mobile-menu-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .mobile-menu-link {
    font-size: clamp(40px, 12vw, 60px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.045em;
  }

  /* Hero: as on desktop, the video fills the whole hero behind the statement.
     The video stays visible at all times: iOS won't autoplay a hidden video. Its poster
     (the file's first frame) covers loading. */
  .hero-media { container-type: size; }
  /* statement sits above the theme toggle */
  .hero-inner { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .theme-toggle {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 44px; height: 44px;
  }
  .theme-toggle-icon { width: 20px; height: 20px; }
  .hero-intro {
    max-width: none;
    font-size: clamp(24px, 7.2vw, 34px); /* 27px on an iPhone SE */
    line-height: 1.04;
    letter-spacing: -.04em;
  }

  /* Portrait video. A portrait file (data-mobile-src on the <video>) simply fills the box
     with object-fit: cover. Until one exists, the landscape video is rotated 90°: sized
     box-height × box-width (container units) before rotating, so it lands exactly on the box. */
  .hero .hero-video { object-fit: cover; }
  .hero-video.is-rotated {
    inset: auto;
    top: 50%; left: 50%;
    width: 100cqh;
    max-width: none;
    height: 100cqw;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}

/* portrait screens: show the whole animation instead of cropping it */
@media (max-aspect-ratio: 1 / 1) {
  .hero-video { object-fit: contain; }
}

/* =========================================================
   CUSTOM CURSOR — mouse only. The standard professional setup:
   - script.js adds .has-custom-cursor to <html> once it is running; only then is the
     system cursor hidden (cursor: none on every element). If the script fails, the
     normal cursor stays.
   - the drawn cursor (.cursor) is moved to the exact pointer position on every movement,
     with no smoothing, so it never trails; CSS animates hover and click.
   - .cursor-nudge: while the mouse is still, script.js flips <html> between two invisible
     cursor values so the browser re-applies "hidden". Some macOS mouse utilities (e.g. Logi
     Options+, Mos) bring the system arrow back while the mouse is idle; this hides it again.
   ========================================================= */
:root { --cursor-fill: #000000; --cursor-edge: #ffffff; }
:root[data-theme="dark"] { --cursor-fill: #ffffff; --cursor-edge: #101010; }

.cursor { display: none; }
.has-custom-cursor,
.has-custom-cursor * { cursor: none !important; }
.has-custom-cursor.cursor-nudge,
.has-custom-cursor.cursor-nudge * {
  cursor: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") 0 0, none !important;
}

.has-custom-cursor .cursor {
  display: block;
  position: fixed;
  left: 0; top: 0;
  width: 40px; height: 40px;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;                 /* until the first movement; again when the pointer leaves */
  transition: opacity .15s linear;
  will-change: transform;
  contain: strict;
}
.cursor.is-visible { opacity: 1; }
.cursor svg {
  display: block;
  width: 100%; height: 100%;
  overflow: visible;
  transform-origin: 4.15px 4.75px; /* the tip: animations never move the click point */
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); /* release: springy overshoot */
}
.cursor-shape {
  fill: var(--cursor-fill);
  stroke: var(--cursor-edge);
  stroke-width: 1.2;
  stroke-linejoin: round;
  paint-order: stroke;
}
/* over anything clickable: grows a little */
.cursor.is-hover svg { transform: scale(1.12); }
/* press: quick squeeze, then springs back on release */
.cursor.is-down svg {
  transform: scale(.78);
  transition: transform .1s cubic-bezier(.2, .8, .2, 1);
}
.cursor.is-hover.is-down svg { transform: scale(.88); }

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