:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --ink: #2b2118;
  --muted: #6b5b4b;
  --primary: #b34822;
  --primary-hover: #913819;
  --accent: #e0a03a;
  --border: rgba(43, 33, 24, 0.14);
  --surface-tint: #efe6d8;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--card);
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { left: 16px; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}
.brand-mark:hover { text-decoration: none; }

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}
.site-nav a:hover { color: var(--primary); text-decoration: none; }

/* Hero & Game Stage */
.hero-stage-section {
  padding: 24px 0 48px;
}

.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 12px;
}

h1 { font-size: 36px; margin-bottom: 4px; }
h2 { font-size: 28px; margin-bottom: 16px; }
h3 { font-size: 18px; margin-bottom: 8px; }

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius);
}

.stage-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.dive-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 540px;
  background: var(--bg);
  overflow: hidden;
}

.dive-cover,
.dive-loader,
.dive-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.dive-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.cover-cta-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
}

.cover-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: var(--radius);
}

.btn-play,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--card);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn-play:hover,
.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.btn-play:active { transform: translateY(1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.cover-caption {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Custom Bathymetric Sonar Loader */
.dive-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  gap: 12px;
  padding: 24px;
  text-align: center;
}

[data-gf-frame][data-gf-state="loading"] [data-gf-cover],
[data-gf-frame][data-gf-state="playing"] [data-gf-cover] {
  display: none;
}

[data-gf-frame][data-gf-state="loading"] [data-gf-loading] {
  display: flex;
}

.sonar-gauge {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 48px;
}

.sonar-bar {
  width: 8px;
  height: 16px;
  border-radius: 4px;
  background: var(--primary);
  animation: divePulse 1s ease-in-out infinite;
}
.sonar-bar:nth-child(2) { animation-delay: 0.12s; background: var(--accent); }
.sonar-bar:nth-child(3) { animation-delay: 0.24s; }
.sonar-bar:nth-child(4) { animation-delay: 0.36s; background: var(--accent); }
.sonar-bar:nth-child(5) { animation-delay: 0.48s; }

@keyframes divePulse {
  0%, 100% { height: 14px; opacity: 0.45; }
  50% { height: 46px; opacity: 1; }
}

.loader-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.loader-sub { margin: 0; font-size: 14px; color: var(--muted); }

/* Stage Action Bar */
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-wrap: wrap;
}

.stage-actions-left,
.stage-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); }

.action-btn-muted { background: var(--card); color: var(--muted); }
.action-btn-accent {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}
.action-btn-accent:hover { background: var(--primary); border-color: var(--primary); color: var(--card); }

[data-gf-like][data-gf-liked] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--card);
}
[data-gf-like][data-gf-liked] .action-count { color: var(--card); }

.action-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.share-toast {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.ios-install-note {
  margin: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Content Sections */
.content-section { padding: 48px 0; }
.section-tinted { background: var(--surface-tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-lead {
  max-width: 70ch;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
}

/* Section 1: Asymmetric Intro + Bathymetric Scale */
.split-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: start;
}

.editorial-col p {
  max-width: 70ch;
  margin: 0 0 16px;
}

.depth-ruler-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.ruler-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ruler-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.ruler-max { font-size: 14px; font-weight: 700; color: var(--primary); }

.depth-scale {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.depth-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.depth-dot {
  position: absolute;
  left: -23px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--primary);
}

.depth-copy strong { display: block; font-size: 14px; color: var(--ink); }
.depth-copy span { display: block; font-size: 14px; color: var(--muted); }

.dive-diagram {
  margin: 32px 0 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.dive-diagram figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* Section 2: Numbered Field Log Steps */
.step-log {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.step-body p { margin: 0; max-width: 70ch; color: var(--muted); }

.controls-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.control-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.control-cell strong { display: block; font-size: 14px; margin-bottom: 4px; }
.control-cell span { font-size: 14px; color: var(--muted); }

/* Section 3: 2x2 Modes Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.mode-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.mode-tag {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
}
.mode-card p:last-child { margin: 0; color: var(--muted); }

/* Section 4: Prose Flow */
.prose-flow { max-width: 70ch; }
.prose-flow h2 { margin-top: 32px; }
.prose-flow h2:first-child { margin-top: 0; }
.prose-flow h3 { margin-top: 24px; }
.prose-flow p, .prose-flow li { color: var(--ink); margin-bottom: 12px; }
.prose-flow ul { padding-left: 24px; margin: 0 0 16px; }

/* Section 5: FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--primary);
  line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer p { margin: 12px 0 0; color: var(--muted); max-width: 70ch; }

/* Section 6: Comments */
.comments-wrap { max-width: 760px; }

.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reply-banner {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.form-row { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink); }

.comment-form input,
.comment-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comment-msg { font-size: 14px; font-weight: 600; color: var(--primary); }

.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-list[data-gf-empty]::before {
  content: "No dive logs yet — be the first to post your deepest Krillion Unlimited score or rarest answer!";
  display: block;
  padding: 24px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}
.comment-item[data-gf-owner],
.reply-item[data-gf-owner] {
  border-left: 4px solid var(--accent);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.comment-meta time { color: var(--muted); font-size: 12px; }

.owner-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.comment-text { margin: 0 0 8px; white-space: pre-wrap; }
.reply-link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reply-target { font-size: 12px; font-weight: 600; color: var(--primary); }

/* Inner & Legal Pages */
.inner-page { padding: 32px 0 64px; }
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}
.prose-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.page-lead { font-size: 18px; color: var(--muted); max-width: 70ch; margin: 0 0 24px; }
.legal-meta { font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.prose-body { max-width: 70ch; }
.prose-body h2 { margin-top: 32px; font-size: 22px; }
.prose-body p, .prose-body li { margin-bottom: 12px; }
.inner-cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.footer-tagline { margin: 12px 0 8px; font-size: 14px; color: var(--ink); max-width: 56ch; }
.footer-note { margin: 0; font-size: 12px; color: var(--muted); max-width: 60ch; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-content: start;
  justify-content: flex-end;
}
.footer-links a { font-size: 14px; font-weight: 600; color: var(--muted); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

@media (max-width: 840px) {
  .split-intro,
  .modes-grid,
  .controls-strip,
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .dive-stage { aspect-ratio: auto; min-height: 580px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .site-nav { gap: 12px; }
  .site-nav a:nth-child(3) { display: none; }
  .hero-stage-section { padding: 16px 0 32px; }
  .dive-stage { min-height: 600px; }
  .btn-play, .btn-primary { width: 100%; }
  .stage-bar { flex-direction: column; align-items: stretch; }
  .stage-actions-left, .stage-actions-right { width: 100%; }
  .stage-actions-right .action-btn { flex: 1; justify-content: center; }
  .step-item { grid-template-columns: 1fr; padding: 16px; }
  .prose-card { padding: 24px 16px; }
}
