:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #5d6268;
  --paper: #f7f4ef;
  --panel: #ffffff;
  --line: #d8d0c5;
  --accent: #276b5d;
  --accent-dark: #15473e;
  --soft: #ece5dc;
  --shadow: 0 18px 50px rgba(28, 22, 16, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

body.locked .app { display: none; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(247, 244, 239, 0.86), rgba(247, 244, 239, 0.94)),
    url("./assets/preview-hero.webp") center / cover no-repeat;
}

.gate-panel {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
  margin-bottom: 18px;
}

.gate h1 {
  font-size: 44px;
  line-height: 1;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: 0;
  margin-bottom: 12px;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 8px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid #bcb4aa;
  background: #fff;
  padding: 0 12px;
  font: inherit;
}

button, .topbar a {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

button:hover, .topbar a:hover { background: var(--accent-dark); }

.form-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: #8b2f20;
  font-size: 14px;
}

.hero {
  padding: 22px clamp(18px, 4vw, 54px) 58px;
  background:
    linear-gradient(rgba(247, 244, 239, 0.75), rgba(247, 244, 239, 0.98)),
    url("./assets/preview-hero.webp") center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 70px;
}

.topbar a {
  display: inline-grid;
  place-items: center;
  min-width: 112px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
}

.lock-button {
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
  border-color: var(--line);
}

.topbar a:hover { color: #fff; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 32px;
  align-items: end;
}

.lede {
  max-width: 780px;
  font-size: 18px;
  color: #2d3439;
}

.run-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--soft);
  padding-bottom: 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

dd { margin: 0; font-weight: 700; }

code {
  background: var(--soft);
  padding: 2px 5px;
}

.section {
  padding: 58px clamp(18px, 4vw, 54px);
}

.section-head {
  max-width: 900px;
  margin-bottom: 24px;
}

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

.explain-grid article,
.settings-box,
.comparison-note {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.package-tabs {
  margin-bottom: 10px;
}

.view-tabs {
  margin-top: -8px;
}

.tab {
  white-space: nowrap;
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--line);
}

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.package-tab {
  min-width: 170px;
}

.view-tab {
  min-width: 108px;
}

.checkpoint-panel {
  display: grid;
  gap: 22px;
}

.view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
}

.view-header h3 {
  font-size: 26px;
}

.view-header p:last-child {
  margin-bottom: 0;
}

.deep-link {
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dark);
}

.sheet-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.sheet-card img {
  display: block;
  width: 100%;
  height: auto;
}

.single-sheet {
  max-width: 1460px;
}

.strength-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.strength-tab {
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--line);
}

.strength-tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.image-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
}

.image-card button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-card p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #394047;
}

.image-card.missing {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.settings-wide {
  max-width: 980px;
}

.comparisons {
  background: #fff;
  border-top: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: rgba(18, 16, 14, 0.88);
}

.lightbox[hidden] { display: none; }

.lightbox-close {
  justify-self: end;
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  background: #fff;
}

.lightbox p {
  color: #fff;
  text-align: center;
  margin: 0;
}

@media (max-width: 980px) {
  .hero-grid,
  .view-header,
  .explain-grid {
    grid-template-columns: 1fr;
  }

  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    justify-content: flex-start;
    margin-bottom: 42px;
  }
}

@media (max-width: 560px) {
  .password-row { grid-template-columns: 1fr; }
  .prompt-grid { grid-template-columns: 1fr; }
  .strength-head { display: block; }
  dl div { grid-template-columns: 1fr; gap: 4px; }
  .topbar { flex-wrap: wrap; }
  .topbar a { min-width: 0; flex: 1 1 130px; }
}
