:root {
  --bg-deep: #edf3f6;
  --bg-mid: #dbeaf0;
  --bg-elev: #ffffff;
  --bg-header: #dfe7ec;
  --bg-header-panel: #ffffff;
  --bg-header-hover: #e5eef4;
  --text-primary: #142630;
  --text-muted: #526b7a;
  --text-header: #152a35;
  --text-header-muted: #526a78;
  --accent: #007eaa;
  --accent-hover: #005f83;
  --accent-header: #007eaa;
  --border-subtle: rgba(20, 38, 48, 0.13);
  --border-header: #c7d6df;
  --border-header-strong: #98afbd;

  --max-w: 1100px;
  --radius: 8px;
  --shadow-soft: 0 4px 20px rgba(20, 38, 48, 0.16);
  --font-mono: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-cond: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg-deep: #1a2730;
  --bg-mid: #21313c;
  --bg-elev: #1f2e39;
  --bg-header: #21313c;
  --bg-header-panel: #1f2e39;
  --bg-header-hover: #2a3e4b;
  --text-primary: #dde9f2;
  --text-muted: #8ba7bc;
  --text-header: #dde9f2;
  --text-header-muted: #8ba7bc;
  --accent: #00c8ff;
  --accent-hover: #5be0ff;
  --accent-header: #00c8ff;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-header: #39576c;
  --border-header-strong: #4d7390;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container.narrow { max-width: 760px; }

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.15s ease, filter 0.15s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg-deep);
  text-decoration: none;
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ---------- Shared app header ---------- */
.site-header {
  background: var(--bg-header);
  color: var(--text-header);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-header);
}
.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  line-height: 1;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: .92; }
.brand-logo {
  display: block;
  height: 64px;
  width: auto;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-tag {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--border-header-strong);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1.15;
}
.brand-tag .bt-main { color: var(--text-header); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.toplink,
.nav-dropdown-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-header-muted);
  text-decoration: none;
  border: 1px solid var(--border-header);
  padding: 5px 10px;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.toplink:hover,
.nav-dropdown-btn:hover {
  color: var(--accent-header);
  border-color: var(--border-header-strong);
  text-decoration: none;
}
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-dropdown-btn .caret {
  font-size: .7em;
  line-height: 1;
}
.nav-dropdown-btn[aria-expanded="true"] {
  color: var(--accent-header);
  border-color: var(--border-header-strong);
}
.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 256px;
  background: var(--bg-header-panel);
  border: 1px solid var(--border-header);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  padding: 5px;
  z-index: 4000;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
}
.nav-dropdown-item:hover,
.nav-dropdown-item.is-current {
  background: var(--bg-header-hover);
  text-decoration: none;
}
.nav-dropdown-divider {
  display: block;
  height: 1px;
  margin: 5px 3px;
  background: var(--border-header);
}
.nav-dropdown-util { padding-block: 7px; }
.ndi-name {
  display: block;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--text-header);
  text-transform: none;
}
.ndi-desc {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-header-muted);
  margin-top: 1px;
}
.ndi-ext {
  color: var(--text-header-muted);
  font-size: .85em;
}
@media (max-width: 720px) {
  .header-inner {
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    align-items: flex-start;
    flex-direction: column;
  }
  .brand { gap: 10px; }
  .brand-logo { height: 48px; }
  .brand-tag {
    font-size: 13px;
    letter-spacing: .16em;
    padding-left: 10px;
  }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .toplink,
  .nav-dropdown-btn {
    font-size: 12px;
    padding: 5px 8px;
  }
  .nav-dropdown { position: static; }
  .nav-dropdown-menu {
    left: 16px;
    right: 16px;
    top: auto;
    min-width: 0;
    width: auto;
  }
}

/* ---------- Hero ---------- */
.hero {
  background-image:
    linear-gradient(180deg, rgba(6, 24, 33, 0.16) 0%, rgba(6, 24, 33, 0.64) 100%), url('public/tuna-map-hero.jpg?v=1');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
}
@media (min-width: 720px) {
  .hero { min-height: 100vh; }
}
.hero-inner {
  text-align: center;
}
[data-theme="dark"] .hero {
  background-image:
    linear-gradient(180deg, rgba(6, 24, 33, 0.34) 0%, rgba(6, 24, 33, 0.78) 100%), url('public/tuna-map-hero.jpg?v=1');
}
.hero-logo {
  max-width: 240px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  opacity: 0.95;
}
.hero-sub {
  font-size: 1.15rem;
  color: #d8e6ee;
  max-width: 38rem;
  margin: 0 auto 2rem;
}
.hero h1 {
  color: #f1f8fb;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.hero-cta-row { margin: 0 0 1rem; }
.hero-secondary {
  font-size: 0.95rem;
  color: #c5d5df;
  margin: 0;
}
.hero-secondary a { color: var(--accent); }

/* ---------- Section base ---------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
}
.section-alt {
  background: var(--bg-elev);
}

@media (max-width: 720px) {
  .section { padding: 2.5rem 0; }
}

/* ---------- Feature grid ---------- */
.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
.tile {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.tile-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
}
.tile h3 { margin-bottom: 0.5rem; }
.tile p { color: var(--text-muted); margin: 0; }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 1.75rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.steps h3 { margin-bottom: 0.25rem; }
.steps p { color: var(--text-muted); margin: 0; }

.protip {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(90, 184, 216, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-primary);
}

/* ---------- Screenshots ---------- */
.screenshot-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .screenshot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .screenshot-grid { grid-template-columns: repeat(3, 1fr); }
}
.screenshot {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16 / 10;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.screenshot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.screenshot-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: rgba(6, 24, 33, 0.65);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- Support band ---------- */
.section-support {
  background: var(--bg-deep);
  text-align: center;
}
.support-cta-row { margin: 1.5rem 0 0.75rem; }
.support-fineprint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}
@media (min-width: 720px) {
  .footer-inner { flex-direction: row; align-items: center; }
}
.footer-left { margin: 0; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent-hover); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 17, 26, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
}
.lightbox.lightbox-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--bg-mid); }


/* ---------- Data Guide ---------- */
.data-guide {
  background: var(--bg-mid);
  padding: 5rem 0;
}
.data-guide h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-intro {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}
.data-card {
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
}
.data-card h3 {
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.data-card p {
  margin-bottom: 1rem;
  line-height: 1.65;
}
.data-card p:last-child {
  margin-bottom: 0;
}
@media (min-width: 720px) {
  .data-guide { padding: 6rem 0; }
}

/* Temporarily hidden until real screenshots are ready. !important
   guards against any future class-level display rule winning the
   cascade; remove the rule and this comment when un-hiding. */
#screenshots { display: none !important; }
