/* ==========================================================================
   apps-site (iletai) — Design System v2: Ink & Aurora
   Documented in DESIGN.md. Source of truth for hub, app landings, support, privacy.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,300..700&family=JetBrains+Mono:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;1,6..72,400;1,6..72,600&display=swap');

/* ---------- 1. Design Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Neutrals (Ink & Paper) */
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F4F2ED;
  --fg: #131316;
  --muted: #5C5B63;
  --line: #E4E1DA;

  /* Signature & Chrome */
  --sig: #4A3AFF;
  --ink-btn: #131316;
  --on-ink: #FFFFFF;
  --ink-btn-hover: #26262B;

  /* Default Aurora */
  --aurora-1: #DCD6FF;
  --aurora-2: #FFE6D2;

  /* Default Brand (Fallback for Hub) */
  --brand: #131316;
  --brand-2: #3A3940;
  --on-brand: #FFFFFF;
  --accent: #4A3AFF;
  --tint: #F4F2ED;
  --hero-base: #FBFAF7;
  --hero-fg: var(--fg);
  --hero-muted: var(--muted);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-serif: "Newsreader", ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-card: 24px;
  --radius-stage: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --section: 112px;
  --wrap-max: 1160px;
  --prose-max: 720px;

  /* Layered Shadows */
  --shadow-sm: 0 1px 2px rgba(19, 19, 22, .05), 0 2px 8px rgba(19, 19, 22, .04);
  --shadow-md: 0 4px 12px rgba(19, 19, 22, .06), 0 12px 28px rgba(19, 19, 22, .07);
  --shadow-lg: 0 8px 24px rgba(19, 19, 22, .08), 0 24px 56px rgba(19, 19, 22, .12);
  --shadow-float: 0 20px 48px -12px rgba(19, 19, 22, .18), 0 32px 72px -16px rgba(74, 58, 255, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0C;
    --surface: #141417;
    --surface-2: #1D1D22;
    --fg: #F4F2ED;
    --muted: #9C9AA3;
    --line: #26262B;

    --sig: #A79BFF;
    --ink-btn: #F4F2ED;
    --on-ink: #0A0A0C;
    --ink-btn-hover: #FFFFFF;

    --aurora-1: #2A1F6B;
    --aurora-2: #4A2418;

    --brand: #F4F2ED;
    --brand-2: #C9C9D1;
    --on-brand: #0A0A0C;
    --accent: #A79BFF;
    --tint: #16161B;
    --hero-base: #0A0A0C;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .45), 0 28px 64px rgba(0, 0, 0, .6);
    --shadow-float: 0 24px 56px -12px rgba(0, 0, 0, .7), 0 32px 72px -16px rgba(167, 155, 255, .15);
  }
}

@media (max-width: 767px) {
  :root {
    --section: 68px;
  }
}

/* ---------- 2. Per-App Themes ---------- */
/* SleepLoop: AccentColor #2340E8, icon cream #F5F0E8 + amber #C47A1F */
.app-sleeploop {
  --brand: #2340E8;
  --brand-2: #4B5CF0;
  --on-brand: #FFFFFF;
  --accent: #2340E8;
  --tint: #EEF0FD;
  --hero-base: #F7F3EC;
  --aurora-1: #D0D7FF;
  --aurora-2: #FFE6CA;
}
@media (prefers-color-scheme: dark) {
  .app-sleeploop {
    --accent: #8B9BFF;
    --tint: #12152B;
    --brand: #3651F0;
    --brand-2: #5D72F5;
    --hero-base: #0B0D1C;
    --aurora-1: #1C246B;
    --aurora-2: #472C0F;
  }
}

/* An Niên: AccentColor #CC1636, imperial gold #C5A059, dark lacquer hero */
.app-annien {
  --brand: #C8102E;
  --brand-2: #C2413A;
  --on-brand: #FFFFFF;
  --accent: #B3122C;
  --tint: #FBF1EE;
  --gold: #C5A059;
  --hero-base: #160E0D;
  --hero-fg: #FBF3EA;
  --hero-muted: #D9C9B6;
  --font-display: var(--font-serif);
  --aurora-1: #FFD6D6;
  --aurora-2: #FFE7C0;
}
@media (prefers-color-scheme: dark) {
  .app-annien {
    --accent: #FF7D8C;
    --tint: #1B1211;
    --hero-base: #110A09;
    --aurora-1: #500A14;
    --aurora-2: #422F0C;
  }
}

/* Titto: macOS native clipboard manager, gradient #2563EB -> #7C3AED */
.app-titto {
  --brand: #2563EB;
  --brand-2: #7C3AED;
  --on-brand: #FFFFFF;
  --accent: #3B4FE0;
  --tint: #EFF0FE;
  --hero-base: linear-gradient(135deg, #2563EB 0%, #5148E8 55%, #7C3AED 100%);
  --hero-fg: #FFFFFF;
  --hero-muted: rgba(255, 255, 255, .88);
  --aurora-1: #D4DBFF;
  --aurora-2: #EAD5FF;
}
@media (prefers-color-scheme: dark) {
  .app-titto {
    --accent: #9AA6FF;
    --tint: #13142A;
    --hero-base: linear-gradient(135deg, #1D4ED8 0%, #4338CA 55%, #6D28D9 100%);
    --aurora-1: #1E256E;
    --aurora-2: #38165E;
  }
}

/* ROLL 36: Analog film camera for iPhone, warm film tones */
.app-roll36 {
  --brand: #8A5A00;
  --brand-2: #B87B14;
  --on-brand: #FFFFFF;
  --accent: #8A5A00;
  --tint: #FBF6ED;
  --hero-base: #1A1512;
  --hero-fg: #F5EFEB;
  --hero-muted: #C2B6A6;
  --aurora-1: #FFE8C2;
  --aurora-2: #E8DFD3;
}
@media (prefers-color-scheme: dark) {
  .app-roll36 {
    --accent: #F0C674;
    --tint: #201A12;
    --hero-base: #120F0D;
    --aurora-1: #472F08;
    --aurora-2: #2E2822;
  }
}

/* Turnproofs: Rental condition reports, teal tones */
.app-turnproof {
  --brand: #0F5F52;
  --brand-2: #188674;
  --on-brand: #FFFFFF;
  --accent: #0F5F52;
  --tint: #EDF8F5;
  --aurora-1: #C6F0E6;
  --aurora-2: #D9E8F5;
}
@media (prefers-color-scheme: dark) {
  .app-turnproof {
    --accent: #6FD3BE;
    --tint: #0E2320;
    --brand: #147B6A;
    --brand-2: #21A08D;
    --aurora-1: #0C3E36;
    --aurora-2: #162E40;
  }
}

/* Closeout: Field job reports, amber/ochre tones */
.app-closeout {
  --brand: #8A4B00;
  --brand-2: #BA6B0D;
  --on-brand: #FFFFFF;
  --accent: #8A4B00;
  --tint: #FDF5ED;
  --aurora-1: #FFE0BD;
  --aurora-2: #F7E5D0;
}
@media (prefers-color-scheme: dark) {
  .app-closeout {
    --accent: #FFB871;
    --tint: #261B0E;
    --brand: #B86707;
    --brand-2: #D98218;
    --aurora-1: #4F2B04;
    --aurora-2: #3B2816;
  }
}

/* OffRecord: AccentColor #2C3E50 / #8E9AA8, recording crimson #A91D22, steel-vault hero */
.app-offrecord {
  --brand: #2C3E50;
  --brand-2: #445a70;
  --on-brand: #FFFFFF;
  --accent: #2C3E50;
  --tint: #EDF0F3;
  --hero-base: #0B0F14;
  --hero-fg: #F7F8FA;
  --hero-muted: rgba(247, 248, 250, .78);
  --aurora-1: #9FB0C2;
  --aurora-2: #C4706F;
}
@media (prefers-color-scheme: dark) {
  .app-offrecord {
    --accent: #8E9AA8;
    --tint: #14181C;
    --brand: #8E9AA8;
    --brand-2: #AEB8C4;
    --hero-base: #080B0E;
    --aurora-1: #24303B;
    --aurora-2: #43161A;
  }
}

/* ---------- 3. Base Styles & Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .18s ease;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--sig);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.wrap {
  max-width: var(--wrap-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

@media (min-width: 768px) {
  .wrap {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.col {
  max-width: var(--prose-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.muted {
  color: var(--muted);
}

code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: .15em .45em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

/* Headings */
h1, h2, h3, h4 {
  color: inherit;
  margin-top: 0;
}

.serif-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
  font-weight: 700;
  margin: 0 0 20px;
  text-wrap: balance;
}

.hub-hero .display {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6.2vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 16px;
  text-wrap: balance;
}

.h2-serif {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 0 0 16px;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 10px;
  max-width: 46ch;
  text-wrap: pretty;
}

.alt {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 12px;
  opacity: .92;
  line-height: 1.5;
}

.center {
  text-align: center;
}
.center .lead, .center .alt {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- 4. Spec-Sheet Label (Signature Item 1) ---------- */
.spec {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 16px;
}

.spec span {
  color: var(--sig);
  font-weight: 600;
}

.spec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  min-width: 32px;
}

.spec.no-rule::after {
  display: none;
}

.spec.center {
  justify-content: center;
}
.spec.center::before {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  min-width: 32px;
}

/* ---------- 5. Aurora Drift (Signature Item 2) ---------- */
.aurora-wrap {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.aurora-bg {
  position: absolute;
  inset: -15% -10% -15% -10%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.65;
  mix-blend-mode: multiply;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .aurora-blob {
    mix-blend-mode: screen;
    opacity: 0.35;
    filter: blur(90px);
  }
}

.aurora-blob-1 {
  width: min(580px, 85vw);
  height: min(500px, 75vw);
  left: 5%;
  top: -10%;
  background: radial-gradient(circle, var(--aurora-1), transparent 70%);
  animation: aurora-drift-1 28s ease-in-out infinite alternate;
}

.aurora-blob-2 {
  width: min(520px, 80vw);
  height: min(460px, 70vw);
  right: 5%;
  top: 15%;
  background: radial-gradient(circle, var(--aurora-2), transparent 70%);
  animation: aurora-drift-2 36s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.12); }
}

@keyframes aurora-drift-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, 30px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob-1, .aurora-blob-2 {
    animation: none;
  }
}

/* ---------- 6. Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.nav.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 20px rgba(19, 19, 22, .04);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.brand:hover {
  text-decoration: none;
  opacity: .85;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a:not(.btn) {
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--fg);
  background: var(--surface-2);
  text-decoration: none;
}

.nav-links a[aria-current] {
  color: var(--fg);
}

@media (max-width: 640px) {
  .nav-links a.hide-sm {
    display: none;
  }
}

/* ---------- 7. Buttons & Chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: center;
  color: var(--on-brand);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 18px color-mix(in srgb, var(--brand) 30%, transparent);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 10px 24px color-mix(in srgb, var(--brand) 38%, transparent);
}

/* Ink Chrome Button (Publisher Voice) */
.btn-ink {
  background: var(--ink-btn);
  color: var(--on-ink);
  border-color: var(--ink-btn);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 4px 14px rgba(19, 19, 22, .12);
}

.btn-ink:hover {
  background: var(--ink-btn-hover);
  color: var(--on-ink);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 8px 20px rgba(19, 19, 22, .18);
}

/* Ghost Button */
.btn-ghost {
  background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
  box-shadow: none;
}

.btn-ghost:hover {
  box-shadow: none;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

/* Light Button (for dark hero/band) */
.btn-light {
  background: #FFFFFF;
  color: #131316;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.btn-light:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  filter: brightness(0.97);
}

/* Small Button (Nav) */
.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

@media (max-width: 480px) {
  .cta-row .btn {
    flex: 1 1 100%;
  }
}

/* Facts / Chips Row */
.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.fact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-num {
  color: var(--sig);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}

.chips li, .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  color: inherit;
  background: color-mix(in srgb, currentColor 7%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.chips li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

/* ---------- 8. Device Frames (CSS Only) ---------- */
/* Phone Frame */
.phone {
  position: relative;
  width: min(300px, 78vw);
  margin: 0;
  padding: 11px;
  border-radius: 50px;
  background: linear-gradient(145deg, #2A2A30, #0D0D10);
  box-shadow: 0 0 0 1.5px #3A3A42 inset, 0 0 0 1px rgba(0, 0, 0, .6), var(--shadow-lg);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 40px;
  background: #000;
  object-fit: cover;
}

.phone::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 30%;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050506;
}

.phone.sm {
  width: 230px;
  padding: 9px;
  border-radius: 40px;
}
.phone.sm img {
  border-radius: 32px;
}
.phone.sm::after {
  top: 17px;
  height: 19px;
}

/* Mac Window Frame */
.mac {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #1F1F24;
  width: 100%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), var(--shadow-lg);
}

.mac-bar {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: linear-gradient(#ECECF0, #DEDEE3);
}

.mac-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF5F57;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15) inset;
}
.mac-bar i:nth-child(2) { background: #FEBC2E; }
.mac-bar i:nth-child(3) { background: #28C840; }

.mac.dark .mac-bar {
  background: linear-gradient(#3A3A40, #2C2C31);
}

.mac img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- 9. Hero Sections ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--hero-fg);
  background: var(--hero-base);
  padding: 80px 0 var(--section);
  isolation: isolate;
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 56px;
  }
}

.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

/* Hub Hero Collage */
.hero-collage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: collage-float 9s ease-in-out infinite alternate;
}

.hero-collage .collage-mac {
  width: 88%;
  transform: translateY(-16px) rotate(1deg);
  box-shadow: var(--shadow-float);
}

.hero-collage .collage-phone {
  position: absolute;
  right: -5%;
  bottom: -15px;
  width: 44%;
  max-width: 220px;
  transform: rotate(-3deg);
  box-shadow: var(--shadow-float);
  z-index: 2;
}

@keyframes collage-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-collage {
    animation: none;
  }
}

@media (max-width: 640px) {
  .hero-collage {
    min-height: 320px;
  }
  .hero-collage .collage-phone {
    right: 0;
  }
}

/* ---------- 10. Hub Showcase (Section 01) ---------- */
.app-cards-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .app-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-card.col-span-2 {
    grid-column: span 2;
  }
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--fg);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.app-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.app-card-body {
  padding: 28px 28px 20px;
  display: flex;
  flex-direction: column;
}

.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-card-head img {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.app-card-head .pill {
  color: var(--accent);
}

.app-card h2, .app-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.25;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.app-card .more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  transition: transform .18s ease;
}

.app-card:hover .more {
  transform: translateX(4px);
}

/* Featured Hub Card (Titto) */
.app-card.featured {
  margin-bottom: 24px;
}

@media (min-width: 900px) {
  .app-card.featured {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    align-items: stretch;
  }
  .app-card.featured .app-card-body {
    padding: 44px;
    justify-content: center;
  }
  .app-card.featured .app-card-shot {
    height: 100%;
    min-height: 340px;
  }
}

.app-card-shot {
  margin-top: auto;
  height: 240px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.app-card-shot img {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 210px;
  transform: translateX(-50%);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 0 0 6px #111, var(--shadow-lg);
  transition: transform .35s ease;
}

.app-card:hover .app-card-shot img {
  transform: translateX(-50%) translateY(-6px) scale(1.02);
}

.app-card-shot.wide img {
  width: 114%;
  max-width: none;
  left: 6%;
  transform: none;
  top: 24px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.app-card:hover .app-card-shot.wide img {
  transform: translateY(-6px) scale(1.01);
}

/* Monogram Fallback Tile (for apps without icon art) */
.monogram-tile {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: linear-gradient(135deg, #1A1512, #382E25);
  color: #F0C674;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, .1);
}

.app-card-placeholder-shot {
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #181512, #26211C);
  color: #A89F91;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  gap: 12px;
}

.app-card-placeholder-shot svg {
  width: 36px;
  height: 36px;
  opacity: .5;
}

/* ---------- 11. Principles Section (Section 02) ---------- */
.principles-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .principles-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

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

.principle-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--sig);
  margin-bottom: 12px;
  display: block;
}

.principle-item h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.principle-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ---------- 12. Maker Note Section (Section 03) ---------- */
.maker-block {
  max-width: var(--prose-max);
  margin: 0 auto;
  text-align: center;
  padding: 40px 0;
}

.maker-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 24px;
  text-wrap: balance;
}

.maker-block p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 24px;
}

/* ---------- 13. FAQ Accordion (Section 04) ---------- */
.faq {
  max-width: 760px;
  margin: 32px auto 0;
  display: grid;
  gap: 12px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.faq details[open] {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 56px 20px 24px;
  font-weight: 600;
  position: relative;
  line-height: 1.4;
  font-size: 1.05rem;
  color: var(--fg);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq summary:focus-visible {
  outline-offset: -3px;
  border-radius: 18px;
}

.faq details > :not(summary) {
  margin: 0;
  padding: 0 24px 22px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ---------- 14. Full-Bleed Call-To-Action Band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-stage);
  padding: 64px 32px;
  color: #FFFFFF;
  background: #131316;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  margin: 40px 0 0;
}

.cta-band::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 58, 255, .25), transparent 70%);
  pointer-events: none;
}

.cta-band-in {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .cta-band-in {
    flex-direction: row;
    padding: 12px 20px;
  }
}

.cta-band h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 10px;
  color: #FFFFFF;
}

.cta-band p {
  color: rgba(255, 255, 255, .82);
  margin: 0;
  font-size: 1.05rem;
}

/* App-themed CTA band */
.app-cta-band {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-cta-band img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.app-cta-band .cta-row {
  justify-content: center;
}

/* ---------- 15. Feature Rows & Stages (App Pages) ---------- */
.section {
  padding: var(--section) 0;
}
.section + .section {
  padding-top: 0;
}

.section-head {
  max-width: var(--prose-max);
  margin: 0 auto 48px;
  text-align: center;
}
.section-head .lead {
  margin: 0 auto 8px;
}

.feature {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 0 0 var(--section);
}

@media (min-width: 768px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 72px);
  }
  .feature.flip .stage {
    order: -1;
  }
}

.feature-copy p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.62;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  border-radius: var(--radius-stage);
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 30% 20%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
    radial-gradient(55% 55% at 80% 90%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 70%),
    var(--tint);
  border: 1px solid var(--line);
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.ticks li {
  position: relative;
  padding-left: 32px;
  font-size: 0.98rem;
  color: var(--fg);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.ticks li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(.35em + 4px);
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 4-Card Grid on App Pages (e.g. Titto) */
.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.card-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent);
}

.card-ico svg {
  width: 22px;
  height: 22px;
}

/* Light / Dark Mode Comparison Pair */
.pair {
  display: grid;
  gap: 28px;
  margin-bottom: var(--section);
}

@media (min-width: 900px) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* Gallery Scroll-Snap Strip */
.gallery {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  margin: 0 calc(50% - 50vw);
  padding: 12px max(20px, calc(50vw - 548px)) 28px;
  scroll-padding: 0 max(20px, calc(50vw - 548px));
}

@media (min-width: 1000px) {
  .gallery.fit {
    justify-content: center;
  }
}

.gallery figure {
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: center;
  text-align: center;
}

.gallery figcaption {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.gallery .mac {
  width: min(600px, 84vw);
}

/* ---------- 16. Doc Pages (Support + Privacy) ---------- */
.doc-head {
  position: relative;
  overflow: hidden;
  padding: 64px 0 52px;
  isolation: isolate;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.doc-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 120% at 90% 0%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
    radial-gradient(35% 100% at 0% 100%, color-mix(in srgb, var(--brand-2) 16%, transparent), transparent 70%);
}

.doc-head .col > img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.doc-head h1, .doc-head header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
  text-wrap: balance;
}

.doc-head p {
  margin: 0;
}

.prose {
  padding-top: 48px;
  padding-bottom: var(--section);
}

.prose h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 64px 0 16px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.prose h2 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 44px 0 14px;
  font-weight: 600;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  margin: 28px 0 8px;
  font-weight: 600;
}

.prose p, .prose li {
  color: color-mix(in srgb, var(--fg) 88%, var(--bg));
  line-height: 1.65;
}

.prose ul {
  padding-left: 1.3rem;
}

.prose li {
  margin: 6px 0;
}

.prose li::marker {
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}

.prose table {
  margin: 0;
}

th, td {
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-weight: 600;
  background: var(--surface-2);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}

.callout {
  position: relative;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 18px;
  padding: 20px 22px 20px 26px;
  margin: 24px 0;
  overflow: hidden;
}

.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(var(--brand), var(--brand-2));
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  margin: 28px 0;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.contact-card p {
  margin: 0;
}

/* ---------- 17. 4-Column Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 44px;
  font-size: 0.94rem;
  color: var(--muted);
  background: var(--surface-2);
}

.foot-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .foot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .foot-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.foot-grid h2, .foot-grid h3 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg);
  margin: 0 0 16px;
  font-weight: 600;
}

.foot-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.site-footer a {
  color: var(--muted);
  transition: color .18s ease;
}

.site-footer a:hover, .site-footer a[aria-current] {
  color: var(--fg);
}

.foot-brand p {
  margin: 12px 0 0;
  max-width: 22rem;
  line-height: 1.6;
}

.copy {
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- 18. Scroll Reveal & A11y ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .68, 0, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn, .card, .app-card, .app-card-shot img, .faq summary::after, .nav, .more {
    transition: none !important;
  }
  .btn:hover, .card:hover, .app-card:hover {
    transform: none !important;
  }
}
