/* ══════════════════════════════════════════════════════════════════════════
   Pharos Systems — site stylesheet.

   Extends the house "Modernist" tokens used across the product UI
   (design_handoff_price_list/modernist-tokens.css): Archivo, zero radius,
   2px rules, vermilion used as a drafting mark rather than a fill. Added
   here: a dark theme, a hairline "drawing" layer for the technical plates,
   and a monospaced data face for tags, ports and identifiers.
   ══════════════════════════════════════════════════════════════════════ */

/* ── tokens ─────────────────────────────────────────────────────────────
   The bare :root block is the complete light palette. The two blocks after
   it redefine only tokens, so a component never carries a colour that
   exists in one theme alone. */
:root {
  --paper:        #f3f2f2;
  --paper-sunk:   #e9e7e7;
  --surface:      #fbfafa;
  --ink:          #201e1d;
  --ink-2:        #605d5d;
  --ink-3:        #8c8888;
  --rule:         #201e1d;
  --rule-soft:    #cfcbcb;
  --rule-hair:    #dcd9d9;
  --accent:       #ec3013;
  --accent-ink:   #ffffff;
  --accent-wash:  #fff1ee;
  --ok:           #1f6f4a;
  --warn:         #9a5b00;
  --plate:        #ffffff;
  --plate-grid:   #ecebeb;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --s12: 56px; --s16: 80px; --s20: 112px;

  --gutter: 24px;
  --measure: 66ch;
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #171615;
    --paper-sunk:  #100f0f;
    --surface:     #201e1d;
    --ink:         #f2efed;
    --ink-2:       #b0aaa7;
    --ink-3:       #837d7a;
    --rule:        #f2efed;
    --rule-soft:   #423e3c;
    --rule-hair:   #2e2b2a;
    --accent:      #ff5c40;
    --accent-ink:  #2b0b04;
    --accent-wash: #2a1310;
    --ok:          #5cc08c;
    --warn:        #d99a3d;
    --plate:       #1d1b1a;
    --plate-grid:  #2b2827;
  }
}

:root[data-theme="dark"] {
  --paper:       #171615;
  --paper-sunk:  #100f0f;
  --surface:     #201e1d;
  --ink:         #f2efed;
  --ink-2:       #b0aaa7;
  --ink-3:       #837d7a;
  --rule:        #f2efed;
  --rule-soft:   #423e3c;
  --rule-hair:   #2e2b2a;
  --accent:      #ff5c40;
  --accent-ink:  #2b0b04;
  --accent-wash: #2a1310;
  --ok:          #5cc08c;
  --warn:        #d99a3d;
  --plate:       #1d1b1a;
  --plate-grid:  #2b2827;
}

/* ── base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(38px, 6.2vw, 68px); }
h2 { font-size: clamp(27px, 3.6vw, 38px); }
h3 { font-size: clamp(19px, 2vw, 22px); letter-spacing: -0.01em; }
h4 { font-size: 16px; font-weight: 700; letter-spacing: 0; }

p { margin: 0; }
ul, ol { margin: 0; padding-inline-start: 1.1em; }
li { margin: 0 0 var(--s2); }
img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ── layout primitives ─────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--s16); border-top: 2px solid var(--rule); }
.band--tight { padding-block: var(--s12); }
.band--sunk { background: var(--paper-sunk); }
.band--flush { border-top: 0; }

.stack { display: flex; flex-direction: column; }
.stack-2 { gap: var(--s2); } .stack-3 { gap: var(--s3); }
.stack-4 { gap: var(--s4); } .stack-6 { gap: var(--s6); }
.stack-8 { gap: var(--s8); } .stack-10 { gap: var(--s10); }

.prose { max-width: var(--measure); }
.lede { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.55; }

/* ── section heads ─────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.eyebrow--quiet { color: var(--ink-3); }

.sechead { display: grid; gap: var(--s3); margin-bottom: var(--s10); }
.sechead p.lede { max-width: var(--measure); }

/* ── header ────────────────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 2px solid var(--rule);
}
.masthead__in {
  display: flex; align-items: center; gap: var(--s6);
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand__mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand__name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 18px; letter-spacing: -0.015em; line-height: 1;
}
.brand__name span { color: var(--ink-3); font-weight: 600; }

.nav { display: flex; align-items: center; gap: var(--s5); margin-inline-start: auto; }
/* Greek labels are longer than the English ones; a nav item that
   breaks mid-phrase reads as a layout fault, so items stay whole and the whole
   bar collapses to the disclosure instead. */
.nav a, .masthead .btn { white-space: nowrap; }
.nav a:not(.btn) {
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink-2); padding-block: 4px;
  border-bottom: 2px solid transparent;
}
.nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a:not(.btn)[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.navtoggle {
  display: none; margin-inline-start: auto;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; background: none; color: var(--ink);
  border: 1px solid var(--rule-soft); padding: 8px 12px; cursor: pointer;
}

@media (max-width: 1240px) {
  .navtoggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 66px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 2px solid var(--rule);
    padding: var(--s2) var(--gutter) var(--s4);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a:not(.btn) { padding-block: 12px; border-bottom: 1px solid var(--rule-hair); }
  .nav .btn { margin-top: var(--s3); }
}

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  line-height: 1; letter-spacing: 0.01em;
  padding: 13px 20px; border: 2px solid var(--rule); border-radius: 0;
  background: transparent; color: var(--ink); text-decoration: none;
  cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--ghost { border-color: var(--rule-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ── hero ──────────────────────────────────────────────────────────── */
.hero { padding-block: var(--s16) var(--s12); }
.hero h1 { margin-bottom: var(--s5); }
.hero__grid {
  display: grid; gap: var(--s10);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1000px) { .hero__grid { grid-template-columns: 1fr; gap: var(--s8); } }

/* ── spec strip: a run of label/value pairs on one baseline ────────── */
.specstrip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule);
}
.specstrip > div {
  padding-block: var(--s5);
  padding-inline: var(--s4);
  border-inline-start: 1px solid var(--rule-hair);
}
.specstrip > div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.specstrip dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}
.specstrip dd {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: 15px; line-height: 1.3; font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .specstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specstrip > div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .specstrip > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule-hair); }
}

/* ── the drawing plate ─────────────────────────────────────────────── */
.plate {
  background: var(--plate);
  border: 2px solid var(--rule);
  padding: var(--s6);
}
.plate__head {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--rule-hair);
  padding-bottom: var(--s3); margin-bottom: var(--s5);
}
.plate__figure { overflow-x: auto; direction: ltr; }
.plate__figure svg { min-width: 560px; width: 100%; height: auto; }
.plate figcaption {
  margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--rule-hair);
  font-size: 13.5px; color: var(--ink-2); max-width: 72ch;
}

/* ── the premise: three claims, hung off hairlines ─────────────────── */
.claims { display: grid; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.claims > div {
  padding: var(--s6);
  border-inline-start: 1px solid var(--rule-hair);
}
.claims > div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.claims h3 { margin-bottom: var(--s3); }
.claims .n {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  color: var(--accent); display: block; margin-bottom: var(--s3);
}
@media (max-width: 860px) {
  .claims { grid-template-columns: 1fr; }
  .claims > div { border-inline-start: 0; padding: var(--s6) 0; border-top: 1px solid var(--rule-hair); }
  .claims > div:first-child { border-top: 0; padding-top: 0; }
}

/* ── spec table ────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; border-top: 2px solid var(--rule); }
table.spec { width: 100%; border-collapse: collapse; min-width: 620px; }
table.spec th, table.spec td {
  text-align: start; vertical-align: top;
  padding-block: var(--s4); padding-inline: 0 var(--s4);
  border-bottom: 1px solid var(--rule-hair);
}
table.spec th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  padding-block: var(--s3); border-bottom: 1px solid var(--rule-soft);
}
table.spec td:first-child { font-weight: 700; white-space: nowrap; padding-inline-end: var(--s6); }
table.spec td.mono {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.spec tr:last-child td { border-bottom: 0; }
/* Descriptive values rather than identifiers — let them wrap. */
table.spec--soft td.mono { white-space: normal; }

/* ── audience split ────────────────────────────────────────────────── */
/* Grid children must be allowed to shrink below their content: a nowrap
   spec cell inside a panel otherwise widens the whole track and takes the
   page past the viewport. The tables scroll in their own container instead. */
.split > *, .kv > *, .claims > *, .hero__grid > *, .foot__grid > *,
.specstrip > * { min-width: 0; }

.split { display: grid; gap: var(--s10); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--s8); } }

.panel {
  display: flex; flex-direction: column; gap: var(--s4);
  border-top: 2px solid var(--rule); padding-top: var(--s5);
}
.panel h3 { margin-bottom: 0; }
.panel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.panel ul li {
  margin: 0; padding-inline-start: 22px; position: relative; font-size: 15px; line-height: 1.5;
}
.panel ul li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 9px;
  width: 10px; height: 2px; background: var(--accent);
}
.panel .btn { align-self: flex-start; margin-top: auto; }

/* ── numbered sequence (used only where order is real) ─────────────── */
.seq { display: grid; gap: 0; counter-reset: step; border-top: 1px solid var(--rule-hair); }
.seq > li {
  list-style: none; margin: 0; display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--s5); padding: var(--s5) 0;
  border-bottom: 1px solid var(--rule-hair);
}
.seq > li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  color: var(--accent); padding-top: 4px;
  grid-column: 1; grid-row: 1;
}
/* Every real child sits in the text column; the counter keeps column one to
   itself. Without this an <li> holding a heading and a paragraph puts the
   paragraph back under the number. */
.seq > li > * { grid-column: 2; }
.seq h4 { margin-bottom: 4px; }
.seq p { color: var(--ink-2); font-size: 15px; }
.seq ul { padding: 0; }
@media (max-width: 620px) {
  .seq > li { grid-template-columns: 36px minmax(0, 1fr); gap: var(--s4); }
}

/* ── note / callout ────────────────────────────────────────────────── */
.note {
  border-inline-start: 2px solid var(--accent);
  background: var(--accent-wash);
  padding: var(--s5) var(--s6);
  font-size: 15px;
}
.note strong { font-weight: 700; }
.note--plain { background: var(--surface); border-inline-start-color: var(--rule-soft); }

/* ── key/value definition grid ─────────────────────────────────────── */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.kv > div {
  padding-block: var(--s5);
  padding-inline: 0 var(--s6);
  border-top: 1px solid var(--rule-hair);
}
.kv > div:nth-child(odd) { padding-inline-end: var(--s8); }
.kv h4 { margin-bottom: 6px; }
.kv p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 780px) { .kv { grid-template-columns: 1fr; } .kv > div { padding-inline-end: 0; } }

/* ── quote / thesis line ───────────────────────────────────────────── */
.thesis {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(24px, 3.4vw, 36px); line-height: 1.16;
  letter-spacing: -0.02em; text-wrap: balance; max-width: 22ch;
}

/* ── CTA band ──────────────────────────────────────────────────────── */
.cta { background: var(--ink); color: var(--paper); border-top: 2px solid var(--rule); }
.cta h2 { color: var(--paper); }
.cta p { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.cta .btn { border-color: var(--paper); color: var(--paper); }
.cta .btn:hover { background: var(--paper); color: var(--ink); }
.cta .btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cta .btn--primary:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ── form ──────────────────────────────────────────────────────────── */
.form { display: grid; gap: var(--s5); }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 700px) { .form .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-soft);
  border-radius: 0; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}

/* ── footer ────────────────────────────────────────────────────────── */
.foot { border-top: 2px solid var(--rule); padding-block: var(--s10) var(--s8); }
.foot__grid {
  display: grid; gap: var(--s8);
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) { .foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .foot__grid { grid-template-columns: 1fr; } }
.foot h5 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 var(--s3);
}
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot ul li { margin: 0; }
.foot a { font-size: 14px; text-decoration: none; color: var(--ink-2); }
.foot a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.foot__base {
  margin-top: var(--s10); padding-top: var(--s5);
  border-top: 1px solid var(--rule-hair);
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

/* ── theme toggle ──────────────────────────────────────────────────── */
.themebtn {
  background: none; border: 1px solid var(--rule-soft); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; padding: 7px 10px; cursor: pointer; border-radius: 0;
}
.themebtn:hover { color: var(--ink); border-color: var(--rule); }

/* ── misc ──────────────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule-soft); padding: 4px 8px; color: var(--ink-2);
}
.skip {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; z-index: 100;
}
.skip:focus { inset-inline-start: var(--gutter); top: 8px; }

/* ══════════════════════════════════════════════════════════════════════════
   Greek

   Archivo carries no Greek, so Greek takes the IBM Plex face that does — the
   same family the data labels already use in both languages, which is what
   keeps the two from looking like two different companies. Everything else —
   the palette, the rules, the zero radius — is shared.

   The layout is written in logical properties (padding-inline-start,
   border-inline-start, inset-inline-start, text-align: start) rather than
   left/right. Nothing here needs that today, but it costs nothing and it is
   what a right-to-left language would need, so it stays.
   ══════════════════════════════════════════════════════════════════════ */

:root[lang="el"] {
  --font-display: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

/* Plex tops out at 700 where Archivo goes to 800, and the two read at the
   same weight on the page. */
[lang="el"] h1, [lang="el"] h2, [lang="el"] h3, [lang="el"] h4,
[lang="el"] .thesis,
[lang="el"] .btn,
[lang="el"] .brand__name { font-weight: 700; }

/* Plex Sans is a touch wider than Archivo at display sizes, so the headline
   tracking eases off. */
[lang="el"] h1, [lang="el"] h2, [lang="el"] .thesis { letter-spacing: -0.01em; }

/* ── language switcher ─────────────────────────────────────────────────
   Short links rather than a dropdown: a reader who wants another language
   should not have to discover a control first. */
.langpick { display: flex; align-items: center; gap: 2px; }
.langpick a {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  color: var(--ink-3); padding: 7px 8px; border: 1px solid transparent;
  line-height: 1;
}
.langpick a:hover { color: var(--ink); border-color: var(--rule-soft); }
.langpick a[aria-current="true"] {
  color: var(--ink); border-color: var(--rule-soft); background: var(--surface);
}
@media (max-width: 1240px) {
  .langpick { padding-block: var(--s3); gap: var(--s2); }
  .langpick a { padding: 9px 12px; border-color: var(--rule-soft); }
}
