/* ============================================================
   100k31d — shared design system
   One stylesheet for the studio site and every product subsite.
   Products override only --accent (and add product-only parts)
   in their own stylesheet, loaded after this one.
   ============================================================ */

:root {
  color-scheme: light dark;

  /* Surface + ink — identical on every 100k31d page */
  --paper: #f6f4ee;
  --paper-raised: #fdfcf8;
  --paper-sunk: #ece9e0;
  --slab: #22241f;
  --ink: #1c1e1b;
  --muted: #6b6f68;
  --faint: #9a9d95;
  --line: rgba(28, 30, 27, 0.13);
  --line-strong: rgba(28, 30, 27, 0.24);
  --on-accent: #f8f7f1;

  /* Product accent — the only colour a subsite is allowed to change */
  --accent: #245c4f;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 34%, transparent);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(44px, 6.6vw, 82px);
  --fs-title: clamp(32px, 4.4vw, 56px);
  --fs-subtitle: clamp(26px, 3vw, 38px);
  --fs-lede: clamp(17px, 1.5vw, 20px);
  --fs-h3: 20px;
  --fs-body: 16px;
  --fs-meta: 14px;
  --fs-micro: 12px;

  /* Space */
  --gutter: 24px;
  --max: 1120px;
  --max-text: 760px;
  --section-y: clamp(72px, 9vw, 118px);

  /* Shape + motion */
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 10px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 22px 60px rgba(28, 30, 27, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171915;
    --paper-raised: #1f221e;
    --paper-sunk: #121410;
    --slab: #101210;
    --ink: #eeece4;
    --muted: #a2a59c;
    --faint: #75786f;
    --line: rgba(238, 236, 228, 0.13);
    --line-strong: rgba(238, 236, 228, 0.26);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  }
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  /* Stop iOS Safari's automatic font boosting in narrow grid/flex columns
     (notably .hero-split) — without this it silently inflates heading
     sizes well past what's declared. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img,
video {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

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

/* ---------- layout ---------- */

.shell {
  width: min(calc(100% - (var(--gutter) * 2)), var(--max));
  margin-inline: auto;
}

.shell.narrow {
  max-width: var(--max-text);
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-icon {
  width: 34px;
  height: 34px;
}

.brand-note {
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  font-size: var(--fs-meta);
}

.site-nav a {
  color: var(--muted);
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

/* ---------- text atoms ---------- */

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: var(--fs-micro);
  font-weight: 680;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: var(--fs-lede);
  line-height: 1.55;
  letter-spacing: -0.012em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-meta);
  font-weight: 620;
  letter-spacing: -0.01em;
  transition:
    filter 160ms ease,
    transform 160ms var(--ease),
    border-color 160ms ease,
    color 160ms ease;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn.quiet {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn.quiet:hover,
.btn.quiet:focus-visible {
  border-color: var(--accent);
  filter: none;
}

.btn.link {
  min-height: 0;
  padding: 0;
  color: var(--muted);
  font-weight: 580;
}

.btn.link:hover,
.btn.link:focus-visible {
  color: var(--ink);
  filter: none;
  transform: none;
}

.text-link {
  color: var(--accent);
  font-weight: 620;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.22em;
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(72px, 9vw, 112px) 0 clamp(64px, 8vw, 92px);
  text-align: center;
}

.hero.left {
  align-items: flex-start;
  text-align: left;
}

/* App icons ship with their own corners and shading — no radius, no shadow. */
.hero-icon {
  width: 154px;
  height: 154px;
  margin-bottom: 36px;
  animation: breathe 5s ease-in-out infinite;
}

.hero-title {
  max-width: 16ch;
  margin-bottom: 22px;
  font-size: var(--fs-display);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero.left .hero-title {
  max-width: 20ch;
}

.hero-lede {
  max-width: 600px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: var(--fs-lede);
  line-height: 1.55;
  letter-spacing: -0.012em;
}

/* Button row. .actions is left-aligned anywhere; .hero-actions centres in a centred hero. */
.actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.hero-actions {
  justify-content: center;
}

.hero.left .hero-actions {
  justify-content: flex-start;
}

/* Copy on the left, product view on the right. Stacks under 860px. */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  padding: clamp(48px, 6vw, 80px) 0 clamp(56px, 7vw, 88px);
}

.hero-split .hero {
  align-items: flex-start;
  padding: 0;
  text-align: left;
}

.hero-split .hero-title,
.hero-split .hero-lede {
  max-width: none;
}

/* Half a column cannot carry the full display size — it wraps to orphans.
   Only applies once the columns actually sit side by side; below 860px
   .hero-split stacks to full width and .hero-title goes back to --fs-display. */
@media (min-width: 860.02px) {
  .hero-split .hero-title {
    font-size: clamp(38px, 4.6vw, 60px);
  }
}

.hero-split .hero-actions {
  justify-content: flex-start;
}

.hero-split .hero-icon {
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
}

/* ---------- sections ---------- */

.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.section.plain {
  border-top: 0;
}

.section-head {
  max-width: var(--max-text);
  margin-bottom: clamp(40px, 5vw, 60px);
}

.section-title {
  margin-bottom: 0;
  font-size: var(--fs-title);
  letter-spacing: -0.048em;
  line-height: 1.02;
}

.section-lede {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: var(--fs-lede);
  line-height: 1.6;
}

/* ---------- grids ---------- */

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.rule {
  gap: clamp(36px, 4vw, 56px) clamp(28px, 3vw, 48px);
}

/* ---------- item: the hairline-topped numbered block ---------- */

.item {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.item-num {
  display: block;
  margin-bottom: clamp(28px, 4vw, 44px);
  color: var(--faint);
  font-size: var(--fs-micro);
  font-weight: 620;
  letter-spacing: 0.06em;
}

.item-title {
  margin-bottom: 10px;
  font-size: var(--fs-h3);
  letter-spacing: -0.028em;
}

.item-text,
.card-text {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- card: the bordered surface block ---------- */

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--paper-raised) 62%, transparent);
  transition:
    border-color 220ms var(--ease),
    background-color 220ms var(--ease),
    transform 220ms var(--ease);
}

a.card:hover,
a.card:focus-visible {
  border-color: var(--line-strong);
  background: var(--paper-raised);
  transform: translateY(-2px);
}

.card-meta {
  color: var(--faint);
  font-size: var(--fs-micro);
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  margin-bottom: 0;
  font-size: var(--fs-h3);
  letter-spacing: -0.028em;
}

/* A card that leaves the site says so, with the same ↗ the buttons use. */
.card[target="_blank"] .card-title::after {
  content: " ↗" / "";
  color: var(--faint);
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0;
}

a.card[target="_blank"]:hover .card-title::after,
a.card[target="_blank"]:focus-visible .card-title::after {
  color: var(--accent);
}

.card-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: clamp(24px, 4vw, 44px);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-micro);
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- showcase: product imagery ---------- */

.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper-sunk);
  box-shadow: var(--shadow);
}

.shot img,
.shot video {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* dark stage for in-page product mockups */
.stage {
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 3vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--slab);
  color: #f0efe8;
  isolation: isolate;
}

/* ---------- closing slab ---------- */

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: clamp(56px, 8vw, 84px) 28px;
  border-radius: var(--r-lg);
  background: var(--slab);
  color: #f4f2ea;
  text-align: center;
}

.closing img {
  width: 76px;
  height: 76px;
  margin-bottom: 26px;
}

.closing .eyebrow {
  color: color-mix(in srgb, var(--accent) 62%, #f4f2ea);
}

.closing-title {
  max-width: 20ch;
  margin-bottom: 16px;
  font-size: var(--fs-title);
  letter-spacing: -0.048em;
}

.closing-note {
  margin-bottom: 26px;
  color: rgba(244, 242, 234, 0.6);
  font-size: 15px;
}

.closing .btn.primary {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: #f4f2ea;
}

/* ---------- definition list ---------- */

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 28px;
  margin: 0;
}

.meta dt {
  color: var(--faint);
  font-size: var(--fs-micro);
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.meta a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.18em;
}

/* ---------- footer ---------- */

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 148px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: var(--fs-meta);
}

.footer-nav a {
  color: var(--muted);
  transition: color 160ms ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--ink);
}

.footer-note {
  margin: 0;
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- legal + FAQ ---------- */

.legal {
  width: min(calc(100% - (var(--gutter) * 2)), var(--max-text));
  margin-inline: auto;
  padding: clamp(72px, 9vw, 108px) 0 clamp(88px, 11vw, 140px);
}

.legal-head {
  margin-bottom: clamp(48px, 6vw, 70px);
}

.legal-head h1 {
  margin-bottom: 16px;
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -0.05em;
}

.legal-date {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.legal-note,
.legal-body .legal-note {
  margin: 0 0 clamp(40px, 5vw, 54px);
  padding: 22px 24px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.legal-body section,
.faq-item {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.legal-body h2,
.faq-item h2 {
  margin-bottom: 12px;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.legal-body h3 {
  margin: 26px 0 10px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.legal-body p,
.legal-body li,
.faq-item p {
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.legal-body li {
  margin: 8px 0;
}

.legal-body ul {
  margin-top: 0;
  padding-left: 20px;
}

.legal-body p:last-child,
.legal-body ul:last-child,
.faq-item p:last-child {
  margin-bottom: 0;
}

.legal-body strong,
.faq-item strong {
  color: var(--ink);
  font-weight: 620;
}

.legal-body a,
.faq-item a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.faq-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

/* ---------- motion ---------- */

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
  }

  .reveal.is-visible {
    animation: reveal-in 700ms var(--ease) both;
    animation-delay: var(--reveal-delay, 0ms);
  }
}

/* ---------- responsive ---------- */

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

  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-icon {
    width: 128px;
    height: 128px;
    border-radius: 28px;
  }
}

@media (max-width: 620px) {
  :root {
    --gutter: 16px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 8px 18px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .hero-actions {
    justify-content: flex-start;
  }

  .site-footer {
    justify-items: center;
    grid-template-columns: minmax(0, 1fr);
    padding: 38px 0;
    text-align: center;
  }

  .footer-note {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
