  :root {
    --bg: #0b1220;
    --bg-alt: #101a2e;
    --surface: #16233d;
    --text: #e8eef7;
    --muted: #9fb0c8;
    --accent: #4ade80;      /* earth green */
    --accent-2: #38bdf8;    /* sky blue */
    --border: rgba(255,255,255,0.08);
    --nav-h: 68px;
    --radius: 14px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { font-family: "Space Grotesk", sans-serif; line-height: 1.15; }
  a { color: inherit; }
  img { max-width: 100%; display: block; }

  /* ---------- NAV ---------- */
  .nav {
    position: fixed; inset: 0 0 auto 0; height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 48px);
    background: rgba(11,18,32,0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
  }
  .logo {
    font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.25rem;
    text-decoration: none; display: flex; align-items: center; gap: 10px;
  }
  .logo-mark {
    width: 30px; height: 30px; border-radius: 50%; display: block; flex: none;
    box-shadow: 0 0 16px rgba(56,189,248,0.5);
  }
  /* Logo slideshow: Earth → fingerprint → rocket → tree of life → Vitruvian Man, 3s each */
  .lm-frame { opacity: 0; animation: lmCycle 15s infinite both; }
  .lm-frame.f2 { animation-delay: 3s; }
  .lm-frame.f3 { animation-delay: 6s; }
  .lm-frame.f4 { animation-delay: 9s; }
  .lm-frame.f5 { animation-delay: 12s; }
  @keyframes lmCycle { 0% { opacity: 0; } 3%, 19% { opacity: 1; } 22%, 100% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .lm-frame { animation: none; } .lm-frame.f1 { opacity: 1; } }
  .nav-links { display: flex; gap: 6px; list-style: none; }
  .nav-links a {
    text-decoration: none; color: var(--muted); font-size: 0.95rem; font-weight: 500;
    padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links a.active { color: var(--bg); background: var(--accent); }
  .menu-btn {
    display: none; background: none; border: 0; color: var(--text);
    font-size: 1.6rem; cursor: pointer; padding: 6px;
  }

  /* ---------- SECTIONS ---------- */
  section {
    min-height: 100vh;
    padding: calc(var(--nav-h) + 48px) clamp(16px, 6vw, 96px) 80px;
    display: flex; flex-direction: column; justify-content: center;
  }
  section:nth-of-type(even) { background: var(--bg-alt); }
  .container { max-width: 1100px; width: 100%; margin: 0 auto; }
  .eyebrow {
    color: var(--accent); font-weight: 500; letter-spacing: .14em;
    text-transform: uppercase; font-size: .8rem; margin-bottom: 14px;
  }
  h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 20px; }
  .lead { color: var(--muted); font-size: 1.1rem; max-width: 640px; }
  .eyebrow, .tag, .stat strong, .mono { font-family: "IBM Plex Mono", monospace; }
  .redact {
    display: inline-block; background: var(--muted); opacity: .35; border-radius: 2px;
    height: .9em; vertical-align: -0.08em; user-select: none;
  }
  .placeholder { outline: 1px dashed rgba(74,222,128,0.35); outline-offset: 4px; border-radius: 4px; }

  /* ---------- BACKGROUND ART (behind content only) ---------- */
  :root { --art-opacity: .05; } /* how much of the artwork shows through */
  .has-art { position: relative; isolation: isolate; overflow: hidden; }
  .has-art::before, .has-art::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  }
  .has-art::before {
    background: var(--art) center / cover no-repeat;
    filter: grayscale(1);
    opacity: var(--art-opacity);
  }
  .has-art::after {
    background-image:
      radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.7), transparent 60%),
      radial-gradient(1px 1px at 38% 72%, rgba(255,255,255,.5), transparent 60%),
      radial-gradient(1.5px 1.5px at 64% 30%, rgba(255,255,255,.6), transparent 60%),
      radial-gradient(1px 1px at 82% 84%, rgba(255,255,255,.45), transparent 60%),
      radial-gradient(1px 1px at 91% 12%, rgba(255,255,255,.6), transparent 60%),
      radial-gradient(1px 1px at 25% 94%, rgba(255,255,255,.4), transparent 60%);
    background-size: 340px 340px;
  }
  #projects { --art: url("images/ice-base.jpg"); }
  #ideas    { --art: url("images/spaceark.jpg"); }

  /* ---------- WELCOME ---------- */
  #welcome {
    position: relative; overflow: hidden; text-align: center; align-items: center;
    background:
      radial-gradient(ellipse 80% 60% at 50% 120%, rgba(74,222,128,0.25), transparent 70%),
      radial-gradient(ellipse 60% 40% at 50% 110%, rgba(56,189,248,0.25), transparent 70%),
      var(--bg);
  }
  .stars { position: absolute; inset: 0; pointer-events: none; }
  #welcome .container { position: relative; }
  #welcome h1 { font-size: clamp(2.6rem, 8vw, 5.5rem); margin-bottom: 20px; }
  #welcome h1 span {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .logo-hero { margin: 0 auto 28px; }
  .logo-hero img { width: min(340px, 80%); height: auto; margin: 0 auto; }
  .tagline {
    font-family: "Space Grotesk", sans-serif; font-weight: 500;
    font-size: clamp(1.2rem, 3vw, 1.75rem); color: var(--muted);
    letter-spacing: .02em; margin: 0 auto 40px;
  }
  .tw {
    display: inline-block; color: var(--text);
    transition: opacity .35s ease, transform .35s ease, filter .35s ease;
  }
  .tw.out { opacity: 0; transform: translateY(-0.4em); filter: blur(4px); }
  .tw.in  { opacity: 0; transform: translateY(0.4em);  filter: blur(4px); transition: none; }
  .btn {
    display: inline-block; padding: 14px 28px; border-radius: 999px;
    font-weight: 500; text-decoration: none; transition: transform .2s, box-shadow .2s;
  }
  .btn-primary { background: var(--accent); color: var(--bg); }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,222,128,0.35); }
  .btn-ghost { border: 1px solid var(--border); margin-left: 10px; }
  .btn-ghost:hover { border-color: var(--accent); }
  .scroll-hint {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    color: var(--muted); font-size: .85rem; animation: bob 2s ease-in-out infinite;
  }
  @keyframes bob { 50% { transform: translate(-50%, 6px); } }

  /* ---------- ABOUT ---------- */
  .about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
  .about-title { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.3; }
  .about-text p { color: var(--muted); margin-bottom: 16px; }
  .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
  }
  .stat strong { display: block; font-size: .8rem; color: var(--muted); letter-spacing: .1em; margin-bottom: 10px; }
  .stat h3 { font-size: 1.1rem; color: var(--accent); margin-bottom: 6px; }
  .stat { transition: border-color .25s, transform .25s; }
  .stat:hover { border-color: rgba(74,222,128,0.4); transform: translateY(-3px); }
  .stat span { color: var(--muted); font-size: .9rem; }

  /* ---------- CARDS (Projects / Ideas) ---------- */
  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 40px; }
  .card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: transform .25s, border-color .25s;
  }
  .card:hover { transform: translateY(-4px); border-color: rgba(74,222,128,0.4); }
  .card-img {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #1e3a5f, #14532d);
    display: grid; place-items: center; color: var(--muted); font-size: .85rem;
  }
  .card-img svg { width: 100%; height: 100%; }
  #projects .container { max-width: 1240px; }
  #projects .cards { grid-template-columns: repeat(4, 1fr); }
  @media (max-width: 1100px) { #projects .cards { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 640px)  { #projects .cards { grid-template-columns: 1fr; } }
  .card-body { padding: 22px; }
  .card h3 { font-size: 1.25rem; margin-bottom: 8px; }
  .card p { color: var(--muted); font-size: .95rem; }
  .tag {
    display: inline-block; font-size: .75rem; color: var(--accent);
    border: 1px solid rgba(74,222,128,0.35); border-radius: 999px; padding: 2px 10px; margin-bottom: 12px;
  }
  .quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
  @media (max-width: 960px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 600px) { .quotes { grid-template-columns: 1fr; } }
  .quote {
    margin: 0; padding: 28px 26px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
    background: rgba(22,35,61,0.72); border: 1px solid var(--border); border-radius: var(--radius);
    backdrop-filter: blur(4px); transition: border-color .25s, transform .25s;
  }
  .quote:hover { border-color: rgba(74,222,128,0.4); transform: translateY(-3px); }
  .quote blockquote {
    margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 1.08rem; line-height: 1.5; color: var(--text);
  }
  .quote blockquote::before {
    content: "\201C"; display: block; font-size: 2.6rem; line-height: .8; color: var(--accent); margin-bottom: 8px;
  }
  .quote figcaption { color: var(--accent); font-weight: 500; font-size: .95rem; }
  .quote figcaption span {
    display: block; font-family: "IBM Plex Mono", monospace; font-size: .72rem; font-weight: 400;
    color: var(--muted); letter-spacing: .04em; margin-top: 4px;
  }
  .idea-card { padding: 28px; }
  .idea-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(56,189,248,0.12); color: var(--accent-2); font-size: 1.3rem; margin-bottom: 16px;
  }

  /* ---------- CONTACT ---------- */
  .contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; margin-top: 40px; }
  .contact-info li { list-style: none; margin-bottom: 18px; color: var(--muted); }
  .contact-info strong { display: block; color: var(--text); font-weight: 500; }
  form { display: grid; gap: 14px; }
  label { font-size: .9rem; color: var(--muted); display: grid; gap: 6px; }
  input, textarea {
    width: 100%; padding: 13px 15px; border-radius: 10px; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
  }
  input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  textarea { min-height: 140px; resize: vertical; }
  form { position: relative; }
  .form-status { font-size: .95rem; color: var(--accent); min-height: 1.5em; }
  .form-status.error { color: #f87171; }
  form .btn:disabled { opacity: .6; cursor: wait; }
  form .btn { border: 0; cursor: pointer; justify-self: start; font: inherit; font-weight: 500; }

  footer {
    text-align: center; padding: 28px 16px; color: var(--muted); font-size: .85rem;
    border-top: 1px solid var(--border);
  }

  /* ---------- REVEAL ON SCROLL ---------- */
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.visible { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .scroll-hint { animation: none; }
  }

  /* ---------- MOBILE ---------- */
  @media (max-width: 820px) {
    .menu-btn { display: block; }
    .nav-links {
      position: absolute; top: var(--nav-h); left: 0; right: 0;
      flex-direction: column; padding: 12px 16px 20px; gap: 4px;
      background: var(--bg); border-bottom: 1px solid var(--border);
      display: none;
    }
    .nav-links.open { display: flex; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
    .btn-ghost { margin: 12px 0 0; }
  }

/* ---------- FOOTER LINKS ---------- */
footer nav { margin-top: 10px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover, footer nav a[aria-current="page"] { color: var(--accent); }

/* ---------- SUBPAGES (affiliate, license) ---------- */
.subpage section { min-height: auto; padding-top: calc(var(--nav-h) + 72px); }
.subpage section + section { padding-top: 72px; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; counter-reset: step; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-family: "IBM Plex Mono", monospace; color: var(--accent); font-size: .85rem; margin-bottom: 14px;
}
.step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .95rem; }
.code-chip {
  display: inline-block; font-family: "IBM Plex Mono", monospace; letter-spacing: .12em;
  border: 1px dashed var(--accent); color: var(--accent); border-radius: 8px; padding: 4px 10px; font-size: .9rem;
}
.fine { color: var(--muted); font-size: .85rem; margin-top: 28px; max-width: 760px; }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; margin-top: 40px; align-items: start; }
.checklist { list-style: none; display: grid; gap: 12px; }
.checklist li { color: var(--muted); padding-left: 28px; position: relative; }
.checklist li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); }
.checklist.no li::before { content: "\2715"; color: #f87171; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.tier {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; display: flex; flex-direction: column; gap: 18px;
}
.tier.featured { border-color: rgba(74,222,128,0.5); box-shadow: 0 0 0 1px rgba(74,222,128,0.15), 0 18px 40px rgba(0,0,0,.25); }
.tier-level { font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; }
.tier h2 { font-size: 1.7rem; margin: 0; }
.tier > p { color: var(--muted); font-size: .95rem; }
.tier h3 { font-size: .8rem; font-family: "IBM Plex Mono", monospace; color: var(--text); letter-spacing: .1em; text-transform: uppercase; }
.tier .checklist li { font-size: .92rem; }
.tier .doc {
  margin-top: auto; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--border);
  font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--muted); text-align: center;
}
.compare { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: .95rem; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.compare th { font-family: "IBM Plex Mono", monospace; font-size: .78rem; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.compare .y { color: var(--accent); } .compare .n { color: #64748b; }
.table-wrap { overflow-x: auto; }

@media (max-width: 960px) {
  .steps, .tiers { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 32px; }
}

.tier .doc-btn { margin: auto 0 0; text-align: center; font-size: .92rem; padding: 12px 18px; }
.compare td { color: var(--muted); }
.compare td:first-child { color: var(--text); }
@media (max-width: 640px) { .compare { font-size: .82rem; } .compare th, .compare td { padding: 10px 8px; } }

/* ---------- TURIFICUS PAGE ---------- */
/* Turificus Stone web fonts (served from /fonts) */
@font-face { font-family: "Turificus Stone"; font-weight: 200; font-style: normal; font-display: swap; src: url("fonts/TurificusStone-ExtraLight.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 200; font-style: italic; font-display: swap; src: url("fonts/TurificusStone-ExtraLightItalic.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 300; font-style: normal; font-display: swap; src: url("fonts/TurificusStone-Light.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 300; font-style: italic; font-display: swap; src: url("fonts/TurificusStone-LightItalic.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/TurificusStone-Regular.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/TurificusStone-Italic.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/TurificusStone-Bold.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone"; font-weight: 700; font-style: italic; font-display: swap; src: url("fonts/TurificusStone-BoldItalic.woff2") format("woff2"); }
@font-face { font-family: "Turificus Stone Dingbats"; font-display: swap; src: url("fonts/TurificusStoneDingbats-Regular.woff2") format("woff2"); }
:root { --tf: "Turificus Stone", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }

.tf-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 6px; }
.tf-display {
  font-family: var(--tf); font-size: clamp(2.6rem, 9vw, 6.5rem); line-height: 1.05; margin-bottom: 22px;
  background: linear-gradient(90deg, #f5e6c8, #e8eef7 45%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tf-actions { margin: 30px 0 44px; }
.tf-stats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 860px; }
.tf-stats li { background: rgba(22,35,61,.75); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.tf-stats strong { display: block; font-family: var(--tf); font-size: 1.9rem; color: var(--text); font-weight: 400; line-height: 1.1; }
.tf-stats span { color: var(--muted); font-size: .85rem; }

.tf-weights { margin-top: 32px; display: grid; gap: 4px; }
.tf-weights p { font-family: var(--tf); font-size: clamp(1.4rem, 3.4vw, 2.4rem); line-height: 1.35; color: var(--text);
  border-bottom: 1px solid var(--border); padding: 10px 0; overflow-wrap: anywhere; }
.tf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.tf-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.tf-panel h3 { font-size: 1.1rem; color: var(--accent); margin-bottom: 14px; }
.tf-sample { font-family: var(--tf); font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.5; color: var(--text); }
.tf-note { color: var(--muted); font-size: .88rem; margin-top: 14px; }

.tf-tester { margin-top: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tf-controls { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.tf-controls label { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.tf-controls input[type=range] { width: 160px; padding: 0; accent-color: var(--accent); background: none; border: 0; }
.tf-controls select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.tf-check input { width: auto; accent-color: var(--accent); }
.tf-preview { font-family: var(--tf); padding: 28px 22px 34px; min-height: 160px; line-height: 1.2; outline: none; overflow-wrap: anywhere; }
.tf-preview:focus { box-shadow: inset 0 0 0 2px rgba(74,222,128,.35); }
.tf-apps { font-family: var(--tf); font-size: 1.35rem; line-height: 1.6; color: var(--text); }
.tf-price { font-family: var(--tf); font-weight: 400; font-size: 2.4rem !important; }
.turificus .tier .doc-btn { margin-top: auto; }

@media (max-width: 760px) {
  .tf-stats { grid-template-columns: repeat(2, 1fr); }
  .tf-grid { grid-template-columns: 1fr; }
}

.tf-dingbats { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin-top: 32px; }
.tf-dingbats span {
  font-family: "Turificus Stone Dingbats", serif; font-size: 2.4rem; line-height: 1; color: var(--text);
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); transition: color .2s, border-color .2s, transform .2s;
}
.tf-dingbats span:hover { color: var(--accent); border-color: rgba(74,222,128,.4); transform: translateY(-2px); }
.tf-dingbats span { position: relative; }
.tf-dingbats span::after {
  content: attr(data-key); position: absolute; right: 5px; bottom: 3px;
  font-family: "IBM Plex Mono", monospace; font-size: .62rem; color: var(--muted); opacity: .7;
}
