:root {
  color-scheme: light;
  --paper: #f4efe5;
  --paper-deep: #e8dfcf;
  --ink: #26312d;
  --muted: #69746f;
  --card: rgba(255, 253, 248, 0.9);
  --line: rgba(38, 49, 45, 0.14);
  --moss: #456b58;
  --moss-dark: #315042;
  --river: #4d8993;
  --clay: #a96549;
  --sun: #edbf69;
  --ok: #327457;
  --warn: #9a6820;
  --error: #a64038;
  --shadow: 0 24px 70px rgba(63, 53, 39, 0.11);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(237, 191, 105, 0.28), transparent 28rem),
    radial-gradient(circle at 92% 35%, rgba(77, 137, 147, 0.18), transparent 30rem),
    linear-gradient(180deg, #faf7f0 0%, var(--paper) 44%, #eee6d8 100%);
}

button, input, select { font: inherit; }

.topbar {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.capy {
  position: relative;
  width: 34px;
  height: 29px;
  display: inline-block;
  border-radius: 46% 52% 48% 45%;
  background: var(--clay);
  box-shadow: inset -6px -5px 0 rgba(75, 46, 35, 0.14);
}

.capy::before,
.capy::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 9px;
  height: 10px;
  border-radius: 50%;
  background: var(--clay);
}

.capy::before { left: 3px; }
.capy::after { right: 3px; }

.capy span::before,
.capy span::after {
  content: "";
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: var(--ink);
}

.capy span::before { width: 3px; height: 3px; left: 9px; top: 11px; }
.capy span::after { width: 6px; height: 4px; right: 5px; top: 15px; }

.local-badge,
.safe-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--moss-dark);
  background: rgba(255, 255, 255, 0.5);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.hero { max-width: 720px; margin-bottom: 42px; }
.hero-grid {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
}
.device-preview {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.device-preview img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  image-rendering: pixelated;
  border: 14px solid #8a5236;
  box-shadow: 0 0 0 4px #5b3423, var(--shadow);
  background: #101419;
}
.device-preview figcaption { color: var(--muted); font-size: 13px; }
.howto { margin: 14px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.65; }
.howto b { color: var(--ink); font-weight: 680; }

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

h1, h2, h3, p { text-wrap: pretty; }

h1 {
  margin: 0;
  font: 780 clamp(46px, 8vw, 82px)/0.94 Georgia, "Times New Roman", serif;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 650px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.status,
.flash-status {
  padding: 12px 14px;
  border-left: 3px solid var(--river);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 14px;
}

[data-tone="ok"] { color: var(--ok); border-color: var(--ok); }
[data-tone="warn"] { color: var(--warn); border-color: var(--warn); }
[data-tone="error"] { color: var(--error); border-color: var(--error); }
[data-tone="work"] { color: var(--river); border-color: var(--river); }

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.steps-panel { padding: 30px; }

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
}

.panel h2 { margin: 0; font-size: 26px; letter-spacing: -0.035em; }
.panel h3 { margin: 0 0 12px; font-size: 17px; }

.step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
}

.step-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--moss);
  font-weight: 800;
}

.step-content { min-width: 0; }

.package-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(244, 239, 229, 0.6);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.package-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.file-button,
.primary-button,
.danger-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  padding: 13px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.file-button {
  border: 1px solid var(--line);
  color: var(--moss-dark);
  background: white;
}

.primary-button {
  width: 100%;
  justify-content: space-between;
  border: 1px solid var(--moss-dark);
  color: white;
  background: var(--moss);
  box-shadow: 0 12px 28px rgba(49, 80, 66, 0.2);
}

.file-button:hover,
.primary-button:not(:disabled):hover,
.danger-button:not(:disabled):hover { transform: translateY(-1px); }

button:focus-visible,
.file-button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(77, 137, 147, 0.36);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
}

.confirm-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.confirm-row input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--moss); }

.microcopy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.top-zero { margin-top: 0; }

code {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--moss-dark);
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

progress {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-deep);
}

progress::-webkit-progress-bar { background: var(--paper-deep); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--moss), var(--river)); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--moss), var(--river)); }

.flash-status { margin: 12px 0 0; }

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.compact { padding: 24px; box-shadow: none; }
.compact ol { margin: 14px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.compact p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.privacy-card { background: rgba(232, 239, 233, 0.82); }

.disclosure { margin-top: 18px; padding: 20px 24px; box-shadow: none; }
.disclosure summary { cursor: pointer; font-weight: 760; }
.disclosure p { color: var(--muted); line-height: 1.6; }

pre {
  max-height: 300px;
  margin: 18px 0 0;
  padding: 16px;
  overflow: auto;
  border-radius: 12px;
  color: #dce8e2;
  background: #26312d;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.danger-zone { border-color: rgba(166, 64, 56, 0.3); }
.danger-zone .field-label { margin-top: 16px; }

.danger-button {
  width: 100%;
  border: 1px solid var(--error);
  color: white;
  background: var(--error);
}

footer {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* top navigation (flasher and enclosure pages) */
.topnav { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.5); }
.topnav a { padding: 6px 12px; border-radius: 999px; color: var(--moss-dark); font-size: 14px; font-weight: 700; text-decoration: none; }
.topnav a[aria-current="page"] { color: white; background: var(--moss); }
.topnav a:focus-visible, .case-card a:focus-visible, .shot-grid a:focus-visible, .case-hero-shot:focus-visible, .download-button:focus-visible { outline: 3px solid rgba(77, 137, 147, 0.36); outline-offset: 3px; }

/* enclosure teaser on the flasher page */
.case-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 18px; padding: 22px 24px; box-shadow: none; }
.case-card img { width: 100%; height: auto; border-radius: 16px; background: white; }
.case-card h2 { margin: 0 0 8px; }
.case-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.case-card .file-button { text-decoration: none; }

/* enclosure page */
.case-main { width: min(1120px, calc(100% - 40px)); display: grid; gap: 34px; }
.case-hero { margin-bottom: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
.case-hero h1 { font-size: clamp(42px, 6.4vw, 70px); }
.case-hero-shot { display: block; border-radius: 24px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.case-hero-shot img { display: block; width: 100%; height: auto; }
.spec-list { margin: 0 0 6px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.spec-list li { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.55); font-size: 13px; font-variant-numeric: tabular-nums; }
.spec-list b { color: var(--moss-dark); }
.download-button { max-width: 460px; margin: 14px 0 18px; text-decoration: none; }
.download-meta { font-size: 13px; font-weight: 600; opacity: 0.86; }
.case-section { display: grid; gap: 14px; }
.case-main ~ footer { width: min(1120px, calc(100% - 40px)); }
.case-section > h2 { margin: 0; font-size: 26px; letter-spacing: -0.035em; }
.case-section > .eyebrow { margin: 0; }
.case-section .microcopy { margin: 0; max-width: 760px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.shot-grid figure { margin: 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.shot-grid a { display: block; border-radius: 16px; overflow: hidden; background: white; border: 1px solid var(--line); }
.shot-grid img { display: block; width: 100%; height: auto; }
.shot-grid figcaption { color: var(--muted); font-size: 13px; line-height: 1.5; }
.shot-grid figcaption b { color: var(--ink); font-weight: 720; }
.views-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.views-grid .wide { grid-column: span 2; }
.views-grid .wide a { height: 100%; display: grid; place-items: center; }
.views-grid .wide img { width: auto; max-width: 100%; max-height: 520px; }
.print-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.sections-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.table-scroll { overflow-x: auto; }
.print-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.print-table th, .print-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.print-table th { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.print-table td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--moss-dark); }
.print-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.warning-card { border-color: rgba(154, 104, 32, 0.32); background: rgba(250, 240, 220, 0.86); }
.warning-card p { color: var(--ink); }
.screen-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 116px), 1fr)); gap: 14px; }
.screen-strip figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.screen-strip img { width: 100%; max-width: 150px; height: auto; border-radius: 50%; image-rendering: pixelated; border: 6px solid #8a5236; background: #101419; }
.screen-strip figcaption { color: var(--muted); font-size: 12px; font-weight: 700; }

@media (max-width: 860px) {
  .hero-grid, .case-hero { grid-template-columns: 1fr; gap: 26px; }
  .device-preview { justify-self: center; }
}

@media (max-width: 680px) {
  .topbar, main, footer { width: min(100% - 28px, 900px); }
  .case-main { width: min(100% - 28px, 1120px); }
  .case-card { grid-template-columns: 1fr; }
  .shot-grid, .views-grid, .print-grid, .sections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .views-grid .wide { grid-column: span 2; }
  .case-card img { max-width: 260px; }
  .topbar { gap: 12px; flex-wrap: wrap; }
  main { padding-top: 34px; }
  h1 { font-size: clamp(44px, 15vw, 64px); }
  .lead { font-size: 16px; }
  .steps-panel { padding: 20px; border-radius: 18px; }
  .step { grid-template-columns: 34px 1fr; gap: 12px; }
  .step-number { width: 30px; height: 30px; }
  .support-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
