/* =========================================================
   FlexiClaw shared stylesheet
   Core tokens + base type + nav + footer.
   Used by all public pages as the shared visual foundation.
========================================================= */

:root{
  --bg:          oklch(0.17 0.012 60);
  --bg-2:        oklch(0.21 0.014 65);
  --bg-3:        oklch(0.24 0.015 65);
  --ink:         oklch(0.96 0.012 85);
  --ink-dim:     oklch(0.78 0.012 80);
  --ink-mute:    oklch(0.58 0.010 75);
  --rule:        oklch(0.34 0.012 70);
  --rule-soft:   oklch(0.28 0.010 70);

  --amber:       oklch(0.82 0.16 78);
  --amber-deep:  oklch(0.70 0.16 65);
  --amber-soft:  oklch(0.82 0.16 78 / 0.12);

  --ok:          oklch(0.80 0.14 155);
  --warn:        oklch(0.78 0.16 50);
  --danger:      oklch(0.70 0.18 28);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Fraunces", ui-serif, Georgia, serif;

  --maxw: 1280px;
  --gutter: 32px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- layout ---------- */
.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.section{ position: relative; border-top: 1px solid var(--rule-soft); }
.section:first-of-type{ border-top: 0; }

/* ---------- type ---------- */
h1,h2,h3,h4,h5,h6{ margin:0; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
a{ color: var(--amber); text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

.eyebrow{
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute);
}
.eyebrow .dot{ color: var(--amber); margin-right: 8px; }

.h-display{
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.98; letter-spacing: -0.035em;
}
.h-display .soft{ color: var(--ink-dim); }
.h-display .accent{ color: var(--amber); }

.h-section{
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.02; letter-spacing: -0.03em;
}
.h-sub{
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5;
  color: var(--ink-dim); max-width: 62ch;
}
.kicker{
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-mute);
}
.num{ font-family: var(--mono); color: var(--ink-mute); font-size: 12px; letter-spacing: .08em; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap: 10px;
  padding: 12px 18px; border-radius: 2px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration:none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ border-color: var(--amber); color: var(--amber); text-decoration:none; }
.btn.primary{
  background: var(--amber); color: #1a1410; border-color: var(--amber);
  font-weight: 600;
}
.btn.primary:hover{ background: color-mix(in oklab, var(--amber) 85%, white); transform: translateY(-1px); }
.btn .arr{ transition: transform .2s ease; }
.btn:hover .arr{ transform: translateX(3px); }

/* ---------- NAV ---------- */
nav.topnav{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--rule-soft);
}
nav.topnav .inner{
  display:flex; align-items:center; justify-content:space-between;
  height: 56px;
}
.brand{ display:flex; align-items:center; gap:10px; font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover{ text-decoration: none; }
.brand .logo{ width: 22px; height: 22px; position: relative; }
.brand .logo svg{ display:block; }
.brand .name{ font-size: 15px; }
.brand .name .tld{ color: var(--ink-mute); font-weight: 400; }
.nav-links{ display:flex; gap: 22px; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.nav-links a{ color: inherit; text-decoration: none; }
.nav-links a:hover{ color: var(--amber); text-decoration:none; }
.nav-links a.active{ color: var(--amber); }
.nav-right{ display:flex; gap: 10px; align-items:center; }
.nav-right .ver{
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute);
  padding: 4px 8px; border: 1px solid var(--rule-soft); border-radius: 2px;
}

/* ---------- section-head helper (shared with landing) ---------- */
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  padding: 20px 0; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute);
}
.section-head .tag{ color: var(--amber); }
.section-head .tag::before{ content:"●"; margin-right: 8px; color: var(--amber); }

/* ---------- global textures ---------- */
.grid-bg{
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--rule-soft) 55%, transparent) 1px, transparent 1px);
  background-size: calc((100% - 2*var(--gutter)) / 12) 100%;
  background-position: var(--gutter) 0;
  mask-image: linear-gradient(to bottom, black, black 70%, transparent);
  pointer-events: none;
  opacity: .35;
}
.noise{
  position:absolute;inset:0;pointer-events:none;opacity:.045;mix-blend-mode:overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.has-ambient-fx{
  position: relative;
  overflow: hidden;
}
.has-ambient-fx > .grid-bg,
.has-ambient-fx > .noise{
  z-index: 0;
}
.has-ambient-fx > .wrap{
  position: relative;
  z-index: 2;
}
.ambient-fx{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: .58;
  mix-blend-mode: screen;
}
.ambient-fx[data-ambient-fx="scan"]{
  opacity: .44;
}
.ambient-sweep{
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--amber) 82%, white), transparent);
  opacity: .42;
  pointer-events: none;
  animation: ambientSweep 7s linear infinite;
}
@keyframes ambientSweep{
  0%{ transform: translateX(-42%); opacity: 0; }
  18%, 82%{ opacity: .46; }
  100%{ transform: translateX(42%); opacity: 0; }
}

/* ---------- FOOTER ---------- */
footer{
  border-top: 1px solid var(--rule-soft); padding: 40px 0 48px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-mute);
  margin-top: 80px;
}
.foot{ display:grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.foot h6{ color: var(--ink-dim); font-weight: 500; margin: 0 0 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.foot a{ color: var(--ink-mute); text-decoration: none; display:block; padding: 4px 0; }
.foot a:hover{ color: var(--amber); text-decoration: none; }
.foot-bottom{
  margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule-soft);
  display:flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}

@media (max-width: 900px){
  .foot{ grid-template-columns: 1fr 1fr; }
  nav.topnav .inner{
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 9px;
  }
  .brand{
    min-width: 0;
  }
  .brand .name{
    font-size: 14px;
  }
  .nav-right{
    margin-left: auto;
  }
  .nav-right > :not(.ver){
    display: none !important;
  }
  .nav-right .ver{
    font-size: 10px;
  }
  .nav-links{
    order: 3;
    display: flex;
    flex: 0 0 100%;
    max-width: 100%;
    gap: 18px;
    overflow-x: auto;
    border-top: 1px solid var(--rule-soft);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar{
    display: none;
  }
  .nav-links a{
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 4px 0;
    white-space: nowrap;
  }
  .nav-links a.active{
    position: relative;
  }
  .nav-links a.active::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--amber);
  }
}
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; }
  .ambient-fx,
  .ambient-sweep{ display: none; }
}
