/* ==========================================================================
   Teraltus · design system
   Concept: terra (ground) + altus (high). The page is an ascent.
   Archetype: warm editorial. Bone paper, warm ink, one ember accent.
   ========================================================================== */

:root {
  /* Colour: oklch, never pure black or white */
  --paper:      oklch(0.965 0.012 82);
  --paper-2:    oklch(0.935 0.017 80);
  --paper-3:    oklch(0.9 0.02 78);
  --ink:        oklch(0.22 0.018 60);
  --ink-deep:   oklch(0.185 0.015 58);
  --ink-soft:   oklch(0.27 0.018 60);

  --text-1:     var(--ink);
  --text-2:     oklch(0.38 0.016 60);
  --text-3:     oklch(0.5 0.013 60);
  --text-4:     oklch(0.62 0.01 60);

  --on-dark-1:  oklch(0.95 0.012 82);
  --on-dark-2:  oklch(0.8 0.012 80);
  --on-dark-3:  oklch(0.66 0.012 78);
  --on-dark-4:  oklch(0.5 0.012 70);

  --accent:     oklch(0.66 0.16 42);   /* highland soil / ember */
  --accent-ink: oklch(0.52 0.15 40);   /* accent at text contrast on paper */

  --line:       oklch(0.22 0.018 60 / 0.1);
  --line-dark:  oklch(0.95 0.012 82 / 0.1);

  /* Type */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body:    "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:    "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-hero:  clamp(5.5rem, 17vw + 2rem, 17rem);
  --fs-h2:    clamp(2.75rem, 7.2vw, 7.5rem);
  --fs-h3:    clamp(1.6rem, 2.6vw, 2.4rem);
  --fs-xl:    clamp(1.75rem, 3.6vw, 3.6rem);
  --fs-lg:    clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
  --fs-body:  clamp(1.0625rem, 0.98rem + 0.3vw, 1.25rem);
  --fs-sm:    0.9375rem;
  --fs-label: 0.75rem;

  /* Space */
  --gutter:   clamp(1rem, 4vw, 3.5rem);
  --s-1: 0.5rem;  --s-2: 1rem;  --s-3: 1.5rem;  --s-4: 2.5rem;
  --s-5: 4rem;    --s-6: 6rem;  --s-7: 9rem;    --s-8: 13rem;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout:  cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-micro: 150ms; --t-sm: 250ms; --t-md: 400ms; --t-lg: 600ms;

  --radius: 2px;
  --contour: oklch(0.22 0.018 60);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--text-1);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol { list-style: none; padding: 0; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--ink-deep); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.skip {
  position: fixed; top: var(--s-2); left: var(--s-2); z-index: 200;
  padding: 0.75rem 1rem; background: var(--ink); color: var(--paper);
  transform: translateY(-200%);
  transition: transform var(--t-sm) var(--ease-out);
}
.skip:focus { transform: none; }

/* ---------- Primitives ---------- */
.label {
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
}
div.label { display: flex; gap: 1.25em; color: var(--text-3); }
div.label[data-reveal] span:first-child { color: var(--accent-ink); }

h1, h2, h3 { font-weight: 400; }
h2 em, h1 em { font-style: italic; }

/* split-text wrappers (built by main.js) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.w__i { display: inline-block; will-change: transform; }

/* Button */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  position: relative;
  display: inline-flex; align-items: center; gap: 0.9rem;
  padding: 0.55rem 0.55rem 0.55rem 1.4rem;
  min-height: 3.25rem;
  background: var(--bg); color: var(--fg);
  border-radius: 100px;
  font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0;
  isolation: isolate; overflow: hidden;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  border-radius: inherit;
  transition: transform var(--t-md) var(--ease-out);
}
.btn__icon {
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  transition: transform var(--t-md) var(--ease-out);
}
.btn__icon svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn--light { --bg: var(--paper); --fg: var(--ink); }
@media (hover: hover) {
  .btn:hover::before { transform: translateY(0); }
  .btn:hover { color: var(--ink-deep); }
  .btn:hover .btn__icon { transform: rotate(45deg); background: var(--ink-deep); color: var(--accent); }
}

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: var(--s-3);
  padding: var(--gutter);
  background: var(--ink-deep); color: var(--on-dark-1);
  clip-path: inset(0 0 0% 0);
}
.reduced .preloader { display: none; }
.preloader__row { display: flex; justify-content: space-between; align-items: flex-end; }
.preloader__row .label { color: var(--on-dark-3); }
.preloader__count {
  font-family: var(--f-display);
  font-size: clamp(5rem, 22vw, 20rem);
  line-height: 0.8; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.preloader__count small { font-size: 0.25em; letter-spacing: 0; margin-left: 0.15em; color: var(--accent); }
.preloader__bar { height: 1px; background: var(--line-dark); }
.preloader__bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  .has-cursor .cursor { display: block; }
  .has-cursor, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }
  .has-cursor input, .has-cursor textarea { cursor: text; }
}
.cursor { position: fixed; inset: 0 auto auto 0; z-index: 140; pointer-events: none; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
.cursor__dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: var(--accent);
}
.cursor__ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid oklch(0.22 0.018 60 / 0.35);
  display: grid; place-items: center;
  transition: width var(--t-md) var(--ease-out), height var(--t-md) var(--ease-out),
              margin var(--t-md) var(--ease-out), background-color var(--t-md) var(--ease-out),
              border-color var(--t-md) var(--ease-out);
}
.cursor__label {
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-deep); opacity: 0; transition: opacity var(--t-sm) var(--ease-out);
}
.cursor.is-label .cursor__ring {
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  background: var(--accent); border-color: transparent;
}
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.on-dark .cursor__ring { border-color: oklch(0.95 0.012 82 / 0.35); }

/* ---------- Altimeter ---------- */
.altimeter {
  position: fixed; left: var(--gutter); bottom: var(--gutter); z-index: 50;
  display: none; align-items: flex-end; gap: 0.75rem;
  mix-blend-mode: difference; color: oklch(0.8 0.01 80);
  pointer-events: none;
  transition: opacity var(--t-md) var(--ease-out);
}
.altimeter.is-away { opacity: 0; }
@media (min-width: 1100px) { .altimeter { display: flex; } }
.altimeter__track { position: relative; width: 1px; height: 120px; background: oklch(0.8 0.01 80 / 0.3); }
.altimeter__fill { position: absolute; inset: auto 0 0; height: 100%; background: currentColor; transform-origin: bottom; transform: scaleY(0); }
.altimeter__val { font-variant-numeric: tabular-nums; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 1.25rem var(--gutter);
  color: oklch(0.86 0.01 80);
  mix-blend-mode: difference;
  transition: transform var(--t-lg) var(--ease-out);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 500; font-size: 1.05rem; letter-spacing: -0.02em; justify-self: start; }
.mark { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.mark circle { fill: currentColor; stroke: none; }
.nav__links { display: none; gap: 2.25rem; font-size: var(--fs-sm); }
.nav__links a { position: relative; padding-block: 0.25rem; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform var(--t-md) var(--ease-out);
}
@media (hover: hover) {
  .nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
}
.nav__time { display: none; justify-self: end; align-items: center; gap: 0.6rem; }
.nav__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.4s var(--ease-inout) infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.nav__menu { justify-self: end; grid-column: 3; font-size: var(--fs-sm); font-weight: 500; padding: 0.5rem 0; min-height: 44px; }
.nav__menu-close { display: none; }
.menu-open .nav__menu-open { display: none; }
.menu-open .nav__menu-close { display: inline; }

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__time { display: inline-flex; }
  .nav__menu { display: none; }
}

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 6rem var(--gutter) var(--gutter);
  background: var(--ink-deep); color: var(--on-dark-1);
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--t-lg) var(--ease-inout);
}
.menu[hidden] { display: none; }
.menu-open .menu { clip-path: inset(0 0 0 0); }
.menu ol { display: grid; gap: 0.25rem; }
.menu a {
  display: flex; align-items: baseline; gap: 1rem;
  font-family: var(--f-display); font-size: clamp(3rem, 15vw, 5rem); line-height: 1.05; letter-spacing: -0.03em;
}
.menu a .label { color: var(--accent); }
.menu > .label { color: var(--on-dark-3); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 6.5rem var(--gutter) var(--s-4);
  overflow: hidden;
}
.contours {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.hero > *:not(.contours) { position: relative; z-index: 1; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
  color: var(--text-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.hero__meta span:first-child { color: var(--text-2); }
.hero__meta span:not(.hero__elev)::before { content: "+"; margin-right: 0.6em; color: var(--accent-ink); }
.hero__elev { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }

.hero__title {
  align-self: center;
  font-family: var(--f-display);
  font-size: var(--fs-hero);
  line-height: 0.86;
  letter-spacing: -0.045em;
  padding-block: var(--s-4);
}
.line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.line__inner { display: block; }
.line--offset { padding-left: 0.45em; }
.line--offset em { color: var(--accent-ink); }

.hero__foot {
  display: grid; gap: var(--s-3);
  grid-template-columns: 1fr;
  align-items: end;
}
.hero__lede { max-width: 30ch; font-size: var(--fs-lg); line-height: 1.35; letter-spacing: -0.02em; color: var(--text-2); }
.hero__scroll { display: none; align-items: center; gap: 1rem; color: var(--text-3); }
.hero__scroll-line { position: relative; width: 64px; height: 1px; background: var(--line); overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--text-2);
  animation: scrollcue 2.2s var(--ease-inout) infinite;
}
@keyframes scrollcue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

@media (min-width: 900px) {
  .hero__foot { grid-template-columns: 1.3fr auto 1fr; }
  .hero__scroll { display: inline-flex; justify-self: end; }
  .line--offset { padding-left: 2.1em; }
}

/* ---------- The name ---------- */
.name {
  display: grid; gap: var(--s-4);
  padding: var(--s-7) var(--gutter) var(--s-6);
}
.name__title {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 22ch;
  text-wrap: balance;
}
.name__title em { color: var(--accent-ink); }
.name__def {
  display: grid; gap: var(--s-4);
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.name__def dt { color: var(--text-3); margin-bottom: 0.75rem; }
.name__def dd { max-width: 38ch; color: var(--text-2); }
@media (min-width: 900px) {
  .name { grid-template-columns: repeat(12, 1fr); }
  .name__label { grid-column: 1 / 4; padding-top: 1rem; }
  .name__body { grid-column: 4 / -1; }
  .name__def { grid-template-columns: 1fr 1fr; }
}

/* ---------- Manifesto ---------- */
.manifesto {
  padding: var(--s-6) var(--gutter) var(--s-8);
}
.manifesto__text {
  font-size: var(--fs-xl);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 400;
  max-width: 24ch;
  margin-left: auto;
}
@media (min-width: 900px) { .manifesto__text { max-width: 26ch; margin-right: 8vw; } }
.manifesto__text .w { overflow: visible; }

/* ---------- Services (dark, full bleed) ---------- */
.services {
  background: var(--ink-deep); color: var(--on-dark-1);
  padding: var(--s-7) var(--gutter) var(--s-6);
  border-radius: clamp(16px, 2.5vw, 36px) clamp(16px, 2.5vw, 36px) 0 0;
}
.services div.label, .climb div.label, .contact div.label { color: var(--on-dark-3); }
.services div.label span:first-child,
.climb div.label span:first-child,
.contact div.label span:first-child { color: var(--accent); }

.services__head { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); }
.services__title, .climb__title, .principles__title, .contact__title {
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.services__title em { color: var(--on-dark-3); }

.svc-list { border-top: 1px solid var(--line-dark); }
.svc { border-bottom: 1px solid var(--line-dark); }
.svc__row {
  width: 100%;
  display: grid; align-items: baseline;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.5rem 1rem;
  padding: clamp(1.25rem, 2.5vw, 2.25rem) 0;
  text-align: left;
}
.svc__num { color: var(--on-dark-4); transition: color var(--t-md) var(--ease-out); }
.svc__name {
  font-family: var(--f-display);
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.95; letter-spacing: -0.035em;
  transition: transform var(--t-lg) var(--ease-out), color var(--t-md) var(--ease-out);
}
.svc__line { grid-column: 2 / 3; color: var(--on-dark-3); font-size: var(--fs-sm); }
.svc__toggle {
  grid-column: 3; grid-row: 1;
  position: relative; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line-dark);
  align-self: center;
  transition: background-color var(--t-md) var(--ease-out), border-color var(--t-md) var(--ease-out), transform var(--t-md) var(--ease-out);
}
.svc__toggle::before, .svc__toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1px;
  background: currentColor; translate: -50% -50%;
  transition: transform var(--t-md) var(--ease-out);
}
.svc__toggle::after { transform: rotate(90deg); }
.svc__row[aria-expanded="true"] .svc__toggle { background: var(--accent); border-color: var(--accent); color: var(--ink-deep); transform: rotate(180deg); }
.svc__row[aria-expanded="true"] .svc__toggle::after { transform: rotate(0deg); }
.svc__row[aria-expanded="true"] .svc__num { color: var(--accent); }

@media (hover: hover) {
  .svc__row:hover .svc__name { transform: translateX(0.6rem); }
  .svc__row:hover .svc__num { color: var(--accent); }
  .svc__row:hover .svc__toggle { border-color: var(--on-dark-3); }
}

.svc__panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-lg) var(--ease-out);
}
.svc__panel > .svc__inner { overflow: hidden; }
.svc__row[aria-expanded="true"] + .svc__panel { grid-template-rows: 1fr; }
.svc__inner p { max-width: 52ch; color: var(--on-dark-2); padding-top: 0.25rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: var(--s-3) 0 var(--s-4); }
.tags li {
  font-size: 0.8125rem; padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-dark); border-radius: 100px; color: var(--on-dark-2);
}

@media (min-width: 900px) {
  .services__head { grid-template-columns: repeat(12, 1fr); align-items: end; }
  .services__head > .label { grid-column: 1 / 4; align-self: start; padding-top: 1rem; }
  .services__title { grid-column: 4 / -1; }
  .svc__row { grid-template-columns: 3fr 6fr 3fr; }
  .svc__num { grid-column: 1; }
  .svc__name { grid-column: 2; }
  .svc__line { grid-column: 3; grid-row: 1; align-self: center; }
  .svc__toggle { display: none; }
  .svc__inner { display: grid; grid-template-columns: 3fr 6fr 3fr; }
  .svc__inner p { grid-column: 2; }
  .svc__inner .tags { grid-column: 2; }
}

/* ---------- Climb (method) ---------- */
.climb {
  background: var(--ink-deep); color: var(--on-dark-1);
  padding: var(--s-6) 0 var(--s-7);
  overflow: hidden;
}
.climb__head { display: grid; gap: var(--s-3); padding: 0 var(--gutter); margin-bottom: var(--s-5); }
.climb__title em { color: var(--accent); }
.climb__intro { max-width: 36ch; color: var(--on-dark-2); }
@media (min-width: 900px) {
  .climb__head { grid-template-columns: repeat(12, 1fr); align-items: end; }
  .climb__head > .label { grid-column: 1 / 4; align-self: start; padding-top: 1rem; }
  .climb__title { grid-column: 4 / 9; }
  .climb__intro { grid-column: 9 / -1; }
}

.climb__viewport { position: relative; }
.climb__track { position: relative; padding: 0 var(--gutter); }
.climb__profile {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  width: 100%; pointer-events: none; display: none;
}
.climb__ridge {
  fill: none; stroke: var(--accent); stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
.climb__camps { display: grid; gap: var(--s-2); counter-reset: camp; }
.camp {
  position: relative;
  padding: var(--s-3);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: oklch(0.21 0.016 58);
  transition: border-color var(--t-md) var(--ease-out);
}
.camp__elev { color: var(--accent); }
.camp__name {
  font-family: var(--f-display); font-size: var(--fs-h3); line-height: 1; letter-spacing: -0.02em;
  margin: var(--s-4) 0 var(--s-2);
}
.camp p { color: var(--on-dark-2); font-size: var(--fs-sm); max-width: 34ch; }
.camp.is-active { border-color: oklch(0.66 0.16 42 / 0.6); }

/* Desktop: pinned horizontal ascent, camps rise like the terrain */
@media (min-width: 900px) {
  .climb.is-horizontal {
    height: 100vh; min-height: 640px;
    display: flex; flex-direction: column;
    padding: clamp(5rem, 11vh, 8rem) 0 clamp(2rem, 6vh, 4rem);
  }
  .climb.is-horizontal .climb__head { margin-bottom: 0; }
  .climb.is-horizontal .climb__viewport { flex: 1; }
  .climb.is-horizontal .climb__track { position: absolute; inset: 0 auto 0 0; width: max-content; height: 100%; }
  .climb.is-horizontal .climb__profile { display: block; }
  .climb.is-horizontal .climb__camps {
    position: relative; height: 100%;
    grid-template-columns: repeat(4, min(26rem, 28vw)); column-gap: 16vw; align-items: end;
    padding-left: 22vw; padding-right: var(--gutter);
  }
  .climb.is-horizontal .camp { background: var(--ink-deep); }
  /* each camp sits higher on the ridge than the last */
  .climb.is-horizontal .camp:nth-child(1) { margin-bottom: 2vh; }
  .climb.is-horizontal .camp:nth-child(2) { margin-bottom: 9vh; }
  .climb.is-horizontal .camp:nth-child(3) { margin-bottom: 17vh; }
  .climb.is-horizontal .camp:nth-child(4) { margin-bottom: 26vh; }
}

/* ---------- Principles (bento) ---------- */
.principles { padding: var(--s-7) var(--gutter) var(--s-7); background: var(--paper); }
.principles__head { display: grid; gap: var(--s-3); margin-bottom: var(--s-5); }
.principles__title em { color: var(--accent-ink); }
@media (min-width: 900px) {
  .principles__head { grid-template-columns: repeat(12, 1fr); align-items: end; }
  .principles__head > .label { grid-column: 1 / 4; align-self: start; padding-top: 1rem; }
  .principles__title { grid-column: 4 / -1; }
}

.bento { display: grid; gap: 0.75rem; }
.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-4);
  padding: clamp(1.25rem, 2.2vw, 2rem);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 15rem;
  overflow: hidden;
  transition: transform var(--t-lg) var(--ease-out);
}
.tile__idx { color: var(--text-4); font-style: normal; }
.tile h3 { font-family: var(--f-display); font-size: var(--fs-h3); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; }
.tile p { color: var(--text-2); font-size: var(--fs-sm); max-width: 40ch; }
.tile--lead { background: var(--paper-3); }
.tile--lead h3 { font-size: clamp(2.2rem, 4.2vw, 4rem); max-width: 12ch; }
.tile--accent { background: var(--accent); border-color: transparent; color: var(--ink-deep); }
.tile--accent p, .tile--accent .tile__idx { color: oklch(0.25 0.04 40); }
.tile--dark { background: var(--ink); color: var(--on-dark-1); border-color: transparent; }
.tile--dark p { color: var(--on-dark-2); }
.tile--dark .tile__idx { color: var(--on-dark-4); }

/* faint contour ornament in the lead tile */
.tile--lead::after {
  content: ""; position: absolute; right: -12%; bottom: -30%; width: 70%; aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 18px, var(--line) 18px 19px);
  pointer-events: none;
}

@media (min-width: 700px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile--lead, .tile--wide { grid-column: span 2; }
}
@media (min-width: 1100px) {
  .bento { grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(15rem, auto); }
  .tile--lead  { grid-column: 1 / 8; grid-row: span 2; }
  .tile--accent{ grid-column: 8 / -1; }
  .tile:nth-child(3) { grid-column: 8 / -1; }
  .tile--dark  { grid-column: 1 / 5; }
  .tile--wide  { grid-column: 5 / -1; flex-direction: row; align-items: flex-end; }
  .tile--wide h3 { max-width: 10ch; }
  .tile--wide p { margin-left: auto; }
}

/* ---------- Contact ---------- */
.contact {
  background: var(--ink-deep); color: var(--on-dark-1);
  padding: var(--s-7) var(--gutter) var(--s-6);
  display: grid; gap: var(--s-5);
  border-radius: clamp(16px, 2.5vw, 36px) clamp(16px, 2.5vw, 36px) 0 0;
}
.contact__head { display: grid; gap: var(--s-3); align-content: start; }
.contact__title em { color: var(--accent); }
.contact__lede { max-width: 36ch; color: var(--on-dark-2); }
.contact__mail {
  justify-self: start;
  font-family: var(--f-display); font-size: var(--fs-h3); letter-spacing: -0.02em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--t-md) var(--ease-out), color var(--t-md) var(--ease-out);
}
@media (hover: hover) {
  .contact__mail:hover { color: var(--accent); background-size: 0% 1px; background-position: 100% 100%; }
}

.form { display: grid; gap: var(--s-4); align-content: start; }
.form__chips { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form__chips legend { color: var(--on-dark-3); margin-bottom: 1rem; float: left; width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 1.1rem; border-radius: 100px;
  border: 1px solid var(--line-dark); font-size: var(--fs-sm);
  transition: background-color var(--t-sm) var(--ease-out), color var(--t-sm) var(--ease-out), border-color var(--t-sm) var(--ease-out);
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--ink-deep); }
.chip input:focus-visible + span { outline: 1.5px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) { .chip:hover span { border-color: var(--on-dark-3); } }

.form__grid { display: grid; gap: var(--s-3); }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1px solid oklch(0.95 0.012 82 / 0.2);
  padding: 1.6rem 0 0.7rem; font-size: var(--fs-body);
  border-radius: 0; resize: vertical;
  transition: border-color var(--t-md) var(--ease-out);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field label {
  position: absolute; left: 0; top: 1.6rem; color: var(--on-dark-3);
  pointer-events: none; transform-origin: left top;
  transition: transform var(--t-md) var(--ease-out), color var(--t-md) var(--ease-out);
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.35rem) scale(0.72); color: var(--accent);
}
.field.is-invalid input, .field.is-invalid textarea { border-color: oklch(0.7 0.17 28); }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.form__status { font-size: var(--fs-sm); color: var(--on-dark-2); min-height: 1.5em; }

@media (min-width: 900px) {
  .contact { grid-template-columns: repeat(12, 1fr); }
  .contact__head { grid-column: 1 / 7; }
  .form { grid-column: 8 / -1; padding-top: var(--s-6); }
  .form__grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative; overflow: hidden;
  background: var(--ink-deep); color: var(--on-dark-1);
  padding: var(--s-5) var(--gutter) var(--s-3);
  border-top: 1px solid var(--line-dark);
}
.contours--dark { --contour: oklch(0.95 0.012 82); opacity: 0.9; }
.footer > *:not(.contours) { position: relative; z-index: 1; }
.footer__top { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
.footer__col { display: grid; gap: 0.75rem; align-content: start; font-size: var(--fs-sm); color: var(--on-dark-2); }
.footer__col .label { color: var(--on-dark-4); }
.footer__col a { transition: color var(--t-sm) var(--ease-out); }
@media (hover: hover) { .footer__col a:hover { color: var(--accent); } }
.footer__col ul { display: grid; gap: 0.35rem; }
.footer__top-link { align-self: start; justify-self: start; color: var(--on-dark-3); }
.footer__word {
  font-family: var(--f-display);
  font-size: 41vw; line-height: 0.8; letter-spacing: -0.055em;
  margin: var(--s-4) 0 var(--s-2) -0.035em;
  white-space: nowrap;
  color: var(--on-dark-1);
}
.footer__base { display: flex; justify-content: space-between; gap: 1rem; color: var(--on-dark-4); padding-top: var(--s-2); border-top: 1px solid var(--line-dark); }

@media (min-width: 900px) {
  .footer__top { grid-template-columns: repeat(12, 1fr); }
  .footer__col:nth-child(1) { grid-column: 1 / 4; }
  .footer__col:nth-child(2) { grid-column: 4 / 7; }
  .footer__col:nth-child(3) { grid-column: 7 / 10; }
  .footer__top-link { grid-column: 10 / -1; justify-self: end; }
}

/* ---------- Reduced motion: first-class, not an afterthought ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svc__panel { transition: none; }
}
