/* Felis Labs — «Бумага и графит», tokens from the FelisHub theme */

:root {
  color-scheme: light;

  --canvas: #f4f2ef;
  --sheet: #fefdfc;
  --sunken: #f8f7f4;
  --hover: #f6f4f1;
  --selected: #eeede9;
  --selected-hover: #e4e2dd;

  --border-subtle: #e6e5e2;
  --border: #d8d7d3;
  --border-control: #8a8884;

  --text: #1f1e1b;
  --text-2: #5d5b56;

  --ink: #1f1e1b;
  --ink-hover: #373532;
  --on-ink: #fefdfc;

  --success: #3b9555;
  --success-text: #246e3a;
  --success-soft: #e8f9eb;

  /* Light page, graphite card */
  --card-bg: #1f1e1b;
  --card-text: #fefdfc;
  --card-text-2: rgb(254 253 252 / 62%);
  --card-line: rgb(254 253 252 / 14%);
  --card-border: rgb(255 255 255 / 7%);
  --card-print: rgb(254 253 252 / 10%);
  --card-shadow: rgb(31 30 27 / 24%);
  --card-shadow-near: rgb(31 30 27 / 14%);
  --card-glare: 1;
  --foil-base: #e4e2dd;
  --foil-mid: #8a8884;
  --foil-shine: #ffffff;
  --field-bg: #282725;
  --field-border: rgb(255 255 255 / 16%);
  --field-focus: rgb(255 255 255 / 55%);
  --field-ghost: rgb(254 253 252 / 42%);
  --send-bg: #fefdfc;
  --send-fg: #1f1e1b;
  --send-off-bg: rgb(255 255 255 / 10%);
  --send-off-fg: rgb(254 253 252 / 40%);
  --art: rgb(254 253 252 / 15%);

  --signature: #efede9;
  /* Shade behind the hero text: wide soft layers of falling strength, no hard rim. */
  --hero-shade-title: 0 0 10px rgb(248 247 244 / 56%), 0 0 30px rgb(248 247 244 / 46%), 0 0 64px rgb(248 247 244 / 36%);
  --hero-shade-text: 0 0 6px rgb(248 247 244 / 64%), 0 0 18px rgb(248 247 244 / 48%), 0 0 40px rgb(248 247 244 / 30%);
  --spotlight: rgb(31 30 27 / 4.5%);
  --stack-shadow: rgb(31 30 27 / 5%);
  --attention: #ca7016;
  --attention-text: #935209;
  --header-shadow: rgb(31 30 27 / 8%);

  --selection: rgb(31 30 27 / 14%);
  --glass: rgb(254 253 252 / 88%);
  --glass-border: rgb(31 30 27 / 8%);

  --shadow-sheet: 0 1px 2px rgb(31 30 27 / 4%);
  --shadow-toast: 0 8px 24px rgb(31 30 27 / 16%);

  --dur-instant: 100ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Golos Text", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "Golos Text", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page-inset: 8px;
  --page-radius: 18px;
  --gutter: 24px;

}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #11100f;
  --sheet: #1a1917;
  --sunken: #151412;
  --hover: #21201e;
  --selected: #2b2a27;
  --selected-hover: #363532;

  --border-subtle: #282725;
  --border: #363532;
  --border-control: #6a6966;

  --text: #ecebe8;
  --text-2: #b4b2af;

  --ink: #ecebe8;
  --ink-hover: #d2d1ce;
  --on-ink: #171614;

  --success: #5cb572;
  --success-text: #85cf95;
  --success-soft: #17291b;

  /* Dark page, paper card */
  --card-bg: #f1efeb;
  --card-text: #1f1e1b;
  --card-text-2: #5d5b56;
  --card-line: #d8d7d3;
  --card-border: rgb(31 30 27 / 8%);
  --card-print: rgb(31 30 27 / 8%);
  --card-shadow: rgb(0 0 0 / 55%);
  --card-shadow-near: rgb(0 0 0 / 35%);
  --card-glare: 0;
  --foil-base: #1f1e1b;
  --foil-mid: #8a8884;
  --foil-shine: #e4e2dd;
  --field-bg: #fefdfc;
  --field-border: #d8d7d3;
  --field-focus: #1f1e1b;
  --field-ghost: #8a8884;
  --send-bg: #1f1e1b;
  --send-fg: #fefdfc;
  --send-off-bg: #e4e2dd;
  --send-off-fg: #a6a4a1;
  --art: rgb(31 30 27 / 13%);

  --signature: #22211f;
  --hero-shade-title: 0 0 10px rgb(17 16 15 / 44%), 0 0 30px rgb(17 16 15 / 38%), 0 0 64px rgb(17 16 15 / 30%);
  --hero-shade-text: 0 0 6px rgb(17 16 15 / 52%), 0 0 18px rgb(17 16 15 / 40%), 0 0 40px rgb(17 16 15 / 26%);
  --spotlight: rgb(255 255 255 / 4.5%);
  --stack-shadow: rgb(0 0 0 / 35%);
  --attention: #f2af48;
  --attention-text: #f0be67;
  --header-shadow: rgb(0 0 0 / 40%);

  --selection: rgb(236 235 232 / 22%);
  --glass: rgb(26 25 23 / 88%);
  --glass-border: rgb(255 255 255 / 8%);

  --shadow-sheet: 0 0 0 transparent;
  --shadow-toast: 0 8px 24px rgb(0 0 0 / 40%);
}

/* Base */

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

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--selection);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

address {
  font-style: normal;
}

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

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

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

.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-icon-part] {
  transform-box: fill-box;
  transform-origin: center;
}

/* Concentric radii: Rinner = max(0, Router − inset) */

[data-radius-frame] {
  --concentric-inner-radius: max(0px, calc(var(--concentric-outer-radius) - var(--concentric-inset, 0px)));
  border-radius: var(--concentric-outer-radius);
}

[data-radius-inner] {
  border-radius: var(--concentric-inner-radius);
}

/* Page: one sheet on the canvas, like the FelisHub window */

.page {
  position: relative;
  min-height: calc(100vh - var(--page-inset) * 2);
  margin: var(--page-inset);
  background: var(--sheet);
  border: 1px solid var(--border-subtle);
  border-radius: var(--page-radius);
  box-shadow: var(--shadow-sheet);
  /* Both axes, so the hero picture is cut to the rounded corners too; clip keeps the sticky header working. */
  overflow: clip;
}

.page__sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Once the page scrolls, the header floats: a glass panel around the content grid. Nothing inside moves, only the
   panel appears. It sits 6px into the 68px row and 10px past the grid, so the centred 36px Write to us capsule has
   10px of glass on every side: concentric, R18 + 10 = R28, a capsule. */
.site-header__inner {
  position: relative;
}

.site-header__inner::before {
  content: '';
  position: absolute;
  inset: 6px -10px;
  z-index: -1;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: 0 8px 28px var(--header-shadow);
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  pointer-events: none;
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.site-header[data-stuck] .site-header__inner::before {
  opacity: 1;
  transform: none;
}

/* On the glass the link capsule needs no frame of its own: its border and fill fade out, the 1px stays so the links
   keep their R16 at inset 4. */
.site-header[data-stuck] .site-nav {
  border-color: transparent;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  margin-left: -2px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* The header logo's own box reaches 6px in from the grid, so on the glass the mark keeps 16px from the panel's edge
   (12px on a phone), close to the air above and below it. It is always there, so nothing moves when the panel appears. */
.site-header .brand {
  margin-left: 0;
  padding-left: 6px;
}

.brand__mark {
  width: 31px;
  height: 18px;
  overflow: visible;
  fill: currentColor;
}

/* Centered pill navigation: capsule 40 → links 32 at inset 4 (border 1 + padding 3), R20 − 4 = R16 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sheet) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    border-color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color var(--dur-fast),
    background-color var(--dur-fast);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--hover);
}

.site-header__end {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--dur-fast),
    transform var(--dur-instant) var(--ease-out);
}

.icon-button:hover {
  color: var(--text);
}

.icon-button:active {
  transform: scale(0.97);
}

.theme-toggle {
  margin-right: 0;
}

.theme-toggle .icon {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
}

:root[data-theme="dark"] .theme-toggle__moon,
:root:not([data-theme="dark"]) .theme-toggle__sun {
  display: none;
}

/* Hero: centred like a poster, a desert of mono text behind it */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(40px, 6vw, 76px) 0 clamp(48px, 6vw, 80px);
}

.hero + .ticker + .section {
  padding-top: clamp(64px, 8vw, 104px);
}

.hero__backdrop {
  position: absolute;
  z-index: -1;
  top: -68px;
  left: 0;
  width: 100%;
  height: calc(min(100%, 940px) + 68px);
  pointer-events: none;
  /* No spot behind the headline: the picture runs the full width, quieter behind the text, and eases out
     into the page over its lower half; the text carries its own soft shadow. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 30%) 0,
    #000 14%,
    rgb(0 0 0 / 74%) 28%,
    rgb(0 0 0 / 74%) 52%,
    rgb(0 0 0 / 66%) 60%,
    rgb(0 0 0 / 52%) 68%,
    rgb(0 0 0 / 37%) 76%,
    rgb(0 0 0 / 22%) 84%,
    rgb(0 0 0 / 10%) 91%,
    rgb(0 0 0 / 3%) 96%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 30%) 0,
    #000 14%,
    rgb(0 0 0 / 74%) 28%,
    rgb(0 0 0 / 74%) 52%,
    rgb(0 0 0 / 66%) 60%,
    rgb(0 0 0 / 52%) 68%,
    rgb(0 0 0 / 37%) 76%,
    rgb(0 0 0 / 22%) 84%,
    rgb(0 0 0 / 10%) 91%,
    rgb(0 0 0 / 3%) 96%,
    transparent 100%
  );
}

.hero__tint,
.hero__ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Badge: capsule 32 → tag 24 at inset 4 (border 1 + padding 3), R16 − 4 = R12 */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 11px 0 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sheet) 86%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  transition: border-color var(--dur-fast);
}

.badge-pill:hover {
  border-color: var(--border-control);
}

.badge-pill .icon {
  color: var(--text-2);
}

.badge-pill__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-text);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.status__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.status__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  opacity: 0;
}

.hero__title {
  max-width: 1000px;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(42px, 6.2vw, 84px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

.hero__title-soft {
  display: block;
  color: var(--text-2);
}

/* The text keeps itself readable over the picture with a soft shade that follows the letters. */
.hero__title {
  text-shadow: var(--hero-shade-title);
}

.hero__lead,
.hero__note {
  text-shadow: var(--hero-shade-text);
}

/* Over a picture the lead needs more contrast than the usual grey. */
.hero__lead {
  color: color-mix(in srgb, var(--text) 86%, transparent);
}

.hero__lead {
  max-width: 600px;
  margin-top: 24px;
  color: var(--text-2);
  font-size: 18px;
  line-height: 28px;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hero__note {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
}

/* Buttons: graphite capsules */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
  transition:
    background-color var(--dur-fast),
    transform var(--dur-instant) var(--ease-out),
    translate 420ms var(--ease-spring);
}

.button:has(.icon:last-child) {
  padding-right: 17px;
}

.button:active {
  transform: scale(0.97);
}

.button--primary {
  background: var(--ink);
  color: var(--on-ink);
}

.button--primary:hover {
  background: var(--ink-hover);
}

/* A sheen of light sweeps across the graphite button once per hover */
.button--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 32%, rgb(255 255 255 / 22%) 50%, transparent 68%);
  transform: translateX(-110%);
  pointer-events: none;
}

/* Mouse only: a tap would leave the sweep and the hover stuck */
@media (hover: hover) and (pointer: fine) {
  .button--primary:hover::before {
    transform: translateX(110%);
    transition: transform 600ms var(--ease-out);
  }
}

:root[data-theme="dark"] .button--primary::before {
  background: linear-gradient(105deg, transparent 32%, rgb(23 22 20 / 12%) 50%, transparent 68%);
}

.button--small {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.button--outline {
  background: var(--sheet);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.button--outline:hover {
  background: var(--hover);
}

.button--secondary {
  background: var(--selected);
  color: var(--text);
}

.button--secondary:hover {
  background: var(--selected-hover);
}

/* Business card: graphite with a foil mark and an iridescent rim, tilts in 3D and turns over */

.card-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  gap: 28px;
  margin-top: clamp(48px, 7vw, 88px);
}

.card-space {
  position: relative;
  width: min(100%, 460px);
  container-type: inline-size;
}

.card-drop {
  position: relative;
}

.card {
  --tilt-x: 0;
  --tilt-y: 0;
  --mx: 50;
  --my: 50;
  --hover: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 1.75;
  cursor: pointer;
  transform-style: preserve-3d;
  transform:
    perspective(1100px)
    rotateX(calc(var(--tilt-x) * 1deg))
    rotateY(calc(var(--tilt-y) * 1deg))
    scale(calc(1 + var(--hover) * 0.02));
  -webkit-tap-highlight-color: transparent;
}

.card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* Starts at once and lands softly, like a card flicked over */
  transition: transform 600ms var(--ease-out);
}

.card[data-flipped] .card__inner {
  transform: rotateY(180deg);
}

.card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--card-bg);
  color: var(--card-text);
  box-shadow:
    inset 0 0 0 1px var(--card-border),
    calc(var(--tilt-y) * -1.2px) calc(18px + var(--tilt-x) * 1.2px) 44px var(--card-shadow),
    0 1px 3px var(--card-shadow-near);
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.card__face--back {
  transform: rotateY(180deg);
}

/* Security microprint in the site's mono text: it surfaces where the light falls, like a hologram on a document */
.card__print {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 9px 11px;
  overflow: hidden;
  color: var(--card-print);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-all;
  user-select: none;
  -webkit-mask-image: radial-gradient(
    circle at calc(var(--mx) * 1%) calc(var(--my) * 1%),
    #000 0%,
    rgb(0 0 0 / 45%) 30%,
    rgb(0 0 0 / 14%) 62%,
    rgb(0 0 0 / 6%) 100%
  );
  mask-image: radial-gradient(
    circle at calc(var(--mx) * 1%) calc(var(--my) * 1%),
    #000 0%,
    rgb(0 0 0 / 45%) 30%,
    rgb(0 0 0 / 14%) 62%,
    rgb(0 0 0 / 6%) 100%
  );
}

.card__face--back .card__print {
  -webkit-mask-image: radial-gradient(
    circle at calc(100% - var(--mx) * 1%) calc(var(--my) * 1%),
    #000 0%,
    rgb(0 0 0 / 45%) 30%,
    rgb(0 0 0 / 14%) 62%,
    rgb(0 0 0 / 6%) 100%
  );
  mask-image: radial-gradient(
    circle at calc(100% - var(--mx) * 1%) calc(var(--my) * 1%),
    #000 0%,
    rgb(0 0 0 / 45%) 30%,
    rgb(0 0 0 / 14%) 62%,
    rgb(0 0 0 / 6%) 100%
  );
}

/* Dark card only: a soft light that follows the pointer */
.card__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    farthest-corner circle at calc(var(--mx) * 1%) calc(var(--my) * 1%),
    rgb(255 255 255 / 10%) 0%,
    rgb(255 255 255 / 3%) 30%,
    rgb(255 255 255 / 0%) 60%
  );
  opacity: calc(var(--card-glare) * (0.5 + var(--hover) * 0.5));
}

.card__face--back .card__glare {
  background: radial-gradient(
    farthest-corner circle at calc(100% - var(--mx) * 1%) calc(var(--my) * 1%),
    rgb(255 255 255 / 10%) 0%,
    rgb(255 255 255 / 3%) 30%,
    rgb(255 255 255 / 0%) 60%
  );
}

.card__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(20px, 6cqi, 28px);
  text-align: left;
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* The mark is metal foil: a sheen runs across it as the card turns */
.card__mark {
  display: block;
  width: clamp(58px, 16.5cqi, 76px);
  aspect-ratio: 246 / 142.5;
  background-image: linear-gradient(
    105deg,
    var(--foil-base) 0%,
    var(--foil-base) 34%,
    var(--foil-mid) 44%,
    var(--foil-shine) 50%,
    var(--foil-mid) 56%,
    var(--foil-base) 66%,
    var(--foil-base) 100%
  );
  background-size: 320% 100%;
  background-position: calc(var(--mx) * 1%) 50%;
  -webkit-mask: url("mark.svg") center / contain no-repeat;
  mask: url("mark.svg") center / contain no-repeat;
}

.card__place,
.card__row,
.card__label {
  color: var(--card-text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.card__bottom {
  margin-top: auto;
}

.card__name {
  font-family: var(--font-display);
  font-size: clamp(24px, 7cqi, 32px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card__legal {
  margin-top: 4px;
  color: var(--card-text-2);
  font-size: 14px;
  line-height: 20px;
}

.card__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--card-line);
}

.card__face--back .card__row {
  margin-top: auto;
}

.card__address {
  margin-top: 10px;
  font-size: clamp(15px, 4.2cqi, 18px);
  line-height: 1.45;
  font-weight: 500;
}

.flip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--selected);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-fast),
    transform var(--dur-instant) var(--ease-out);
}

.flip-button:hover {
  background: var(--selected-hover);
}

.flip-button:active {
  transform: scale(0.97);
}

/* Ticker of what we do */

.ticker {
  overflow: hidden;
  padding: 16px 0;
  border-block: 1px solid var(--border-subtle);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ticker__track {
  display: flex;
  width: max-content;
}

.ticker__group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}

.ticker span {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ticker__star {
  flex: none;
  width: 9px;
  height: 9px;
  fill: var(--text-2);
}

/* Sections */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section--sunken {
  background: var(--sunken);
  border-block: 1px solid var(--border-subtle);
}

.section__head {
  max-width: 640px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section__lead {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 26px;
  text-wrap: pretty;
}

/* What we do: a bento of cards, each with a small living picture in mono text */

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
  padding: 0;
  list-style: none;
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: var(--sheet);
  isolation: isolate;
  transition:
    border-color var(--dur-base) var(--ease-out),
    translate 200ms var(--ease-out);
}

.service--wide {
  grid-column: span 2;
}

/* Mouse only: after a tap the card would stay lifted and lit. The lift is movement, so it also waits for motion. */
@media (hover: hover) and (pointer: fine) {
  .service:hover {
    border-color: var(--border);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .service:hover {
    translate: 0 -3px;
  }
}

/* Spotlight: a soft light under the pointer */
.service::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--sx, 50%) var(--sy, 50%),
    var(--spotlight),
    transparent 72%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .service:hover::after {
    opacity: 1;
  }
}

/* Vitrine: card R20, inset 8 → R12 */
.service__visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 216px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--sunken);
}

.service__copy {
  padding: 20px 16px 16px;
}

.service__title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 26px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

/* A quiet line icon ahead of the title, on its first line; it stays still, the card is not a control. */
.service__icon {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--text-2);
}

.service__text {
  max-width: 460px;
  margin-top: 8px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 22px;
  text-wrap: pretty;
}

/* ASCII scenes fill their vitrine */
.vitrine__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* How we work: split cards that stack as you scroll; card R24, vitrine inset 12 → R12 */

.principles {
  display: grid;
  gap: 20px;
  margin-top: 56px;
  padding: 0;
  list-style: none;
}

.principle {
  position: sticky;
  top: calc(96px + var(--i, 0) * 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 320px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  background: var(--sheet);
  box-shadow: 0 -10px 30px var(--stack-shadow);
}

.principle__copy {
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vw, 32px);
}

.principle__number {
  position: relative;
  color: transparent;
  font-family: var(--font-mono);
  font-size: clamp(64px, 7.5vw, 104px);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 1px var(--border-control);
}

/* Once the number is drawn in characters, its outline steps aside and stays only for selection and fallback. */
.principle__number[data-drawn] {
  -webkit-text-stroke-color: transparent;
}

.principle__digits {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  letter-spacing: 0;
  pointer-events: none;
}

.principle__title {
  margin-top: auto;
  padding-top: 32px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.principle__text {
  max-width: 460px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 24px;
  text-wrap: pretty;
}

.principle__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--sunken);
}

/* Company: who we are, with the registry details */

.company {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
}

.ledger {
  position: relative;
}

.ledger::before,
.ledger__row::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  transform-origin: left;
}

.ledger::before {
  top: 0;
  background: var(--border);
}

.ledger__row {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 8px 16px;
  padding: 16px 0;
}

.ledger__row::after {
  bottom: 0;
  background: var(--border-subtle);
}

.ledger__row:nth-child(1) { --row: 1; }
.ledger__row:nth-child(2) { --row: 2; }
.ledger__row:nth-child(3) { --row: 3; }
.ledger__row:nth-child(4) { --row: 4; }

.ledger dt {
  color: var(--text-2);
  font-size: 13px;
  line-height: 22px;
  font-weight: 500;
}

.ledger dd {
  font-size: 15px;
  line-height: 22px;
}

.ledger__number {
  font-variant-numeric: tabular-nums;
}

.ledger__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ledger__link .icon {
  color: var(--text-2);
  transition: color var(--dur-fast);
}

.ledger__link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.ledger__link:hover .icon {
  color: var(--text);
}

/* Contact: a panel inverted to the page, the mark drawn in mono text, a one-line brief */

.section--contact {
  padding-top: 0;
}

.contact {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 480px;
  padding: clamp(32px, 6vw, 80px);
  overflow: hidden;
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px var(--card-border);
  color: var(--card-text);
  isolation: isolate;
}

.contact__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.contact__body {
  max-width: 560px;
}

.contact__eyebrow {
  color: var(--card-text-2);
}

.contact__title {
  color: var(--card-text);
}

.contact__lead {
  max-width: 460px;
  margin-top: 14px;
  color: var(--card-text-2);
  font-size: 17px;
  line-height: 26px;
  text-wrap: pretty;
}

/* Brief: capsule 56 → send 40 at inset 8 (border 1 + padding 7), R28 − 8 = R20 */
.brief {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 540px;
  height: 56px;
  margin-top: 32px;
  padding: 0 7px 0 22px;
  border: 1px solid var(--field-border);
  border-radius: 28px;
  background: var(--field-bg);
  transition: border-color var(--dur-fast);
}

.brief:focus-within {
  border-color: var(--field-focus);
}

.brief__field {
  position: relative;
  display: grid;
  flex: 1;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.brief__input,
.brief__ghost {
  grid-area: 1 / 1;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.brief__input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--card-text);
}

.brief__ghost {
  overflow: hidden;
  color: var(--field-ghost);
  white-space: nowrap;
  pointer-events: none;
}

.brief__ghost::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: currentColor;
}

.brief[data-filled] .brief__ghost {
  visibility: hidden;
}

.brief__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--send-bg);
  color: var(--send-fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-fast),
    color var(--dur-fast),
    transform var(--dur-instant) var(--ease-out);
}

.brief__send[aria-disabled="true"] {
  background: var(--send-off-bg);
  color: var(--send-off-fg);
  cursor: default;
}

.brief__send:not([aria-disabled="true"]):active {
  transform: scale(0.97);
}

.contact__alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 18px;
  color: var(--card-text-2);
  font-size: 14px;
  line-height: 20px;
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.contact__alt a {
  color: var(--card-text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.contact__alt a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.contact__copy {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--card-text-2);
  cursor: pointer;
  transition:
    color var(--dur-fast),
    transform var(--dur-instant) var(--ease-out);
}

.contact__copy:hover {
  color: var(--card-text);
}

.contact__copy:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: no-preference) {
  .brief__ghost::after {
    animation: caret 1.1s steps(1) infinite;
  }

  [data-offscreen] .brief__ghost::after {
    animation-play-state: paused;
  }
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

/* Footer */

.site-footer {
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
}

.brand--small {
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
}

.brand--small .brand__mark {
  width: 26px;
  height: 15px;
}

.site-footer__legal {
  flex: 1;
  min-width: 240px;
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color var(--dur-fast);
}

.to-top:hover {
  color: var(--text);
}

/* The signature: the name as a window onto the hero picture, fading toward the bottom edge */
.signature {
  position: relative;
  height: clamp(72px, 13vw, 190px);
  margin-top: clamp(24px, 4vw, 48px);
  overflow: hidden;
  user-select: none;
}

.signature__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Cursor trail */

.trail {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Click spark */

.spark {
  color: var(--text);
  position: fixed;
  z-index: 50;
  width: 80px;
  height: 80px;
  overflow: visible;
  pointer-events: none;
  stroke-linecap: round;
  stroke-width: 2;
}

.ticker[data-js] .ticker__track {
  animation: none;
}

/* Toast: graphite capsule */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: var(--shadow-toast);
  color: var(--on-ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  translate: -50% 16px;
  transition:
    opacity 180ms var(--ease-out),
    translate 180ms var(--ease-out);
}

.toast[data-open] {
  opacity: 1;
  translate: -50% 0;
  transition-duration: var(--dur-base);
}

/* Theme switch: the new theme spreads from the toggle */

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .enter {
    animation: enter 700ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms + 60ms);
  }

  .hero__title .word {
    display: inline-block;
    animation: word-in 1000ms var(--ease-out) both;
    animation-delay: calc(var(--w) * 75ms + 140ms);
  }

  .js [data-words] .word {
    display: inline-block;
    transition:
      opacity 900ms var(--ease-out),
      transform 900ms var(--ease-out),
      filter 900ms var(--ease-out);
    transition-delay: calc(var(--w, 0) * 60ms);
  }

  .js [data-words][data-pending] .word {
    opacity: 0;
    transform: translateY(0.4em);
    filter: blur(10px);
  }

  [data-reveal] {
    transition:
      opacity 700ms var(--ease-out),
      transform 700ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }

  [data-reveal][data-pending] {
    opacity: 0;
    transform: translateY(16px);
  }

  /* A service card also lifts on hover: its own transitions go along with the reveal's, or the lift would snap. */
  .service[data-reveal] {
    transition:
      opacity 700ms var(--ease-out) calc(var(--i, 0) * 80ms),
      transform 700ms var(--ease-out) calc(var(--i, 0) * 80ms),
      translate 200ms var(--ease-out),
      border-color var(--dur-base) var(--ease-out);
  }

  .status__dot::after {
    animation: ping 2.6s var(--ease-out) infinite;
  }

  .js .card-drop {
    animation: card-drop 1500ms var(--ease-spring) both 300ms;
  }

  .ticker__track {
    animation: ticker 64s linear infinite;
  }

  .ticker:hover .ticker__track {
    animation-play-state: paused;
  }

  .ledger::before,
  .ledger__row::after {
    transition: transform 1100ms var(--ease-out);
    transition-delay: calc(var(--row, 0) * 110ms + 100ms);
  }

  .ledger[data-pending]::before,
  .ledger[data-pending] .ledger__row::after {
    transform: scaleX(0);
  }

  [data-offscreen] .ticker__track,
  [data-offscreen] .status__dot::after,
  [data-offscreen].status .status__dot::after {
    animation-play-state: paused;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.4em) rotate(2deg);
    filter: blur(12px);
  }
}

@keyframes ping {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@keyframes card-drop {
  0% {
    opacity: 0;
    transform: perspective(1100px) translate3d(0, -80px, 0) rotateX(52deg) rotateZ(-9deg) scale(0.88);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card__inner,
  .card[data-flipped] .card__inner {
    transform: none;
    transition: none;
  }

  .card__face,
  .card__face--back {
    transform: none;
    transition: opacity var(--dur-fast);
  }

  .card__face--back,
  .card[data-flipped] .card__face--front {
    opacity: 0;
  }

  .card[data-flipped] .card__face--back {
    opacity: 1;
  }

  .button--primary::before {
    display: none;
  }

  /* The header's glass only fades in, without the drop */
  .site-header__inner::before {
    transform: none;
    transition: opacity var(--dur-base) var(--ease-out);
  }
}

/* Breakpoints */

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

  .service--wide {
    grid-column: span 2;
  }
}

@media (max-width: 960px) {
  .company {
    grid-template-columns: minmax(0, 1fr);
  }

  .principle {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .principle__title {
    padding-top: 20px;
  }
}

@media (max-width: 860px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --page-inset: 0px;
    --page-radius: 0px;
    --gutter: 16px;
  }

  .page {
    border: 0;
    min-height: 100vh;
  }

  .site-header__inner {
    height: 56px;
  }

  /* 56px row: the panel sits 4px in and 6px past the grid, 6px of glass around the centred 36px button:
     R18 + 6 = R24, a capsule. */
  .site-header__inner::before {
    inset: 4px -6px;
    border-radius: 24px;
  }

  .hero__backdrop {
    top: -56px;
    height: calc(min(100%, 720px) + 56px);
    /* On a phone the text covers most of the picture, so it stays quieter throughout. */
    opacity: 0.7;
    -webkit-mask-image: linear-gradient(
      to bottom,
      rgb(0 0 0 / 30%) 0,
      #000 12%,
      rgb(0 0 0 / 82%) 44%,
      rgb(0 0 0 / 60%) 56%,
      rgb(0 0 0 / 38%) 68%,
      rgb(0 0 0 / 19%) 80%,
      rgb(0 0 0 / 6%) 91%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      rgb(0 0 0 / 30%) 0,
      #000 12%,
      rgb(0 0 0 / 82%) 44%,
      rgb(0 0 0 / 60%) 56%,
      rgb(0 0 0 / 38%) 68%,
      rgb(0 0 0 / 19%) 80%,
      rgb(0 0 0 / 6%) 91%,
      transparent 100%
    );
  }

  .hero__title {
    letter-spacing: -0.03em;
  }

  .hero__lead {
    font-size: 17px;
    line-height: 26px;
  }

  .hero__actions {
    width: 100%;
  }

  .hero__actions .button {
    flex: 1 1 0;
    height: 48px;
    font-size: 16px;
    font-weight: 600;
  }

  .services {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 40px;
  }

  .service--wide {
    grid-column: auto;
  }

  .service {
    min-height: 0;
  }

  .principles {
    margin-top: 40px;
  }

  .principle {
    top: calc(72px + var(--i, 0) * 14px);
  }

  .ledger__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .contact {
    min-height: 0;
    padding-bottom: 236px;
  }

  /* Brief 52 → send 40 at inset 6 (border 1 + padding 5), R26 − 6 = R20 */
  .brief {
    height: 52px;
    padding: 0 5px 0 18px;
    border-radius: 26px;
  }

  .site-footer__legal {
    flex-basis: 100%;
    order: 1;
  }

  .to-top {
    margin-left: auto;
  }
}
