/* ===========================================================================
   Tilichu — marketing site
   Shared design system. Dark graphite chassis (matches the plugin) + a frosty
   "ice" primary, with per-section accents lifted from MtLookAndFeel.
   =========================================================================== */

:root {
  /* chassis — same fixed sRGB graphite family as the plugin (MtTheme.h) */
  --void:   #06080b;
  --bg:     #090c11;
  --bg2:    #0d1116;
  --panel:  #101419;
  --panel2: #151a1f;
  --raise:  #1d2228;
  --line:   #1f2328;
  --line2:  #2e333a;

  --hi:  #edeff1;
  --tx:  #b4b8bc;
  --mid: #7c8186;
  --lo:  #54585e;
  --dim: #3f4348;

  /* accent — frosty ice (plugin's default mono primary, makeAccent(225,.86,.07)).
     --accent is the retintable global; sections override locally. */
  --ice:      oklch(0.86 0.07 225);
  --ice-2:    oklch(0.94 0.03 225);
  --ice-deep: oklch(0.59 0.07 241);

  --accent:   var(--ice);
  --accent-2: var(--ice-2);
  --accent-deep: var(--ice-deep);

  /* per-section hues (multi-accent family) */
  --osc:  oklch(0.82 0.13 200);
  --oscb: oklch(0.82 0.13 248);
  --filt: oklch(0.82 0.13 156);
  --lfo:  oklch(0.74 0.13 292);
  --env:  oklch(0.81 0.12 64);
  --src:  oklch(0.82 0.13 172);

  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --brand: 'Cormorant', 'Cormorant Garamond', Georgia, serif;

  --maxw: 1240px;
  --gut: clamp(20px, 5vw, 64px);

  /* mood (tweakable): graphite default */
  --grid-op: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--display);
  background: var(--void);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.5;
}

/* atmospheric backdrop: hairline tech grid + accent bloom + grain */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(80% 50% at 50% -8%, color-mix(in oklch, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(60% 50% at 100% 100%, color-mix(in oklch, var(--src) 5%, transparent), transparent 70%),
    var(--void);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: calc(0.5 * var(--grid-op));
  background-image:
    linear-gradient(to right, color-mix(in oklch, var(--line) 60%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, var(--line) 60%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
}

::selection { background: color-mix(in oklch, var(--accent) 40%, transparent); color: var(--hi); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent-2);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.eyebrow.center::before { display: none; }

h1, h2, h3 { color: var(--hi); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; }
h1 { font-size: clamp(44px, 7.5vw, 104px); font-weight: 700; }
h2 { font-size: clamp(32px, 4.5vw, 60px); }
h3 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -0.01em; }

.lead { font-size: clamp(16px, 1.5vw, 20px); color: var(--mid); max-width: 56ch; text-wrap: pretty; }
.mono { font-family: var(--mono); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
section { position: relative; }
.sec-pad { padding-block: clamp(80px, 12vh, 160px); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line2), transparent); }

/* ---------- buttons ---------- */
.btn {
  --b: var(--accent);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 9px;
  border: 1px solid var(--line2); color: var(--hi);
  background: var(--raise);
  cursor: pointer; transition: .22s cubic-bezier(.2,.6,.2,1);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--b) 55%, var(--line2)); }
.btn .ar { transition: transform .22s; }
.btn:hover .ar { transform: translateX(3px); }

.btn-primary {
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent) 26%, var(--raise)), color-mix(in oklch, var(--accent) 8%, var(--bg)));
  border-color: color-mix(in oklch, var(--accent) 50%, transparent);
  color: var(--hi);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 18%, transparent) inset,
              0 10px 34px -12px color-mix(in oklch, var(--accent) 70%, transparent);
}
.btn-primary:hover {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 30%, transparent) inset,
              0 14px 44px -10px color-mix(in oklch, var(--accent) 85%, transparent);
}
.btn-ghost { background: transparent; border-color: var(--line2); color: var(--tx); }
.btn-ghost:hover { color: var(--hi); }
.btn-sm { padding: 9px 15px; font-size: 12px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: .3s;
}
.nav.scrolled {
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--brand); font-weight: 600; color: var(--hi); letter-spacing: 0.005em; font-size: 27px; line-height: 1; }
.brand svg { overflow: visible; }
.brand-lockup-nav { height: 34px; width: auto; display: block; }
.brand-word { height: 21px; width: auto; margin-top: 1px; }
footer .brand-mark { height: 34px; }
footer .brand-word { height: 24px; }
.nav-links { display: flex; gap: 26px; margin-left: 14px; }
.nav-links a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--mid); transition: .2s; position: relative; padding: 4px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--hi); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line2); border-radius: 9px; background: var(--raise); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--hi); border-radius: 2px; transition: .24s cubic-bezier(.2,.6,.2,1); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-links .m-cta { display: none; }

/* ---------- pill / chip ---------- */
.pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-2);
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line2));
  background: color-mix(in oklch, var(--accent) 10%, transparent);
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- feature card ---------- */
.fcard {
  --b: var(--accent);
  position: relative; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  padding: 30px;
  transition: .3s;
}
.fcard:hover { border-color: color-mix(in oklch, var(--b) 40%, var(--line2)); transform: translateY(-3px); }
.fcard::before {
  content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--b), transparent 70%);
  opacity: .85;
}
.fcard .ico {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in oklch, var(--b) 12%, var(--raise));
  border: 1px solid color-mix(in oklch, var(--b) 30%, var(--line2));
  color: var(--b); margin-bottom: 18px;
}
.fcard h3 { margin-bottom: 9px; }
.fcard p { font-size: 14.5px; color: var(--mid); }

/* ---------- screen frame (plugin shots) ---------- */
.screen {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line2);
  background: var(--panel);
  box-shadow: 0 40px 90px -40px #000, 0 0 0 1px color-mix(in oklch, var(--accent) 8%, transparent);
}
.screen img { width: 100%; height: auto; display: block; }
.screen-glow { position: relative; }
.screen-glow::after {
  content: ''; position: absolute; inset: -1px; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 80px -20px color-mix(in oklch, var(--accent) 45%, transparent);
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, var(--bg)); }
footer .wrap { padding-block: 56px 36px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lo); margin-bottom: 16px; font-weight: 500; }
.foot-grid a { display: block; font-size: 14px; color: var(--mid); padding: 5px 0; transition: .2s; }
.foot-grid a:hover { color: var(--hi); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--lo); }
.foot-maker { display: inline-flex; align-items: center; gap: 9px; }
.foot-maker img { width: 26px; height: auto; opacity: .9; }
.foot-maker b { font-weight: 500; color: var(--mid); letter-spacing: .02em; }

/* ---------- misc ---------- */
.spec-line { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--mid); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lo); }
.kv dd { font-family: var(--mono); font-size: 13.5px; color: var(--hi); text-align: right; }

@media (max-width: 900px) {
  .nav .wrap { gap: 12px; }
  .nav-right { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 70px; left: 0; right: 0; margin-left: 0;
    background: color-mix(in oklch, var(--bg) 97%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gut) 22px;
    transform: translateY(-10px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: .24s cubic-bezier(.2,.6,.2,1);
    max-height: calc(100dvh - 70px); overflow-y: auto;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-links a:not(.m-cta) { font-family: var(--mono); font-size: 15px; color: var(--tx); padding: 15px 2px; border-bottom: 1px solid var(--line); }
  .nav-links a.active:not(.m-cta) { color: var(--hi); }
  .nav-links a.active::after { display: none; }
  .nav-links .m-cta { display: flex; justify-content: center; margin-top: 16px; padding: 14px 22px; }
  .nav-links .m-cta.btn-ghost { margin-top: 8px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .foot-grid { grid-template-columns: 1fr; gap: 22px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- vanilla tweaks panel ---------- */
.twk {
  position: fixed; right: 18px; bottom: 18px; z-index: 95; width: 268px;
  background: color-mix(in oklch, var(--raise) 92%, #000);
  border: 1px solid var(--line2); border-radius: 14px; padding: 16px;
  box-shadow: 0 24px 60px -20px #000, 0 0 0 1px color-mix(in oklch, var(--accent) 14%, transparent) inset;
  backdrop-filter: blur(12px); font-family: var(--mono);
}
.twk[hidden] { display: none; }
.twk-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.twk-hd span { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hi); font-weight: 600; }
.twk-x { background: none; border: none; color: var(--mid); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.twk-x:hover { color: var(--hi); }
.twk-sec { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lo); margin: 14px 0 9px; }
.twk-sw { display: flex; gap: 9px; }
.twk-dot { width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12); transition: .18s; }
.twk-dot:hover { transform: scale(1.08); }
.twk-dot.on { box-shadow: 0 0 0 2px var(--raise), 0 0 0 4px currentColor; }
.twk-seg { display: flex; gap: 0; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; }
.twk-seg button { flex: 1; background: transparent; border: none; border-right: 1px solid var(--line2);
  color: var(--mid); font-family: var(--mono); font-size: 11px; padding: 9px 4px; cursor: pointer; transition: .18s; }
.twk-seg button:last-child { border-right: none; }
.twk-seg button:hover { color: var(--hi); }
.twk-seg button.on { background: color-mix(in oklch, var(--accent) 22%, transparent); color: var(--hi); }
.twk-tog { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; cursor: pointer; }
.twk-tog span { font-size: 12px; color: var(--tx); }
.twk-switch { width: 40px; height: 22px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; position: relative; transition: .2s; padding: 0; }
.twk-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--mid); transition: .2s; }
.twk-switch.on { background: color-mix(in oklch, var(--accent) 40%, transparent); border-color: color-mix(in oklch, var(--accent) 50%, transparent); }
.twk-switch.on i { left: 20px; background: var(--accent-2); }
@media (max-width: 600px) { .twk { display: none; } }
