/* =====================================================================
   S.O.F.I.E Systems — Terracare Ecosystem website
   Design language: deep black glass + liquid gold (matches Oriana product)
   No external requests (fonts/CDNs) — fully portable, host anywhere,
   works offline on a Hivegrid node. Single shared stylesheet.
   ===================================================================== */

:root {
  /* 8-stop gold spectrum (from the Oriana product) */
  --gold-100: #FFE7A3;
  --gold-200: #FFD166;
  --gold-300: #F5C13D;
  --gold-400: #F5A623;
  --gold-500: #D4AF37;   /* primary brand gold */
  --gold-600: #C8860A;
  --gold-700: #9A6407;
  --gold-800: #5E3D04;

  --ink-on-gold: #1A1200;

  /* warm near-black glass spectrum */
  --bg:        #080600;
  --bg-2:      #0E0A02;
  --panel:     rgba(255, 224, 150, 0.045);
  --panel-2:   rgba(255, 224, 150, 0.075);
  --stroke:    rgba(255, 209, 102, 0.14);
  --stroke-2:  rgba(255, 209, 102, 0.28);

  --text:      #F4ECD8;
  --text-soft: #C9BE9E;
  --text-mute: #8A7F63;

  --grad-gold: linear-gradient(135deg, #FFD166 0%, #F5A623 38%, #D4AF37 68%, #C8860A 100%);
  --grad-ink:  radial-gradient(1200px 600px at 50% -10%, rgba(213,175,55,0.16), transparent 60%);

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1160px;

  --t-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.5s  cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    var(--grad-ink),
    radial-gradient(900px 500px at 90% 10%, rgba(200,134,10,0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint hexagon mesh motif (HoloHive) behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'><path d='M28 0l24 14v28L28 56 4 42V14z' fill='none' stroke='%23D4AF37' stroke-opacity='0.05' stroke-width='1'/><path d='M28 48l24 14v28L28 104 4 90V62z' fill='none' stroke='%23D4AF37' stroke-opacity='0.05' stroke-width='1'/></svg>");
}

/* animated HoloHive hex mesh canvas (hexmesh.js) — sits above the static
   fallback mesh, below content. Transparent so the css mesh shows through. */
.hexmesh {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  opacity: 0.55;
}

.wrap { position: relative; z-index: 1; }

a { color: var(--gold-300); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold-200); }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- shared type ---- */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 750; }
h3 { font-size: 1.18rem; font-weight: 700; }

.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  font-family: var(--mono);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-500);
  margin: 0 0 14px;
}
.lead { font-size: clamp(1.05rem, 1.7vw, 1.28rem); color: var(--text-soft); max-width: 60ch; }
.muted { color: var(--text-mute); }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: rgba(8,6,0,0.6);
  border-bottom: 1px solid var(--stroke);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; font-size: 1.12rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  background: var(--grad-gold); border-radius: 9px;
  color: var(--ink-on-gold); font-size: 1rem;
  box-shadow: 0 4px 18px rgba(213,175,55,0.35);
}
.brand small { display: block; font-weight: 500; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-600); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-soft); font-size: .92rem; font-weight: 550;
  padding: 8px 12px; border-radius: 9px; transition: all var(--t-fast);
}
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.active { color: var(--gold-300); }

.nav-toggle { display: none; background: none; border: 1px solid var(--stroke-2); color: var(--gold-300);
  width: 42px; height: 38px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: .96rem; cursor: pointer;
  padding: 13px 24px; border-radius: 12px; border: 1px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.btn-gold { background: var(--grad-gold); color: var(--ink-on-gold); box-shadow: 0 8px 26px rgba(213,175,55,0.30); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(213,175,55,0.44); color: var(--ink-on-gold); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--stroke-2); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--panel-2); color: var(--text); }

/* ---- hero ---- */
.hero { padding: clamp(56px, 11vw, 128px) 0 clamp(40px, 7vw, 84px); text-align: center; }
.hero .lead { margin: 22px auto 0; text-align: center; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.badge {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .05em;
  color: var(--text-soft); padding: 7px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--stroke);
}
.badge b { color: var(--gold-300); font-weight: 700; }

/* ---- sections ---- */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-alt { background: linear-gradient(180deg, rgba(213,175,55,0.03), transparent); border-block: 1px solid var(--stroke); }

/* ---- card grid ---- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform var(--t-normal), border-color var(--t-normal), background var(--t-normal);
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--stroke-2); background: var(--panel-2); }
.card .ico { font-size: 1.7rem; margin-bottom: 14px; display: block; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-soft); font-size: .96rem; margin: 0; }
.card .tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-600); }

/* linked ecosystem card */
a.card { color: var(--text); }
a.card:hover { color: var(--text); }
a.card .more { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: .78rem; color: var(--gold-300); letter-spacing: .04em; }
a.card:hover .more { color: var(--gold-200); }
a.card::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--t-normal);
}
a.card:hover::after { box-shadow: inset 0 0 0 1px var(--stroke-2), 0 0 40px rgba(213,175,55,0.06); }

/* ---- layered model diagram ---- */
.layers { display: grid; gap: 14px; max-width: 720px; margin: 0 auto; }
.layer {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 24px; border-radius: var(--radius);
  border: 1px solid var(--stroke); background: var(--panel);
}
.layer .n { font-family: var(--mono); font-size: .72rem; color: var(--ink-on-gold);
  background: var(--grad-gold); padding: 4px 10px; border-radius: 999px; font-weight: 700; }
.layer h3 { margin: 0 0 3px; }
.layer p { margin: 0; color: var(--text-soft); font-size: .92rem; }
.layer .arrow { text-align: center; color: var(--gold-600); font-size: 1.2rem; }

/* ---- stat strip ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.stat .lbl { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }

/* ---- feature list ---- */
.flist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.flist li { display: flex; gap: 13px; align-items: flex-start; color: var(--text-soft); }
.flist li::before { content: "◈"; color: var(--gold-500); flex: 0 0 auto; margin-top: 1px; }
.flist li b { color: var(--text); font-weight: 650; }

/* ---- callout ---- */
.callout {
  border: 1px solid var(--stroke-2); border-radius: var(--radius);
  padding: 30px; background: linear-gradient(135deg, rgba(213,175,55,0.08), rgba(200,134,10,0.02));
  text-align: center;
}

/* ---- SOFIE brand logo ---- */
.sofie-logo {
  width: clamp(210px, 34vw, 340px); height: auto; display: block;
  margin: 4px auto 20px; border-radius: 50%;
  box-shadow: 0 0 70px rgba(213,175,55,0.30), 0 0 0 1px var(--stroke-2);
}
.sofie-tagline {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-500); margin: 0 0 26px;
}

/* ---- page hero (interior pages) ---- */
.page-hero { padding: clamp(48px, 8vw, 92px) 0 clamp(28px, 4vw, 44px); }
.page-hero .eyebrow { margin-bottom: 10px; }
.breadcrumb { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); margin-bottom: 22px; letter-spacing: .05em; }
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--gold-300); }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--stroke); margin-top: 40px; padding: 54px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer h4 { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.footer a { color: var(--text-soft); font-size: .92rem; }
.footer a:hover { color: var(--gold-300); }
.footer .fbrand p { color: var(--text-mute); font-size: .9rem; max-width: 34ch; margin: 12px 0 0; }
.footer-base { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--stroke);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-mute); font-family: var(--mono); letter-spacing: .03em; }

/* ---- scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- interest form ---- */
.form { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-600); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; font: inherit; font-size: .95rem;
  color: var(--text); background: var(--panel); border: 1px solid var(--stroke-2);
  transition: border-color var(--t-fast), background var(--t-fast); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-500); background: var(--panel-2); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); opacity: .7; }
.field textarea { resize: vertical; min-height: 118px; }
.field select option { background: #14100a; color: var(--text); }
.form-note { font-size: .84rem; color: var(--text-mute); line-height: 1.6; }

/* ---- legal documents (generated pages) ---- */
.legal { max-width: 780px; margin: 0 auto; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 6px; }
.legal h2 { font-size: 1.35rem; margin: 42px 0 12px; padding-top: 18px;
            border-top: 1px solid var(--stroke); color: var(--text); }
.legal h3 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--gold-300); }
.legal p, .legal li { color: var(--text-soft); line-height: 1.75; }
.legal ul, .legal ol { padding-left: 22px; margin: 12px 0; }
.legal li { margin: 7px 0; }
.legal a { color: var(--gold-300); }
.legal hr { border: 0; border-top: 1px solid var(--stroke); margin: 34px 0; }
.legal code { font-family: var(--mono); font-size: .86em; background: var(--panel);
              padding: 2px 6px; border-radius: 6px; color: var(--gold-200); }
.legal blockquote { margin: 22px 0; padding: 18px 20px; border-left: 3px solid var(--gold-500);
                    background: var(--panel); border-radius: 0 12px 12px 0; }
.legal blockquote p { margin: 0 0 10px; color: var(--text); }
.legal blockquote p:last-child { margin-bottom: 0; }

/* Wide tables must scroll inside their own box — the page body never scrolls sideways. */
.legal .table-wrap { overflow-x: auto; margin: 16px 0; }
.legal table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .93rem; }
.legal th, .legal td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--stroke);
                       vertical-align: top; color: var(--text-soft); }
.legal th { color: var(--gold-600); font-family: var(--mono); font-size: .72rem;
            letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

.legal-draft { border: 1px solid var(--gold-500); background: rgba(255,209,102,0.07);
               border-radius: 14px; padding: 16px 18px; margin-bottom: 30px;
               color: var(--text); font-size: .95rem; line-height: 1.6; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 2px; padding: 14px 22px 22px; background: rgba(8,6,0,0.96);
    backdrop-filter: blur(18px); border-bottom: 1px solid var(--stroke);
    transform: translateY(-140%); transition: transform var(--t-normal); }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 12px 14px; border-radius: 10px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
