/*
 * site.css: the public site's home page (about.html, at privim.ro/). Colours, fonts and sizes come from styles/tokens.css (the "Public site"
 * block and the colours at the top), so a new look usually starts there. The language buttons use .segmented and
 * .control from controls.css, like the rest of the site.
 *
 * Shapes, one rule: buttons are pills; tiles and picture frames have --radius-tile; a picture inside a frame has
 * --radius-shot (the frame's corner minus the gap, so the two curves run parallel).
 * Phones: below 48rem every section is one column. CSS variables can't be used inside @media queries, so the
 * breakpoints are written out.
 */

*, *::before, *::after { box-sizing: border-box; }
/* An iPhone's Safari (iOS 26 on) paints the strips under the status bar / Dynamic Island and under its floating address
   bar in the page's background colour (it ignores theme-color): set it on html too, the same as the page's. */
html { scroll-padding-top: calc(var(--site-bar-height) + 1rem); background: var(--sheet); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body.site {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--sheet);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* :where() keeps these resets weaker than any class below, so a class's margin always wins. */
:where(.site) :where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(.site) :where(ul, ol) { padding: 0; list-style: none; }
.site img { display: block; max-width: 100%; height: auto; }
.site a { color: inherit; }
.site :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--radius-small); }
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: var(--site-gutter);
  top: -4rem;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--sheet) !important;
}
.skip-link:focus { top: var(--space-3); }

/* ------------------------------------------------------------------ The bar at the top (stays while scrolling) */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: var(--site-bar-height);
  padding: 0 var(--site-gutter);
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  border-bottom: 1px solid var(--line);
}
/* The frosted glass is a layer behind the bar, not the bar itself: Safari on an iPhone reads a sticky bar's own
   blurred background badly when it colours the status bar's strip, and draws a band of another colour. */
.site-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--sheet) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: var(--space-5); margin-left: auto; }
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color var(--duration) var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav .site-nav__contact {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--sheet);
}
.site-nav .site-nav__contact:hover { color: var(--sheet); background: var(--ink-hover); }

/* Sign in (clients and agencies): a small pill at the bar's end. */
.site-bar__signin { min-height: 2.25rem; padding: 0 var(--space-4); font-size: var(--text-sm); box-shadow: none; }

/* ------------------------------------------------------------------ Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
/* The same family as the app's buttons (controls.css): a soft tint, darker under the pointer, a little press. */
.button:hover { background: var(--fill-hover); }
.button:active { transform: scale(0.98); }
.button--flag { background: var(--accent); color: var(--accent-text) !important; }
.button--flag:hover { background: var(--accent-hover); }

/* ------------------------------------------------------------------ The first screen */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: var(--space-6);
  max-width: calc(var(--site-width) + 2 * var(--site-gutter));
  min-height: calc(100dvh - var(--site-bar-height));
  margin: 0 auto;
  padding: var(--space-6) var(--site-gutter);
}
/* A small pill with a tick: the one promise everything rests on. */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5) !important;
  padding: 0.35rem 0.9rem 0.35rem 0.45rem;
  border: 1px solid var(--flag-tint-line);
  border-radius: var(--radius-pill);
  background: var(--flag-tint);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--flag-text);
}
/* A tick in a pink circle (the badge, the story's check, "Sent"). */
.tick {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--label-accent-bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.hero__title {
  max-width: 13ch;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: var(--site-text-hero);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero__lead { max-width: 36ch; margin-top: var(--space-5) !important; font-size: var(--site-text-lead); color: var(--ink-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero__note { max-width: 40ch; margin-top: var(--space-4) !important; font-size: var(--text-sm); color: var(--ink-muted); }
.hero__scene { position: relative; height: min(68vh, 40rem); }
.hero__scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .hero__text > * { animation: rise 0.9s var(--site-ease) both; }
  .hero__text > :nth-child(2) { animation-delay: 0.06s; }
  .hero__text > :nth-child(3) { animation-delay: 0.12s; }
  .hero__text > :nth-child(4) { animation-delay: 0.18s; }
  .hero__text > :nth-child(5) { animation-delay: 0.24s; }
  .hero__scene { animation: appear 1.6s var(--site-ease) 0.2s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes appear { from { opacity: 0; transform: scale(0.97); } }

/* ------------------------------------------------------------------ Sections */

.section {
  max-width: calc(var(--site-width) + 2 * var(--site-gutter));
  margin: 0 auto;
  padding: var(--site-section) var(--site-gutter) 0;
}
.section__title {
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--site-text-h2);
  line-height: 1.06;
  letter-spacing: -0.028em;
}
.section__lead { max-width: 56ch; margin-top: var(--space-4) !important; font-size: var(--site-text-lead); color: var(--ink-muted); }

/* Fading in, the first time a [data-reveal] element scrolls into view (src/site.js adds .is-in). */
@media (prefers-reduced-motion: no-preference) {
  .can-reveal [data-reveal] { transition: opacity 0.9s var(--site-ease), transform 0.9s var(--site-ease); }
  .can-reveal [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(22px); }
}

/* ------------------------------------------------------------------ How it works: the steps and the picture beside them

   The picture (.story__stage) has four looks, one per step, set by src/site.js as data-step="1".."4":
   1 a page of the extract; 2 its corners drawn and checked; 3 the land laid on the ground in 3D, staked; 4 on a phone,
   sent. Every layer is always there; each step only moves or fades them, so going back is the same motion reversed. */

.story__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  margin-top: var(--space-6);
}
.story__steps { grid-column: 1; grid-row: 1; }
.story__step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
  padding: var(--space-5) 0;
  opacity: 0.32;
  transition: opacity 0.6s var(--site-ease);
}
.story__step:first-child { min-height: 50vh; justify-content: flex-start; padding-top: var(--space-6); }
.story__step.is-current { opacity: 1; }
.no-story .story__step { opacity: 1; min-height: 0; }
.story__number { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--flag-text); }
.story__step h3 { margin-top: var(--space-2) !important; font-family: var(--font-display); font-weight: 700; font-size: var(--site-text-big); line-height: 1.1; letter-spacing: -0.025em; }
.story__step p { max-width: 38ch; margin-top: var(--space-3) !important; font-size: var(--site-text-lead); color: var(--ink-muted); }

.story__stage {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--site-bar-height) + 6vh);
  align-self: start;
  aspect-ratio: 1;
  width: 100%;
  max-height: 76vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--sheet-raised);
  box-shadow: var(--shadow-card);
  perspective: 1100px;
  --stage-ease: cubic-bezier(0.65, 0, 0.25, 1);
  --stage-time: 0.9s;
}
.story__stage > * { position: absolute; transition: transform var(--stage-time) var(--stage-ease), opacity var(--stage-time) var(--stage-ease); }

/* The ground's contour lines: faint at first, a landscape from step 3. */
.stage__contours { inset: 0; width: 100%; height: 100%; opacity: 0; }
.stage__contours path { fill: none; stroke: var(--scene-line); stroke-width: 1.2; opacity: 0.55; }
[data-step="3"] .stage__contours, [data-step="4"] .stage__contours { opacity: 1; }

/* The extract: a page with a table of corners (made-up numbers). */
.stage__paper {
  inset: 12% 18%;
  padding: 7% 8%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sheet);
  box-shadow: var(--shadow-card);
  font-size: clamp(0.62rem, 1.1vw, 0.8rem);
}
.stage__paper-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3em; }
.stage__paper-sub { margin-bottom: 0.9em !important; color: var(--ink-muted); }
.stage__line { display: block; height: 0.5em; margin: 0.55em 0; border-radius: 1em; background: var(--line); }
.stage__line--short { width: 60%; }
.stage__table { width: 100%; margin: 1em 0; border-collapse: collapse; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stage__table th, .stage__table td { padding: 0.3em 0.2em; border-bottom: 1px solid var(--line); text-align: left; }
.stage__table th { color: var(--ink-muted); font-weight: 600; }
.stage__table tr { transition: background 0.5s; }
[data-step="2"] .stage__table tr + tr { background: var(--flag-tint); }
[data-step="2"] .stage__paper { transform: translate(-34%, 6%) scale(0.62) rotate(-4deg); opacity: 0.55; }
[data-step="3"] .stage__paper, [data-step="4"] .stage__paper { transform: translate(-90%, 10%) scale(0.5) rotate(-8deg); opacity: 0; }

/* The land: the outline drawn from the corners (2), laid on the ground and staked (3), shrunk into the phone (4). */
/* Square and centred, like the drawing inside it, so the pin (placed in % of it) stays on its corner when a short
   window makes the stage wider than tall. */
.stage__land { inset: 0; width: min(100%, 76vh); aspect-ratio: 1; margin: auto; transform-style: preserve-3d; opacity: 0; transform: scale(0.9); }
.stage__plot { width: 100%; height: 100%; overflow: visible; }
.stage__fill { fill: var(--scene-plot-fill); opacity: 0; transition: opacity 0.8s 0.3s; }
.stage__split { fill: none; stroke: var(--flag); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0; transition: opacity 0.6s 0.5s; }
.stage__outline { fill: none; stroke: var(--flag); stroke-width: 3.5; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s var(--stage-ease) 0.15s; }
.stage__corners circle { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.5; }
.stage__sides text { font-family: var(--font-mono); font-size: 13px; font-weight: 600; fill: var(--ink); opacity: 0; transition: opacity 0.5s 1.1s; }
/* The pin: its point (62% across, at the bottom) on the corner at 290,112 of the 400 square drawing, standing up
   off the tilted ground by undoing step 3's tilt (rotateZ then rotateX, the reverse of .stage__land's). */
.stage__pin {
  position: absolute; left: 72.5%; top: 28%; width: 10.7%; height: 13.25%; overflow: visible;
  opacity: 0; transform-origin: 62% 100%;
  transform: translate(-62%, -100%) rotateZ(18deg) rotateX(-52deg) scale(0.4);
  transition: opacity 0.3s, transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.stage__pin path { fill: var(--flag); fill-rule: evenodd; }
[data-step="2"] .stage__land { opacity: 1; transform: translateX(10%) scale(0.86); }
[data-step="3"] .stage__land { opacity: 1; transform: translateY(2%) rotateX(52deg) rotateZ(-18deg) scale(1.05); }
[data-step="4"] .stage__land { opacity: 0; transform: translate(0, 4%) rotateX(52deg) rotateZ(-18deg) scale(0.45); }
:is([data-step="2"], [data-step="3"]) .stage__outline { stroke-dashoffset: 0; }
:is([data-step="2"], [data-step="3"]) .stage__sides text { opacity: 1; }
[data-step="3"] .stage__fill, [data-step="3"] .stage__split { opacity: 1; }
[data-step="3"] .stage__sides text { opacity: 0; transition-delay: 0s; }
[data-step="3"] .stage__pin { opacity: 1; transform: translate(-62%, -100%) rotateZ(18deg) rotateX(-52deg) scale(1); transition-delay: 0.6s; }

/* The check: the area agrees with the corners. */
.stage__check {
  left: 50%;
  bottom: 9%;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 1rem 0.5rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--sheet);
  box-shadow: var(--shadow-card);
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 1rem);
}
[data-step="2"] .stage__check { opacity: 1; transform: translate(-50%, 0); transition-delay: 1.1s; }

/* The phone with the presentation, and the link going out. */
.stage__phone {
  left: 50%;
  top: 7%;
  width: 34%;
  padding: 2.2%;
  border-radius: var(--radius-phone);
  background: var(--ink);
  box-shadow: var(--shadow-sheet);
  opacity: 0;
  transform: translate(-50%, 30%) rotate(6deg);
}
.stage__phone img { border-radius: calc(var(--radius-phone) - 6px); }
[data-step="4"] .stage__phone { opacity: 1; transform: translate(-50%, 0) rotate(0); }
.stage__link {
  left: 50%;
  bottom: 7%;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.45rem 0.5rem 0.45rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--sheet);
  box-shadow: var(--shadow-card);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 1rem);
}
.stage__sent { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem 0.2rem 0.25rem; border-radius: var(--radius-pill); background: var(--flag-tint); font-family: var(--font-body); font-weight: 650; color: var(--flag-text); }
[data-step="4"] .stage__link { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .story__stage { --stage-time: 0.01s; }
  .story__stage *, .story__step { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}

/* ------------------------------------------------------------------ The demo */

/* The presentation: words on the left, the laptop and the phone on the right. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: var(--space-6);
  padding: clamp(1.25rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background:
    repeating-radial-gradient(circle at 100% 100%, transparent 0 34px, color-mix(in srgb, var(--flag) 7%, transparent) 34px 35px),
    var(--sheet-raised);
  box-shadow: var(--shadow-card);
}
.feature__for { font-size: var(--text-sm); font-weight: 600; color: var(--flag-text); }
.feature h3, .doc h3 { margin-top: var(--space-2) !important; font-family: var(--font-display); font-weight: 700; font-size: var(--site-text-big); line-height: 1.1; letter-spacing: -0.025em; }
.feature__text > p:not(.feature__for), .doc > p:not(.feature__for) { margin-top: var(--space-3) !important; color: var(--ink-muted); }
.feature__text .button { margin-top: var(--space-5); }
/* The presentation's chapters, numbered like its own chapter card, across the card's width. */
.chapters { grid-column: 1 / -1; padding-top: var(--space-5); border-top: 1px solid var(--line); }
.chapters__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.chapters__note { margin-top: var(--space-1) !important; color: var(--ink-muted); }
.chapters__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: var(--space-2); margin-top: var(--space-4) !important; }
.chapters__list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem 0.4rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--sheet);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.35s var(--site-ease), border-color 0.35s, background 0.35s;
}
.chapters__list a:hover { transform: translateY(-2px); border-color: var(--flag-tint-line); background: var(--flag-tint); }
.chapters__n {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--label-accent-bg);
  color: var(--label-accent-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
}
/* The chips come in one after another when the card first shows. */
@media (prefers-reduced-motion: no-preference) {
  .can-reveal .feature:not(.is-in) .chapters__list li { opacity: 0; transform: translateY(8px); }
  .chapters__list li { transition: opacity 0.6s var(--site-ease), transform 0.6s var(--site-ease); transition-delay: calc(var(--i, 0) * 40ms + 0.3s); }
}
.feature__shots { position: relative; display: block; padding-bottom: 8%; }
.feature__desktop { display: block; }
.feature__phone { position: absolute; right: -2%; bottom: 0; width: 26%; border-radius: var(--radius-phone); }
.feature__phone img { border-radius: calc(var(--radius-phone) - var(--inset-tile)); }

/* A picture's frame (the laptop's screen, the phone, a document's first page). */
.shot__frame {
  padding: var(--inset-tile);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--sheet);
  box-shadow: var(--shadow-card);
  transition: transform 0.5s var(--site-ease);
}
.shot__frame img { border-radius: var(--radius-shot); }

/* The site report and the study: a page of each, its words and two ways to open it. */
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-5); }
.doc {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--sheet-raised);
  box-shadow: var(--shadow-card);
}
.doc__page {
  display: block;
  height: clamp(14rem, 26vw, 20rem);
  margin: calc(-1 * clamp(1.25rem, 3vw, 2.25rem)) calc(-1 * clamp(1.25rem, 3vw, 2.25rem)) var(--space-5);
  padding: var(--space-5) var(--space-6) 0;
  overflow: hidden;
  border-radius: var(--radius-tile) var(--radius-tile) 0 0;
  background: var(--sheet-sunk);
}
.doc__page img {
  width: 100%;
  border-radius: var(--radius-small) var(--radius-small) 0 0;
  box-shadow: var(--shadow-sheet);
  transition: transform 0.7s var(--site-ease);
}
.doc:hover .doc__page img { transform: translateY(-3%); }
.doc__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: auto; padding-top: var(--space-5); }
.doc__pdf { font-weight: 650; text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.doc__pdf:hover { text-decoration-color: currentColor; background-color: var(--hover); box-shadow: 0 0 0 0.25em var(--hover); }

/* Leaning towards the pointer (data-tilt, src/site.js sets --tilt-x / --tilt-y): a computer only, never with "reduce motion". */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  [data-tilt].is-in { transform: perspective(1400px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)); transition: transform 0.6s var(--site-ease), opacity 0.9s var(--site-ease); }
  [data-tilt].is-tilting { transition: transform 0.12s linear; }
  .feature:hover .feature__phone { transform: translateY(-6px); }
}

/* Three promises in a row. */
.promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-6) !important; }
.promises li { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 2px solid var(--ink); }
.promises b { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.promises span { color: var(--ink-muted); }
.demo__note { margin-top: var(--space-5) !important; font-size: var(--text-sm); color: var(--ink-muted); }

/* ------------------------------------------------------------------ Who it is for: tiles of two sizes */

.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.tile {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-2);
  min-height: 15rem;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  background: var(--sheet-raised);
  transition: transform 0.4s var(--site-ease);
}
.tile:hover { transform: translateY(-3px); }
.tile--wide { grid-column: span 4; min-height: 19rem; }
.tile:nth-child(2) { min-height: 19rem; }
.tile h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title); letter-spacing: -0.02em; line-height: 1.15; }
.tile p { max-width: 42ch; color: var(--ink-muted); }
/* Contour lines, like a topographic map, rising from one corner. */
.tile--contours {
  background:
    repeating-radial-gradient(circle at 88% 8%, transparent 0 22px, color-mix(in srgb, var(--flag) 28%, transparent) 22px 23.5px),
    var(--sheet-raised);
}
.tile--ink { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.tile--ink p { color: color-mix(in srgb, var(--sheet) 74%, transparent); }
.tile--flag { background: var(--flag-tint); border-color: var(--flag-tint-line); }
.tile--flag h3 { color: var(--flag-text); }
.tile__link { align-self: flex-start; margin-top: var(--space-2); font-weight: 650; color: inherit; text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.tile__link:hover { text-decoration-color: currentColor; background-color: var(--hover); box-shadow: 0 0 0 0.25em var(--hover); }
.tile--ink .tile__link { text-decoration-color: color-mix(in srgb, var(--sheet) 40%, transparent); }
.tile--ink .tile__link:hover { background-color: rgb(255 255 255 / 0.12); box-shadow: 0 0 0 0.25em rgb(255 255 255 / 0.12); }

/* ------------------------------------------------------------------ About us: a statement, two paragraphs, four values */

.about__statement {
  max-width: 20ch;
  margin-top: var(--space-5) !important;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--site-text-big);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.about__text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); max-width: 62rem; margin-top: var(--space-6); color: var(--ink-muted); font-size: var(--text-md); }
.values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-6) !important; }
.values > div { padding-top: var(--space-4); border-top: 2px solid var(--flag); }
.values dt { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.values dd { margin-top: var(--space-2); color: var(--ink-muted); }

/* ------------------------------------------------------------------ Contact: one dark card */

.contact__card {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  border-radius: var(--radius-tile);
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 30px, color-mix(in srgb, var(--flag) 26%, transparent) 30px 31.5px),
    var(--ink);
  color: var(--sheet);
}
.contact__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: var(--site-text-hero);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.contact__lead { max-width: 48ch; margin-top: var(--space-4) !important; font-size: var(--site-text-lead); color: color-mix(in srgb, var(--sheet) 76%, transparent); }
.contact__ways { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--space-5) clamp(2rem, 8vw, 7rem); margin: var(--space-6) 0 !important; }
.contact__ways dt { font-size: var(--text-sm); font-weight: 600; color: color-mix(in srgb, var(--sheet) 66%, transparent); }
.contact__link {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--site-text-big);
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--flag);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
.contact__link:hover { color: var(--flag-tint); }

/* ------------------------------------------------------------------ Footer */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  max-width: calc(var(--site-width) + 2 * var(--site-gutter));
  margin: var(--site-section) auto 0;
  padding: var(--space-6) var(--site-gutter) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.site-foot__brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 650; color: var(--ink); }
.site-foot__note { flex-basis: 100%; }

/* ------------------------------------------------------------------ Narrower screens */

@media (max-width: 64rem) {
  .site-nav a:not(.site-nav__contact, [href="#demo"]) { display: none; }
  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: 1fr; }
}

@media (max-width: 48rem) {
  .site-bar { gap: var(--space-2); }
  .site-nav { display: none; }
  .site-bar__signin { margin-left: auto; min-height: 2rem; padding: 0 var(--space-3); }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 0; padding-top: var(--space-6); }
  .hero__scene { height: 62vw; min-height: 15rem; margin: var(--space-5) calc(-1 * var(--site-gutter)) 0; }

  /* How it works on a phone: the picture sticks under the bar and each step's words stick just under the picture;
     the next step slides up into their place and the words before fade out (src/site.js picks the current one), so
     no text ever runs under the picture. A block, not a grid: a sticky grid item only sticks inside its own row.
     The picture's bottom margin lets it leave with the last step, before that step's words would reach it. */
  .story { --story-top: calc(var(--site-bar-height) + env(safe-area-inset-top, 0px) + var(--space-3)); --story-size: min(100vw - 2 * var(--site-gutter), 42vh); }
  /* Room under the title for the band in the page's colour above the picture. */
  .story__body { display: block; margin-top: calc(var(--space-6) + var(--space-5)); }
  /* The ring in the page's colour hides what scrolls between the bar and the picture. */
  .story__stage { top: var(--story-top); z-index: 2; width: var(--story-size); max-height: none; margin: 0 auto 35vh; box-shadow: 0 0 0 var(--space-3) var(--sheet), 0 calc(-1 * var(--space-6)) 0 var(--space-3) var(--sheet), var(--shadow-card); }
  .story__step, .story__step:first-child {
    position: sticky; top: calc(var(--story-top) + var(--story-size) + var(--space-6));
    min-height: 0; justify-content: flex-start; padding: 0;
    scroll-margin-top: calc(var(--story-top) + var(--story-size) + var(--space-6));
  }
  /* The room to scroll between steps goes above each (a margin below would release the one before too early). */
  .story__step + .story__step { margin-top: 45vh; }
  /* Step 1 comes up soon after the picture: its negative margin merges with the picture's (still 35vh for leaving). */
  .story__step:first-child { margin-top: -25vh; }
  .story__step:not(.is-current) { opacity: 0; transition-duration: 0.3s; }
  .no-story .story__stage { display: none; }

  .docs, .promises, .bento { grid-template-columns: 1fr; }
  .chapters__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapters__list a { gap: var(--space-2); min-height: 2.75rem; padding-right: 0.6rem; font-size: var(--text-sm); line-height: 1.2; }
  .chapters__n { width: 1.6rem; height: 1.6rem; }
  .tile, .tile--wide { grid-column: auto; min-height: 0 !important; padding: var(--space-5); }
  .tile--wide { min-height: 13rem !important; }
  .about__text, .values { grid-template-columns: 1fr; }
  .contact__ways { grid-template-columns: 1fr; }
}
