/* ------------------------------------------------------------------
   scep.city — layout and components. Tokens live in tokens.css.
   ------------------------------------------------------------------ */

/* Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
html[data-theme="light"] { color-scheme: light; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-chip);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.skip-link:focus { top: .75rem; }

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

/* Primitives ------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* Mono label: "01 / Product", nav items, small data */
.hud {
  font-family: var(--font-mono);
  font-size: var(--text-hud);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* Status chip: our domain only (OFFLINE · TILES CACHED, DEM · LOADED …) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .4em .75em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-chip);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: .5em; height: .5em;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.chip--warn::before { background: var(--warn); }
.chip--warn { color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Buttons: solid = ink on paper, ghost = hairline */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--text-hud);
  font-weight: 550;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, opacity var(--dur) ease;
}
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { opacity: .88; }
.btn--ghost { border-color: var(--line); color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); }
.btn .arrow { width: .75em; height: .75em; }

/* Section frame: mono folio + one-line title */
.section {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}
.section__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.folio {
  display: flex;
  align-items: baseline;
  gap: .625rem;
  margin-bottom: 1.25rem;
  color: var(--fg-muted);
}
.folio__num { color: var(--accent); }
.folio__sep { color: var(--fg-faint); }
.section__title {
  font-size: var(--text-title);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
  padding-block: .09em;
}
.section__lead {
  margin-top: 1.25rem;
  max-width: 40rem;
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--fg-muted);
}

/* Nav -------------------------------------------------------------- */
.nav {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .35s ease, border-color .35s ease;
}
.nav--scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom-color: var(--line-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.nav__logo img {
  height: 28px;
  width: auto;
}
.nav__logo span {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.nav__links {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}
.nav__links a,
.lang a, .lang span {
  color: var(--fg-muted);
  transition: color var(--dur) ease;
  padding: .25rem 0;
}
.nav__links a:hover, .lang a:hover { color: var(--fg); }
.nav__actions {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.75rem);
}
.lang { display: flex; gap: .4rem; }
.lang a[aria-current="page"] { color: var(--fg); }
.lang__sep { color: var(--fg-faint); }
.btn--sm { padding: .6rem 1rem; }

/* Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 3rem) 0 clamp(3rem, 8vh, 5.5rem);
  isolation: isolate;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.field {
  display: block;
  width: 100%;
  height: 100%;
}
.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--shade-top) 0%, transparent 28%, var(--shade-low) 78%, var(--bg) 100%),
    linear-gradient(90deg, var(--shade-side) 0%, transparent 55%);
  transition: background .35s ease;
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--fg-muted);
}
.hero__title {
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}
.hero__sub {
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 34rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .875rem 1.5rem;
}
.hero__aside {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
  padding: .3rem 0;
  transition: color var(--dur) ease, border-color var(--dur) ease;
}
.hero__aside:hover { color: var(--fg); border-color: var(--fg); }
.hero__aside .arrow { width: .7em; height: .7em; }

/* 01 / Product ----------------------------------------------------- */
.product__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.product__lead {
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--fg-muted);
  margin-bottom: 2.25rem;
}
.product__list li {
  display: grid;
  gap: .35rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.product__list li:last-child { border-bottom: 1px solid var(--line); }
.product__k { color: var(--fg); }
.product__v { color: var(--fg-muted); font-size: .9375rem; line-height: 1.55; }
.product__actions { margin-top: 2.25rem; }

.product__shot { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.shot {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.shot img { width: 100%; height: auto; }
.shot__chips {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
}
.product__shot figcaption {
  margin-top: .9rem;
  color: var(--fg-muted);
  font-size: var(--text-chip);
  letter-spacing: .08em;
}

/* 02 / In progress ------------------------------------------------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.project {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.project__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.project__name { color: var(--accent); }
.project__title {
  font-size: clamp(1.25rem, 1.9vw, 1.625rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.project__body { color: var(--fg-muted); }
.project__chips { margin-top: auto; }
.project__link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  align-self: flex-start;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
  padding: .3rem 0;
  transition: color var(--dur) ease, border-color var(--dur) ease;
}
a.project__link:hover { color: var(--fg); border-color: var(--fg); }
.project__link .arrow { width: .7em; height: .7em; }
.project__link--soon { border-bottom-color: transparent; }

/* Photo band between sections -------------------------------------- */
.band {
  position: relative;
  height: clamp(18rem, 48vh, 34rem);
  overflow: hidden;
  isolation: isolate;
  border-top: 1px solid var(--line);
}
.band .field {
  position: absolute;
  inset: 0;
}
.band__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 28%, transparent 70%, var(--bg) 100%);
  transition: background .35s ease;
  pointer-events: none;
}
.band__meta {
  position: absolute;
  inset: auto 0 clamp(1.25rem, 4vh, 2.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--fg-muted);
}

/* 02 / Approach ---------------------------------------------------- */
.points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.point {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.point__num { color: var(--accent); }
.point__title {
  font-size: clamp(1.25rem, 1.9vw, 1.625rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.point__body { color: var(--fg-muted); max-width: 36rem; }

/* 03 / Ecosystem (paper band, same in both themes) ------------------ */
.section--paper {
  --fg: var(--paper-fg);
  --fg-muted: var(--paper-fg-muted);
  --fg-faint: #8f928e;
  --accent: var(--paper-accent);
  --line: var(--paper-line);
  --line-soft: rgba(10, 21, 18, .1);
  background: var(--paper);
  color: var(--fg);
  border-top: 0;
}
.section--paper :focus-visible { outline-color: var(--paper-fg); }
.marques {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.marques__item {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marques__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(8rem, 16vw, 12rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: background-color var(--dur) ease;
}
a.marques__link:hover { background: rgba(10, 21, 18, .04); }
.marques__logo {
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: .82;
  transition: opacity var(--dur) ease;
}
.marques__link:hover .marques__logo { opacity: 1; }
/* Penrose and 5andCo publish light-on-dark marks; invert them for paper. */
.marques__logo--penrose { height: 4.25rem; filter: invert(1) brightness(.15); }
.marques__logo--cercle { height: 3.25rem; }
.marques__logo--cinq { height: 4.5rem; filter: invert(1); }

/* 04 / Contact ----------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: end;
}
.contact__head { margin-bottom: 0; }
.contact__list li a {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  transition: color var(--dur) ease;
}
.contact__list li:last-child a { border-bottom: 1px solid var(--line); }
.contact__list a:hover { color: var(--fg); }
.contact__value { color: var(--fg); font-size: var(--text-lead); letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact__list .arrow { width: .8em; height: .8em; align-self: center; }

/* Footer ----------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  /* Leave room for the wall switch in the bottom-right corner. */
  padding-right: 3.25rem;
  color: var(--fg-muted);
  font-size: var(--text-chip);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
}
.footer__legal { border-bottom: 1px solid var(--line); transition: color var(--dur) ease, border-color var(--dur) ease; }
.footer__legal:hover { color: var(--fg); border-color: var(--fg); }

/* Wall switch — flush bottom-right; lights on, chickens on ---------
   Easter egg. Markup, sounds and behaviour must not change. */
.theme-toggle {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  width: 3.25rem;
  height: 4.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--switch-plate);
  box-shadow:
    inset 0 0 0 1px var(--switch-plate-edge),
    -1px -1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .35s ease;
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}
.theme-toggle .switch-well {
  position: relative;
  width: 1.55rem;
  height: 2.85rem;
  border-radius: 2px;
  background: #0a0a0a;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}
.theme-toggle .switch-rocker {
  position: absolute;
  left: 0.12rem;
  right: 0.12rem;
  height: 1.35rem;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--switch-rocker-face), var(--switch-rocker));
  box-shadow:
    0 1px 2px var(--switch-rocker-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: top .18s cubic-bezier(.2, .8, .2, 1), transform .18s cubic-bezier(.2, .8, .2, 1);
  /* Off = lights down (dark mode) */
  top: 1.35rem;
  transform: perspective(40px) rotateX(-12deg);
  transform-origin: center top;
}
html[data-theme="light"] .theme-toggle .switch-rocker {
  top: 0.14rem;
  transform: perspective(40px) rotateX(12deg);
  transform-origin: center bottom;
}

/* Responsive / motion --------------------------------------------- */
@media (max-width: 900px) {
  .product__grid { grid-template-columns: 1fr; }
  .product__shot { position: static; order: -1; }
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .contact__list li a { grid-template-columns: 1fr auto; }
  .contact__list li a .hud { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .points { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: 1fr; }
  .marques { grid-template-columns: 1fr; }
  .marques__link { min-height: 7rem; }
  .band__meta { flex-direction: column; align-items: flex-start; gap: .75rem; }
  /* Single page: section links collapse, the page still scrolls to them. */
  .nav { grid-template-columns: auto auto; justify-content: space-between; }
  .nav__links { display: none; }
  .nav__logo span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
