/* ============================================================
   POLYTROPOS LAB — site.css
   Aegean Gold design system, v1.0 (see Brand/design-tokens.json)
   Two lights: day (workshop) and dusk (the painted porch).
   Hand-written. No build step. No analytics.
   ============================================================ */

:root {
  /* — Aegean Gold tokens — */
  --gold-300: #E9C258;
  --gold-400: #C98A1B;
  --gold-500: #B8860B;
  --gold-600: #9C7109;
  --gold-700: #8A6508;
  --gold-800: #7A4E0C;
  --amber-deep: #A66B1F;
  --ivory-bg: #FDFBF3;
  --ivory-card: #FFFEF9;
  --ivory-sclera: #FFF9EA;
  --cream-soft: #FBF6E7;
  --cream-hover: #F5EDD8;
  --cream-active: #F8EFD4;
  --sand-border: #E6DCC3;
  --sand-divider: #F0E9D6;
  --umber: #2E2818;
  --umber-strong: #55492F;
  --umber-muted: #7A6F58;
  --umber-faint: #A39878;
  --umber-pupil: #2A1A05;
  --olive: #6B7F1F;
  --terracotta: #B3402A;
  --grad-hero: linear-gradient(135deg, #E9C258 0%, #A66B1F 100%);
  --grad-brand-text: linear-gradient(90deg, #C98A1B, #8A5A0E);
  --grad-iris: radial-gradient(circle at 40% 35%, #F2C14E, #C98A1B 55%, #7A4E0C);

  /* — semantic: day light (default) — */
  --bg: var(--ivory-bg);
  --surface: var(--ivory-card);
  --surface-soft: var(--cream-soft);
  --border: var(--sand-border);
  --divider: var(--sand-divider);
  --text: var(--umber);
  --text-strong: var(--umber-strong);
  --text-muted: var(--umber-muted);
  --link: var(--gold-700);
  --accent: var(--gold-500);
  --accent-hover: var(--gold-600);

  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Cinzel", "Marcellus", Georgia, "Times New Roman", serif;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 18px;

  --maxw: 880px;
}

/* — dusk light: gold out of darkness (Voyage, Stoa, night) — */
body.dusk {
  --bg: #1E1707;
  --surface: #271F0C;
  --surface-soft: #2E250F;
  --border: #4A3B1E;
  --divider: #3A2E15;
  --text: #F3EBD5;
  --text-strong: #FFF9EA;
  --text-muted: #C0B28C;
  --link: #E9C258;
  --accent: #C98A1B;
  --accent-hover: #E9C258;
}

/* ============ base ============ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  transition: background 400ms ease;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 64px;
}

h1, h2, h3 { line-height: 1.2; color: var(--text-strong); }
h2 { font-size: 1.35rem; margin: 2.6em 0 0.6em; }
h3 { font-size: 1.05rem; margin: 1.8em 0 0.4em; }
p  { margin: 0.7em 0; }

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

img { max-width: 100%; height: auto; }

::selection { background: var(--cream-active); color: var(--gold-700); }
body.dusk ::selection { background: #4A3B1E; color: #FFF9EA; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* display face: marketing headlines only — never body copy */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============ nav ============ */

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav .wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
  /* 44px touch target */
  min-height: 44px;
}

.nav .wordmark img { width: 30px; height: 30px; border-radius: 7px; }

.nav .wordmark span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  background: var(--grad-brand-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.dusk .nav .wordmark span {
  background: linear-gradient(90deg, #E9C258, #C98A1B);
  -webkit-background-clip: text;
  background-clip: text;
}

.nav a.navlink {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 10px 6px;            /* padded hit area */
  border-radius: var(--radius-sm);
  transition: color 180ms ease-out;
}

.nav a.navlink:hover { color: var(--link); }
.nav a.navlink[aria-current="page"] { color: var(--link); font-weight: 600; }

/* ============ meander scroll progress ============ */

.meander-progress {
  position: fixed;
  top: 0; left: 0;
  height: 8px;
  width: 0%;
  z-index: 60;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='8' viewBox='0 0 32 8'%3E%3Cpath d='M0 7 L0 1 L14 1 L14 5 L6 5 L6 3 M16 7 L16 1 L30 1 L30 5 L22 5 L22 3' fill='none' stroke='%23B8860B' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 32px 8px;
}

body.dusk .meander-progress {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='8' viewBox='0 0 32 8'%3E%3Cpath d='M0 7 L0 1 L14 1 L14 5 L6 5 L6 3 M16 7 L16 1 L30 1 L30 5 L22 5 L22 3' fill='none' stroke='%23E9C258' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* ============ hero ============ */

.hero { padding: 9vh 0 3vh; }

.hero .mark {
  width: 84px; height: 84px;
  border-radius: 19px;
  background: var(--grad-hero);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  margin: 0 0 6px;
  letter-spacing: -0.02em;   /* tighten large display text */
  line-height: 1.08;
}

.hero .tagline {
  color: var(--text-muted);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  margin: 0 0 12px;
}

.hero .lede {
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--text);
}

/* ============ cards / fleet ============ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0;
}

.fleet { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 8px; }

.fleet .card { display: flex; gap: 18px; align-items: flex-start; margin: 0; }

.fleet .card img.product-icon {
  width: 56px; height: 56px;
  border-radius: 13px;
  flex-shrink: 0;
}

.fleet .card h3 { margin: 0 0 2px; font-size: 1.1rem; }

.fleet .card .prod-tagline {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 8px;
}

.fleet .card p.desc { margin: 0 0 14px; color: var(--text); font-size: 0.97rem; }

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 180ms ease-out, border-color 180ms ease-out;
}

.btn.primary { background: var(--gold-500); color: #fff; }
.btn.primary:hover { background: var(--gold-600); color: #fff; }

.btn.secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--cream-hover); }
body.dusk .btn.secondary:hover { background: #3A2E15; }

/* ============ principles strip ============ */

.principles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 40px 0 8px;
  padding: 0;
  list-style: none;
}

.principles li {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--surface);
}

/* ============ sections ============ */

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--divider);
  padding-top: 28px;
  margin: 56px 0 14px;
}

/* ============ elsewhere / link rows ============ */

.elsewhere { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.elsewhere a { padding: 10px 2px; display: inline-block; }

/* ============ footer ============ */

footer.site {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--divider);
  color: var(--text-muted);
  font-size: 0.87rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  align-items: baseline;
}

footer.site .night-link { display: none; }
footer.site .night-link.visible { display: inline; }

/* ============ star-map intro (index only) ============ */

.sky-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at 50% 60%, #2A1A05 0%, #17110A 70%, #100B06 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 900ms ease;
}

.sky-intro.fading { opacity: 0; pointer-events: none; }

.sky-intro svg { width: min(72vw, 420px); height: auto; overflow: visible; }

.sky-intro .star {
  fill: #FFF9EA;
  opacity: 0;
  animation: star-in 700ms ease-out forwards;
}

.sky-intro .constellation-line {
  fill: none;
  stroke: #E9C258;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(233,194,88,0.55));
}

.sky-intro .skip-hint {
  position: absolute;
  bottom: 7vh;
  left: 0; right: 0;
  text-align: center;
  color: #C0B28C;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: star-in 600ms ease-out 1.2s forwards;
}

@keyframes star-in { to { opacity: 1; } }

@keyframes star-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ============ stoa entries ============ */

.stoa-entry { margin: 0 0 52px; }

.stoa-entry blockquote {
  margin: 18px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-strong);
}

.stoa-entry blockquote footer {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============ log ============ */

.log-entry { margin: 0 0 40px; }

.log-entry .log-date {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.log-entry h3 { margin: 4px 0 6px; }

.log-entry ul { margin: 8px 0 0; padding-left: 20px; color: var(--text); font-size: 0.95rem; }
.log-entry li { margin: 3px 0; }

/* ============ voyage map ============ */

.chart-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #1A1406;
  margin: 24px 0;
}

.chart-wrap svg { display: block; width: 100%; height: auto; }

/* ============ cyclops page ============ */

.eye-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 6vh;
}

.eye-stage {
  width: 132px; height: 132px;
  border-radius: 29px;   /* 22% of 132 */
  background: var(--grad-hero);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.eye-stage svg { width: 96px; height: 96px; overflow: visible; }

/* hero trust badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.badges li {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 24px;
  padding: 5px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* stat strip — specifics, not adjectives */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 44px;
  margin: 36px 0 8px;
  padding: 22px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.stats-strip .stat { min-width: 96px; }
.stats-strip .stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--gold-700);
  line-height: 1.1;
}
.stats-strip .stat span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* how it works — three steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  counter-reset: step;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step, upper-roman);
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--grad-hero);
  border-radius: 8px;
  padding: 4px 12px;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.steps li h3 { margin: 0 0 4px; font-size: 1rem; }
.steps li p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }

/* product footer nav */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin: 48px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  font-size: 0.9rem;
}
.page-nav a { padding: 8px 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.feature-grid .card { margin: 0; padding: 18px 20px; }
.feature-grid .card h3 { margin: 0 0 4px; font-size: 0.98rem; }
.feature-grid .card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.perm-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.perm-table th, .perm-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
.perm-table th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.perm-table code {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.85rem;
}

.limitations li, .faq-a { color: var(--text); }
.limitations li { margin: 6px 0; }

details.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin: 10px 0;
  padding: 0 18px;
}
details.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  color: var(--text-strong);
  list-style-position: outside;
}
details.faq[open] summary { border-bottom: 1px solid var(--divider); }
details.faq p { padding: 4px 0 14px; margin: 0; font-size: 0.95rem; }

.shot-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 18px 0;
}
.shot-frame img { display: block; }

/* fleet portrait — dark framed panel on a day page */
.portrait-frame {
  background: radial-gradient(ellipse at 50% 42%, #3A2508 0%, #1C1305 55%, #120C04 100%);
  border: 1px solid var(--gold-800);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 6vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
}
.portrait-frame figcaption {
  color: #C0B28C;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* ============ workshop section (index) ============ */

.workshop-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px 44px;
  align-items: start;
}

@media (max-width: 640px) {
  .workshop-grid { grid-template-columns: 1fr; }
}

/* the film: a portrait frame, click-to-play (loads YouTube only on demand) */
.film-frame-wrap { margin: 0; }

.film-frame {
  position: relative;
  width: min(260px, 72vw);
  aspect-ratio: 9 / 16;
  border: 1px solid var(--gold-800);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #1C1305;
}

.film-frame .film-poster { display: block; width: 100%; height: 100%; }

.film-frame .film-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.film-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(28, 19, 5, 0.72);
  border: 1.5px solid #E9C258;
  color: #FFF9EA;
  display: flex; align-items: center; justify-content: center;
  padding-left: 4px;
  animation: film-heartbeat 2.6s ease-in-out infinite;
}

.film-frame .film-poster:hover .film-play { background: rgba(122, 78, 12, 0.82); }

@keyframes film-heartbeat {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 194, 88, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(233, 194, 88, 0); }
}

.film-frame-wrap figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  max-width: 260px;
}

.film-frame-wrap .film-note { font-style: normal; font-size: 0.78rem; color: var(--umber-faint); }

/* ============ ariadne hero: the clew and its thread ============ */

.clew-stage {
  position: relative;
  width: 132px; height: 132px;
  border-radius: 29px;
  background: radial-gradient(ellipse at 45% 38%, #5C2331 0%, #33121B 70%, #240C13 100%);
  border: 1px solid var(--gold-800);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.clew-stage img { width: 88px; height: 88px; }

.clew-stage .clew-thread {
  position: absolute;
  left: 0; bottom: -58px;
  width: 132px; height: 60px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .clew-stage .clew-thread { display: none; }
}

/* ============ the tale — Homer's passage on product pages ============ */

.tale {
  margin: 18px 0;
  padding: clamp(22px, 5vw, 40px);
  border: 1px solid var(--gold-800);
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse at 50% 30%, #2E250F 0%, #1E1707 70%);
}

.tale blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  line-height: 1.65;
  color: #F3EBD5;
}

.tale blockquote p { margin: 0; }

.tale figcaption {
  margin-top: 14px;
  font-size: 0.85rem;
  font-style: italic;
  color: #C0B28C;
}

.tale figcaption a { color: #E9C258; }

/* ============ log verses — Homer's line above an entry ============ */

.log-verse {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 2px 0 6px;
  max-width: 620px;
}

.log-verse .verse-source {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.78rem;
  color: var(--umber-faint);
}

body.dusk .log-verse .verse-source { color: #7A6448; }

/* ============ 404 / night ============ */

.center-page {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

/* visually hidden, screen-reader available */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============ small screens ============ */

@media (max-width: 480px) {
  main { padding: 0 18px 48px; }
  .nav { padding: 14px 18px; gap: 8px; }
  .hero { padding-top: 5vh; }
  .fleet .card { flex-direction: column; }
  .eye-hero { gap: 18px; }
}

/* ============ motion discipline ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .sky-intro { display: none !important; }
}
