/* agentic-spec.com — site-wide stylesheet.
   Generated from specs/0300-style.md per gen-site.md.
   Do not hand-edit; edit the spec and regenerate. */

/* ---------- Req 2: Custom properties ---------- */
/* palette-tbd: conservative defaults pending real palette values from the spec. */
:root {
  /* Page surfaces */
  --bg: #ffffff;
  --bg-dark: #0a0a0a;
  --bg-muted: #f7f7f7;

  /* Text */
  --fg: #111;
  --fg-sec: #444;
  --fg-muted: #888;
  --fg-inv: #fff;

  /* Accent */
  --accent: #4a6cf7;
  --accent-hover: #3a5ce0;
  --accent-light: #e8edff;

  /* Borders */
  --border: #e5e5e5;
  --border-subtle: #f0f0f0;

  /* Layout */
  --max-w: 960px;

  /* Fonts (Req 3) */
  --font-display: 'Orbitron', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Sora', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Req 20: Root scroll behavior ---------- */
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

* { box-sizing: border-box; }

/* ---------- Req 12 + Req 3: Body baseline ---------- */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-sec);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 24px; }

/* ---------- Req 3: Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px 0;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
@media (min-width: 961px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .section h2 { font-size: 28px; font-weight: 800; }
}

/* ---------- Req 14: Link and emphasis ---------- */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--fg); }

/* ---------- Req 18: Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------- Req 18: SR-only-visual ---------- */
.sr-only-visual {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Req 18: Anchor offset ---------- */
[id] { scroll-margin-top: 70px; }

/* ---------- Req 5 + Req 16: Sticky site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Req 6: Logo ---------- */
.site-logo { display: inline-flex; align-items: center; }
.site-logo img { height: 42px; width: auto; display: block; }

/* ---------- Req 7: Desktop nav ---------- */
.main-nav { display: none; align-items: center; gap: 4px; }
@media (min-width: 600px) { .main-nav { display: flex; } }
.nav-link {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 6px 12px 3px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 4px solid transparent;
  transition: border-color 0.15s, font-weight 0.15s;
}
.nav-link:hover { border-bottom-color: var(--accent); text-decoration: none; }
.nav-link.active { border-bottom-color: var(--accent); font-weight: 600; }
@media (min-width: 961px) { .nav-link { font-size: 15px; } }

.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  margin-left: 8px;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }

/* ---------- Req 8: Mobile hamburger + overlay ---------- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  gap: 5px;
  cursor: pointer;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--fg); }
@media (min-width: 600px) { .hamburger { display: none; } }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: none;
  flex-direction: column;
  padding: 20px;
}
.mobile-nav-overlay.open { display: flex; }
.mobile-nav-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--fg);
  cursor: pointer;
}
.mobile-nav-list { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.mobile-nav-link {
  position: relative;
  font-family: var(--font-body);
  font-size: 18px;
  padding: 14px 16px;
  min-height: 52px;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.mobile-nav-link.active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 4px;
  background: var(--accent);
}
.mobile-nav-cta {
  display: block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 14px 16px;
  min-height: 52px;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  margin-top: 16px;
}

/* ---------- Req 9: Home-page hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--fg-inv);
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 48px;
}
@media (min-width: 961px) {
  .hero-inner {
    padding: 80px 24px 60px;
    display: flex;
    align-items: center;
    gap: 48px;
  }
}
.hero-image { display: flex; justify-content: center; margin-bottom: 32px; }
.hero-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 200px;
  aspect-ratio: 1068 / 1392;
  object-fit: contain;
}
@media (min-width: 961px) {
  .hero-image { margin-bottom: 0; flex: 0 0 auto; justify-content: flex-start; }
  .hero-image img { max-width: 280px; }
}
.hero-text { flex: 1 1 auto; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--fg-inv);
  margin: 0 0 16px 0;
}
@media (min-width: 600px) { .hero h1 { font-size: 40px; } }
@media (min-width: 961px) { .hero h1 { font-size: 48px; } }
.hero-subtitle {
  font-size: 17px;
  color: #999;
  max-width: 540px;
  margin: 0 0 32px 0;
  opacity: 0;
  transition: opacity 600ms ease;
}
.hero-btns { display: flex; flex-direction: column; gap: 24px; opacity: 0; transition: opacity 600ms ease; }
@media (min-width: 600px) { .hero-btns { flex-direction: row; } }

/* ---------- Req 13: Buttons ---------- */
.btn-primary,
.btn-secondary {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 4px;
  min-width: 220px;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  box-sizing: border-box;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: #fff; border: 1px solid #666; }
.btn-secondary:hover { border-color: #fff; text-decoration: none; }
/* Light-background variant for in-flow CTAs */
.chat-cta-buttons .btn-secondary { color: var(--fg); border-color: var(--fg-sec); }
.chat-cta-buttons .btn-secondary:hover { border-color: var(--fg); }

/* ---------- Req 10: Section-label pill ---------- */
.section-label {
  display: inline-block;
  background: var(--fg);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  margin-bottom: 24px;
}

/* ---------- Req 11: Bubble-init + section-content reveal ---------- */
.section-label.bubble-init { transform: scaleX(0); transform-origin: left center; }
.section-label.bubble-init .bubble-text { opacity: 0; }
.section-label.bubble-animate { animation: bubble-expand 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.section-label.bubble-animate .bubble-text { animation: bubble-text-appear 200ms ease 250ms forwards; }

@keyframes bubble-expand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes bubble-text-appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.section-content-hidden { opacity: 0; transition: opacity 400ms ease; }
.section-content-visible { opacity: 1; }

/* ---------- Req 12: Footer ---------- */
.site-footer { max-width: var(--max-w); margin: 0 auto; padding: 48px 24px 24px; }
.site-footer p { font-size: 12px; color: var(--fg-sec); text-align: left; margin: 0; }

/* ---------- Req 22: Chat animation visuals ---------- */
.chat-flow { max-width: var(--max-w); overflow-anchor: none; min-height: 80vh; }
.chat-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  max-width: 480px;
  transition: opacity 600ms ease;
}
.chat-input-text {
  flex: 1 1 auto;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg);
  min-height: 24px;
  display: flex;
  align-items: center;
}
.chat-input-placeholder { color: #bbb; }
.chat-input-send {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.chat-question {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  transition: opacity 300ms ease;
}
.chat-question-bubble {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 10px 18px;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 80%;
}

.chat-thinking { margin-bottom: 20px; transition: opacity 300ms ease; }
.thinking-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 3px;
  animation: thinking-bounce 1.4s infinite ease-in-out;
}
.thinking-dot:nth-child(2) { animation-delay: 200ms; }
.thinking-dot:nth-child(3) { animation-delay: 400ms; }
@keyframes thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

.chat-section-label {
  display: inline-block;
  background: var(--fg);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  margin-bottom: 24px;
  transform: scaleX(0);
  transform-origin: left center;
}
.chat-section-label.bubble-animate { animation: bubble-expand 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.chat-section-label .bubble-text { opacity: 0; }
.chat-section-label.bubble-animate .bubble-text { animation: bubble-text-appear 200ms ease 250ms forwards; }

.chat-response { margin-bottom: 32px; opacity: 0; transition: opacity 400ms ease; }
.chat-response.visible { opacity: 1; }
.chat-response p { margin: 0 0 16px 0; }
.chat-response em { font-style: italic; color: var(--fg); }
.chat-response ul { padding-left: 1em; margin: 0; list-style: disc; }
.chat-response li { font-size: 15px; color: var(--fg-sec); }

.chat-el-fading { opacity: 0; transition: opacity 600ms ease; }

.chat-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
  opacity: 0;
  transition: opacity 600ms ease;
}
@media (min-width: 600px) { .chat-cta-buttons { flex-direction: row; } }
.chat-cta-buttons.visible { opacity: 1; }

/* ---------- About-page chapter list ---------- */
.about-chapter { margin-top: 32px; }
.about-chapter h2 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 8px 0;
}
.about-chapter p { margin: 0; }

/* ---------- Errata page layout ---------- */
.errata-intro { margin: 0 0 32px 0; }
.errata-tree {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  background: var(--bg-muted);
  margin: 0 0 32px 0;
  font-size: 15px;
}
.errata-tree details > summary { cursor: pointer; padding: 4px 0; font-weight: 600; color: var(--fg); }
.errata-tree details details > summary { font-weight: 500; }
.errata-tree details details details > summary { font-weight: 400; }
.errata-tree ul { list-style: none; padding-left: 20px; margin: 0; }
.errata-tree .errata-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.errata-tree .errata-leaf input[type="radio"] { margin: 0; }
.errata-tree .errata-leaf label { cursor: pointer; }

.errata-form { display: flex; flex-direction: column; gap: 16px; margin: 0 0 32px 0; }
.errata-form .selected-location {
  font-size: 14px;
  color: var(--fg-sec);
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: 4px;
}
.errata-form .selected-location strong { color: var(--fg); }
.errata-form label { font-size: 14px; font-weight: 600; color: var(--fg); }
.errata-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  min-height: 96px;
  box-sizing: border-box;
}
.errata-form .char-counter { font-size: 12px; color: var(--fg-muted); text-align: right; }
.errata-form button {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 4px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.errata-form button:hover { background: var(--accent-hover); }
.errata-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.errata-preview {
  display: none;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg-muted);
}
.errata-preview.open { display: flex; }
.errata-preview .preview-actions { display: flex; gap: 12px; }
.errata-preview button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.errata-preview .preview-confirm { background: var(--accent); color: #fff; }
.errata-preview .preview-confirm:hover { background: var(--accent-hover); }
.errata-preview .preview-cancel { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.errata-preview .preview-cancel:hover { border-color: var(--fg); }

/* ---------- Req 21: Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-nav-overlay { display: none !important; }
  body { background: #fff; color: #000; }
}
