/* ============================================================
   Jaybird Labs — "research diorama" design system
   Warm low-poly theme. One-accent discipline (terracotta).
   ============================================================ */

:root {
  /* Surfaces & ink */
  --bg: #f5eee3;
  --halo: #efe4d2;
  --ink: #2c2a26;
  --ink-soft: #5f5a51;
  --mute: #8a8378;
  --line: rgba(44, 42, 38, .12);

  /* Single accent (terracotta) + ramp */
  --accent: #e2823c;
  --accent-deep: #b45f22;
  --accent-light: #f0a85a;

  /* Diorama art fills */
  --green-1: #a9d182;
  --green-2: #8db95f;
  --green-3: #9ecf73;
  --green-4: #94bd69;
  --brown-1: #a6743f;
  --brown-2: #8a5a30;
  --brown-3: #6b4a2e;
  --stone-1: #c9c0b0;
  --stone-2: #a89e8c;
  --stone-3: #8f8674;

  /* Type */
  --display: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
.kicker .a { color: var(--accent); }

/* ---------- Nav ---------- */
nav.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.links { display: flex; gap: 26px; align-items: center; }
.links a {
  color: var(--mute);
  font-family: var(--mono);
  font-size: 13px;
  transition: color .2s;
}
.links a:hover { color: var(--ink); }
.links a.active { color: var(--accent); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  font-family: var(--mono);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 32px;
  align-items: center;
  padding: 64px 0 56px;
}
.hero .kicker { display: block; margin-bottom: 22px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 1.03;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 17px; color: var(--ink-soft); max-width: 46ch; margin-bottom: 30px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 20px;
}
.diorama { width: 100%; height: auto; display: block; overflow: visible; }
#float { animation: bob 6s ease-in-out infinite; transform-origin: center; }
#shadow { animation: sh 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes sh { 0%, 100% { transform: scaleX(1); opacity: .16; } 50% { transform: scaleX(.9); opacity: .1; } }

/* ---------- Sections ---------- */
section.band { padding: 70px 0; border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 18px; }
.sec-head .kicker { display: block; margin-bottom: 10px; }
.sec-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -.01em;
}
.lead { font-size: 18px; color: var(--ink-soft); max-width: 62ch; margin-bottom: 8px; }
.lead b { color: var(--ink); font-weight: 500; }

/* ---------- Revolving orbit ---------- */
.scene { position: relative; width: 100%; max-width: 680px; margin: 0 auto; }
.ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; pointer-events: none; }
.sun { position: absolute; left: 0; top: 0; width: 104px; height: 104px; margin: -52px 0 0 -52px; z-index: 50; pointer-events: none; }
.sun .pulse { animation: pulse 9s ease-in-out infinite; transform-origin: 52px 52px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.planet { position: absolute; left: 0; top: 0; width: 44px; height: 44px; transform-origin: center; will-change: transform, opacity; }
.planet .lbl {
  position: absolute; top: 46px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--ink);
}
.orbit-core {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  z-index: 60; pointer-events: none; width: 132px; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.12; color: var(--ink);
  text-shadow: 0 0 6px var(--bg), 0 0 6px var(--bg);
}
/* Small soft cream disc: knocks back the busiest center so the text reads, while the
   terracotta burst still peeks out around and behind it */
.orbit-core::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 86px; height: 86px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--bg) 34%, rgba(245, 238, 227, .4) 62%, rgba(245, 238, 227, 0) 100%);
}
.caption { text-align: center; margin-top: 8px; }
.caption .s { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-top: 2px; }
.caption .cap-front { display: none; color: var(--accent); }

/* ---------- Work tiles ---------- */
.work { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); margin-top: 8px; }
.tile { background: var(--bg); padding: 0 0 24px; position: relative; }
.poster { aspect-ratio: 16/10; background: #ece1cf; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.poster svg { width: 70%; height: 70%; }
.tile-body { padding: 20px 24px 0; }
.tile .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.tile h3 { font-family: var(--display); font-weight: 600; font-size: 20px; margin: 10px 0 8px; }
.tile p { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--mute); border: 1px solid var(--line); padding: 4px 10px; border-radius: 2px; }
.cta {
  display: inline-block;
  font-family: var(--mono); font-size: 13px; color: var(--accent-deep);
  border: 1px solid var(--accent); padding: 8px 16px; border-radius: 2px;
  transition: background .2s, color .2s;
}
.cta:hover { background: var(--accent); color: #fff; }
.cta:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.tile-status {
  font-family: var(--mono); font-size: 11px; color: var(--mute);
  border: 1px dashed var(--line); padding: 8px 14px; border-radius: 2px; display: inline-block;
}

/* ---------- Writing / posts ---------- */
.post { display: flex; align-items: center; gap: 22px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post-date { font-family: var(--mono); font-size: 13px; color: var(--accent); min-width: 92px; }
.post-title { font-family: var(--display); font-size: 18px; flex: 1; }
.post .ar { color: var(--mute); transition: transform .2s; }
.post:hover .ar { transform: translateX(4px); color: var(--accent); }
.archive { display: inline-block; margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--mute); }
.archive:hover { color: var(--accent); }

/* ---------- Readable content pages (about, legal, listings) ---------- */
main.page { padding: 56px 0 80px; }
.page-head { margin-bottom: 28px; }
.page-head .kicker { display: block; margin-bottom: 10px; }
.page-head h1 {
  font-family: var(--display); font-weight: 500; font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -.02em; line-height: 1.05;
}
.prose { max-width: 68ch; }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 34px 0 10px; letter-spacing: -.01em; }
.prose h3, .prose h4 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 24px 0 8px; }
.prose p { margin-bottom: 14px; color: var(--ink-soft); }
.prose p strong, .prose li strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 0 0 16px 0; }
.prose ul li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--ink-soft); }
.prose ul li::before { content: '›'; position: absolute; left: 4px; color: var(--accent); }
.prose a { color: var(--accent-deep); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.prose a:hover { border-color: var(--accent); }
.divider { height: 1px; background: var(--line); margin: 32px 0 18px; }
.copyright { font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* ---------- Cards (visualizations / simulations listing) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); margin-top: 24px; }
.card { background: var(--bg); padding: 24px; display: block; transition: background .2s; }
a.card:hover { background: var(--halo); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-badge { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent); }
.card-status { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--mute); border: 1px solid var(--line); padding: 3px 8px; border-radius: 2px; }
.card-arrow { color: var(--mute); transition: transform .2s; }
a.card:hover .card-arrow { transform: translateX(4px); color: var(--accent); }
.card h2 { font-family: var(--display); font-weight: 600; font-size: 20px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--ink-soft); }
.card .tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tool-line { font-family: var(--mono); font-size: 11px; color: var(--mute); }

/* ---------- Visualization viewport — application-window frame (spec-4) ---------- */
.viz-frame-wrap {
  position: relative;
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  /* lift shadow — always cast in the light page's ink, even for a dark canvas */
  box-shadow: 0 26px 64px -30px rgba(44, 42, 38, .6);
}

/* Emissive demo → carries the espresso (dark) token set inside its frame. */
.viz-frame-wrap[data-canvas="dark"] {
  --bg: #17130e;
  --surface: #211b14;
  --ink: #f0e7d8;
  --mute: #9a8f7d;
  --line: #34291f;
  --accent: #f0a85a;
  --accent-deep: #e2823c;
}

/* Chrome bar */
.viz-chrome {
  flex: 0 0 42px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.viz-chrome-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  text-transform: lowercase; color: var(--mute);
}
.viz-chrome-tools { display: flex; align-items: center; gap: 12px; }

.viz-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--mute);
}
.viz-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: viz-pulse 2.4s ease-out infinite;
}
@keyframes viz-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 168, 90, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(240, 168, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 168, 90, 0); }
}

.viz-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  background: transparent; border: 1px solid var(--accent);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.viz-btn:hover { background: var(--accent); color: var(--bg); }
.viz-btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

/* Canvas / content */
.viz-stage {
  position: relative; flex: 1 1 auto;
  height: 72vh; min-height: 460px;
  background: var(--bg);
}
.viz-stage iframe { width: 100%; height: 100%; border: none; display: block; opacity: 0; transition: opacity .3s ease; }
.viz-stage iframe.loaded { opacity: 1; }

.viz-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--accent-deep); font-family: var(--mono);
  font-size: 12px; letter-spacing: .2em;
}
.viz-loading.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .viz-live-dot { animation: none; }
}
.back-link { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.back-link:hover { color: var(--accent); }

/* ---------- Forms (account deletion) ---------- */
.form { max-width: 480px; margin-top: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--mono); font-size: 12px; color: var(--mute); margin-bottom: 6px; }
.field input {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.submit-btn {
  font-family: var(--mono); font-size: 14px; color: #fff; background: var(--accent);
  border: 1px solid var(--accent); padding: 11px 22px; border-radius: 3px; cursor: pointer;
  transition: background .2s;
}
.submit-btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.note { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-top: 14px; line-height: 1.6; }
.confirmation { max-width: 480px; margin-top: 24px; }
.confirm-icon { font-size: 32px; color: var(--accent); margin-bottom: 8px; }

/* ---------- Footer ---------- */
footer.site {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
footer.site span { font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--ink); color: #f2ece1;
  border-top: 2px solid var(--accent);
}
.cookie-inner {
  max-width: 1080px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between;
}
.cookie-text { font-size: 13px; max-width: 70ch; color: #d9d2c6; }
.cookie-text a { color: var(--accent-light); border-bottom: 1px solid rgba(240,168,90,.4); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  font-family: var(--mono); font-size: 12px; cursor: pointer; padding: 8px 16px; border-radius: 2px;
}
.cookie-decline { background: none; border: 1px solid rgba(242,236,225,.3); color: #d9d2c6; }
.cookie-decline:hover { border-color: #f2ece1; color: #f2ece1; }
.cookie-accept { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.cookie-accept:hover { background: var(--accent-light); }

/* ---------- 404 ---------- */
.notfound { padding: 100px 0; text-align: center; }
.notfound .code { font-family: var(--display); font-weight: 600; font-size: 72px; color: var(--accent); }
.notfound p { font-family: var(--mono); font-size: 14px; color: var(--mute); margin-top: 10px; }
.notfound a { display: inline-block; margin-top: 24px; font-family: var(--mono); font-size: 13px; color: var(--accent-deep); border-bottom: 1px solid var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; gap: 8px; }
  .diorama { max-width: 440px; margin: 0 auto; }
  footer.site { flex-direction: column; }
  .planet .lbl { display: none; }
  .caption .cap-front { display: block; }
  .menu-toggle { display: block; }
  .links {
    display: none; position: absolute; top: 70px; right: 32px; left: 32px;
    flex-direction: column; gap: 16px; background: var(--halo);
    border: 1px solid var(--line); border-radius: 6px; padding: 20px; z-index: 200;
  }
  .links.open { display: flex; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #float, #shadow, .sun .pulse { animation: none !important; }
  html { scroll-behavior: auto; }
}
