/*
Theme Name: Ternative
Theme URI: https://github.com/michelangeloromerochisco/ternative
Author: Ternative
Author URI: https://huggingface.co/MicheRomChis/orchid-1.0
Description: Marketing site for Ternative — open-source AI for consumer hardware. Near-black with a golden-yellow accent and a pixel/ternary motif. Ships a custom front page plus Orchid, Engine, Download and About page templates. Apache-2.0.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Apache License 2.0
License URI: https://www.apache.org/licenses/LICENSE-2.0
Text Domain: ternative
*/

/* ============================================================
   TERNATIVE — shared stylesheet
   Near-black · white · golden-yellow accent · pixel/ternary motif
   Type: Geist (grotesque) + Geist Mono (technical)
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #0b0b0d;
  --bg-2:      #101012;
  --surface:   #141417;
  --surface-2: #1a1a1e;
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.16);

  /* text */
  --ink:       #f4f4f3;
  --ink-soft:  #b9b9bd;
  --ink-mute:  #76767d;
  --ink-faint: #4a4a51;

  /* accent — sampled from the Orchid pixel logo */
  --yellow:    #f5c518;
  --yellow-br: #ffd84a;
  --yellow-dk: #caa00d;
  /* logo secondaries — used VERY sparingly for data only */
  --pix-blue:  #1f55b0;
  --pix-red:   #d8242c;
  --pix-green: #2ea84f;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 56px);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Geist", "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint pixel grid texture */
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  background-position: center top;
}

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

::selection { background: var(--yellow); color: #1a1500; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: clamp(64px, 10vw, 132px); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.04; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.h-display { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 620; letter-spacing: -0.045em; }
.h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); letter-spacing: -0.02em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.lead { font-size: clamp(1.12rem, 1.7vw, 1.4rem); color: var(--ink-soft); line-height: 1.5; letter-spacing: -0.015em; }
.muted { color: var(--ink-mute); }
.soft  { color: var(--ink-soft); }
strong { font-weight: 600; color: var(--ink); }

/* monospace eyebrow / label */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 0.6em;
  margin: 0 0 1.2rem;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; background: var(--yellow);
  display: inline-block;
}
.mono { font-family: var(--mono); }
.hl { color: var(--yellow); }

/* ---------- buttons ---------- */
.btn {
  --bh: #fff;
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--sans); font-size: 0.96rem; font-weight: 540;
  letter-spacing: -0.01em;
  padding: 0.72em 1.25em; border-radius: var(--r-md);
  border: 1px solid var(--line-2); color: var(--ink); cursor: pointer;
  background: transparent; transition: 140ms ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-soft); background: rgba(255,255,255,0.04); }
.btn svg { width: 1.05em; height: 1.05em; }
.btn--primary {
  background: var(--yellow); color: #1a1500; border-color: var(--yellow);
  font-weight: 600;
}
.btn--primary:hover { background: var(--yellow-br); border-color: var(--yellow-br); }
.btn--ghost { border-color: transparent; padding-inline: 0.3em; }
.btn--ghost:hover { background: transparent; color: var(--yellow); }
.btn--lg { font-size: 1.04rem; padding: 0.9em 1.5em; }
.arrow { transition: transform 160ms ease; }
.btn:hover .arrow, a:hover .arrow { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { display: inline-grid; grid-template-columns: repeat(3, 7px); gap: 2px; }
.brand__mark i { width: 7px; height: 7px; display: block; background: var(--ink-faint); }
.brand__mark i:nth-child(2) { background: var(--ink-soft); }
.brand__mark i:nth-child(3) { background: var(--yellow); }
.brand__name { font-weight: 600; font-size: 1.06rem; letter-spacing: -0.03em; }
.brand__name b { font-weight: 600; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  font-size: 0.93rem; color: var(--ink-soft); padding: 8px 13px; border-radius: 8px;
  transition: 120ms; letter-spacing: -0.01em;
}
.nav__links a:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::after { content: ""; }
.nav__cta { margin-left: 10px; }
.nav__burger { display: none; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 12px var(--pad) 22px; gap: 2px;
  }
  .nav__links.open a { padding: 12px 10px; font-size: 1.05rem; }
  .nav__cta { display: none; }
  .nav__burger {
    display: inline-flex; flex-direction: column; gap: 4px; cursor: pointer;
    background: none; border: 0; padding: 8px;
  }
  .nav__burger span { width: 20px; height: 2px; background: var(--ink); display: block; }
}

/* ---------- pixel orchid mark ---------- */
.pixel-orchid { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 420px at 78% 18%, rgba(245,197,24,0.10), transparent 70%);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em;
  color: var(--ink-soft); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 100px; background: var(--surface);
}
.tag b { color: var(--yellow); font-weight: 500; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px;
  transition: 160ms ease;
}
.card--link:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.card__k { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }

/* stat */
.stat__n { font-size: clamp(2.2rem, 4vw, 3.1rem); font-weight: 620; letter-spacing: -0.04em; line-height: 1; }
.stat__n .unit { font-size: 0.42em; color: var(--ink-mute); font-weight: 500; letter-spacing: -0.01em; }
.stat__l { color: var(--ink-mute); font-size: 0.93rem; margin-top: 0.5rem; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 520px; }
table.data th, table.data td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
table.data thead th {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 500; background: var(--bg-2);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.hl-row td { background: rgba(245,197,24,0.06); }
table.data tr.hl-row td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.cell-yes { color: var(--pix-green); }
.cell-no  { color: var(--ink-faint); }
.cell-warn { color: var(--yellow); }
.delta-up { color: var(--pix-green); font-family: var(--mono); }
.delta-dn { color: var(--ink-mute); font-family: var(--mono); }

/* ---------- benchmark bars ---------- */
.bars { display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: 180px 1fr 64px; align-items: center; gap: 16px; }
.bar__lbl { font-size: 0.92rem; color: var(--ink-soft); }
.bar__lbl b { color: var(--ink); font-weight: 600; }
.bar__track { height: 12px; background: var(--surface-2); border-radius: 100px; overflow: hidden; border: 1px solid var(--line); }
.bar__fill { height: 100%; background: var(--ink-faint); border-radius: 100px; }
.bar__fill.is-orchid { background: var(--yellow); }
.bar__val { font-family: var(--mono); font-size: 0.9rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.bar.is-orchid .bar__val, .bar.is-orchid .bar__lbl b { color: var(--yellow); }
@media (max-width: 620px) { .bar { grid-template-columns: 110px 1fr 52px; gap: 10px; } .bar__lbl { font-size: 0.82rem; } }

/* ---------- code block ---------- */
.code {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.7;
  color: var(--ink-soft); overflow-x: auto;
}
.code__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.code__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-2); }
.code__name { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-mute); margin-left: 6px; letter-spacing: 0.04em; }
.code pre { margin: 0; padding: 18px 20px; }
.code .c-com { color: var(--ink-faint); }
.code .c-cmd { color: var(--ink); }
.code .c-arg { color: var(--yellow); }

/* ---------- pill / chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 100px; border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--surface);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.dot--green { background: var(--pix-green); }

/* ternary triad motif */
.ternary { display: inline-flex; gap: 5px; align-items: center; }
.ternary i {
  width: 22px; height: 22px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600;
  border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-mute);
}
.ternary i.on { background: var(--yellow); color: #1a1500; border-color: var(--yellow); }

/* ---------- links hub ---------- */
.linkrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px; border-bottom: 1px solid var(--line); transition: 130ms;
}
.linkrow:hover { padding-inline: 14px 0; }
.linkrow:hover .linkrow__t { color: var(--yellow); }
.linkrow__t { font-size: 1.18rem; font-weight: 560; letter-spacing: -0.02em; transition: 130ms; }
.linkrow__m { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-mute); }
.linkrow__d { color: var(--ink-mute); font-size: 0.92rem; max-width: 46ch; }

/* ---------- image placeholder ---------- */
.ph {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background-color: var(--bg-2);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 10px, transparent 10px 20px);
  display: grid; place-items: center; text-align: center;
  color: var(--ink-mute); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em;
  min-height: 240px; padding: 24px;
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); }
.foot__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-block: 56px; }
.foot h5 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); margin: 0 0 16px; font-weight: 500; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot a { color: var(--ink-soft); font-size: 0.93rem; }
.foot a:hover { color: var(--yellow); }
.foot__bottom { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding-block: 22px; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: 0.84rem; font-family: var(--mono); }
@media (max-width: 760px) { .foot__top { grid-template-columns: 1fr 1fr; gap: 28px; } }

/* utilities */
.flex { display: flex; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap-g { flex-wrap: wrap; }
.gap-s { gap: 10px; } .gap-m { gap: 18px; } .gap-l { gap: 28px; }
.col { display: flex; flex-direction: column; }
.mt-s { margin-top: 12px; } .mt-m { margin-top: 24px; } .mt-l { margin-top: 44px; }
.mb-m { margin-bottom: 24px; } .mb-l { margin-bottom: 44px; }
.maxch { max-width: 62ch; }
.maxch-s { max-width: 48ch; }
.fade-up { opacity: 0; transform: translateY(16px); transition: 620ms cubic-bezier(.2,.7,.2,1); }
.fade-up.in { opacity: 1; transform: none; }
