@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Libre+Franklin:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "Canterbury";
  src: url("./assets/canterbury.regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "ANSIPC9 Web";
  src: url("./assets/ansipc9-web.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
  color: #f2e8d0;
  background: #160f11;
  font-synthesis: none;
  --ink: #f2e8d0; --muted: #b9aa94; --wine: #6f2438; --wine-bright: #973650;
  --gold: #d8ad55; --gold-light: #fff0a5; --stone: #30272a; --stone-light: #493c40;
  --line: rgba(216, 173, 85, .24); --red: #e46c6c;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: #160f11; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% 14%, rgba(126, 48, 65, .22), transparent 36rem), linear-gradient(180deg, #211619 0, #160f11 58%, #110b0d 100%); }
button, input, select { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--gold-light); }
h1, h2, p { margin: 0; }

.topbar { min-height: 76px; padding: 14px clamp(20px, 5vw, 68px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(16, 10, 12, .72); backdrop-filter: blur(12px); }
.brand { max-width: min(620px, 72vw); color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.brand-home { align-self: flex-start; color: inherit; text-decoration: none; }
.tagline-pending { visibility: hidden; }
.tagline-easter-egg, .tagline-easter-egg:visited, .tagline-easter-egg:hover { color: #c7baa7; text-decoration: none; }
.tagline-easter-egg { cursor: pointer; }
.brand > span:last-child { color: var(--muted); font-size: 11px; }
.wordmark { display: inline-flex; align-items: baseline; justify-content: center; white-space: nowrap; line-height: 1; text-shadow: 0 3px 28px rgba(0, 0, 0, .55); }
.pram-word { display: inline-block; color: var(--gold-light); font-family: "ANSIPC9 Web", ui-monospace, monospace; font-size: 33px; font-weight: 400; line-height: 1; letter-spacing: 0; }
.wordmark-header .pram-word { font-size: 33px; }
.wordmark-hero .pram-word { font-size: 77px; }
.alot-word { margin-left: -.05em; color: var(--ink); font-family: "Canterbury", "Old English Text MT", Georgia, serif; font-size: 1em; font-weight: 400; line-height: .78; letter-spacing: -.025em; }
.app-suffix { margin-left: .11em; color: var(--muted); font: 500 .31em/1 Georgia, serif; letter-spacing: 0; }
.wordmark-header { justify-content: flex-start; font-size: 37px; }
.wordmark-hero { font-size: 86.3333px; font-weight: 400; }
.status-badge { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.status-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #766b6e; }
.status-badge.live::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(216, 173, 85, .12); }
.status-badge.error { color: #f4b0b0; }
.status-badge.error::before { background: var(--red); }

main { width: min(850px, calc(100% - 32px)); margin: 0 auto; }
.hero { min-height: calc(100vh - 150px); padding: clamp(56px, 9vh, 92px) 0 46px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.eyebrow { color: var(--gold); font-family: Cinzel, Georgia, serif; font-size: 11px; font-weight: 600; letter-spacing: .19em; text-transform: uppercase; }
h2 { font-family: Cinzel, Georgia, serif; font-size: 18px; letter-spacing: .025em; }

.sync-icon { position: relative; width: 160px; height: 160px; margin: 34px 0 22px; transition: transform .3s ease; image-rendering: pixelated; }
.sync-icon-image { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: crisp-edges; image-rendering: pixelated; transition: opacity .3s ease, filter .3s ease; }
.sync-icon-bw { opacity: .48; }
.sync-icon-color { opacity: 0; }
.sync-icon.listening .sync-icon-bw { opacity: .72; animation: icon-breathe 2.6s ease-in-out infinite; }
.sync-icon.testing .sync-icon-bw { opacity: 1; }

.sync-icon.detected .sync-icon-bw { opacity: 0; }
.sync-icon.detected .sync-icon-color { opacity: 1; filter: drop-shadow(0 0 18px rgba(245, 205, 105, .5)); }
.sync-icon.error .sync-icon-bw { opacity: .32; }
@keyframes icon-breathe { 0%, 100% { opacity: .58; } 50% { opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .sync-icon.listening .sync-icon-bw { animation: none; } }

.primary-status { min-height: 24px; color: var(--muted); font-size: 15px; }
.primary-action { width: min(100%, 380px); min-height: 64px; margin-top: 12px; border: 1px solid #e1bd71; border-radius: 8px; background: linear-gradient(180deg, var(--wine-bright), var(--wine)); color: #fff8e7; font-family: Cinzel, Georgia, serif; font-size: 17px; font-weight: 700; letter-spacing: .045em; box-shadow: 0 9px 25px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.14); }
.primary-action:hover { background: linear-gradient(180deg, #aa4260, #7d2940); }
.primary-action:focus-visible, .test-action:focus-visible, .info-links button:focus-visible, summary:focus-visible, .dialog-close:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 4px; }
.test-action { min-height: 40px; margin-top: 11px; padding: 0 18px; border: 0; background: transparent; color: var(--gold-light); font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,240,165,.35); text-underline-offset: 4px; }
.info-links { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.info-links button { min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.info-links button:hover { color: var(--ink); }
.info-links span { color: var(--wine-bright); font-size: 7px; }

.advanced { margin: 0 0 56px; border: 1px solid var(--line); border-radius: 9px; background: rgba(31, 22, 25, .78); overflow: hidden; }
.advanced > summary { min-height: 58px; padding: 0 22px; display: flex; align-items: center; justify-content: center; list-style: none; color: var(--gold-light); font-family: Cinzel, Georgia, serif; font-size: 14px; font-weight: 600; letter-spacing: .07em; cursor: pointer; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after { content: "+"; margin-left: 10px; color: var(--gold); font-family: "Libre Franklin", sans-serif; font-size: 18px; }
.advanced[open] > summary::after { content: "−"; }
.advanced-content { padding: 0 24px 26px; border-top: 1px solid var(--line); }
.advanced-section { padding: 26px 0; border-bottom: 1px solid rgba(216, 173, 85, .14); }
.advanced-section:last-child { border-bottom: 0; padding-bottom: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.segmented { display: inline-grid; grid-template-columns: 1fr 1fr; margin-top: 20px; border: 1px solid var(--stone-light); border-radius: 6px; overflow: hidden; }
.segment { min-height: 40px; min-width: 160px; padding: 0 14px; border: 0; border-radius: 0; background: #21191b; color: var(--muted); font-size: 12px; font-weight: 600; }
.segment + .segment { border-left: 1px solid var(--stone-light); }
.segment.selected { background: #4d2732; color: #fff1cf; }
.settings-grid { margin-top: 22px; display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 18px; }
label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 12px; }
.field-label { display: inline-flex; align-items: center; gap: 5px; }
.info-tip { width: 15px; height: 15px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: #c9b783; font: 700 10px/1 Georgia, serif; cursor: help; }
.info-tip:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.field-label output { margin-left: auto; color: var(--ink); font-weight: 600; }
select { width: 100%; height: 42px; border: 1px solid var(--stone-light); border-radius: 5px; background: #1d1518; padding: 0 10px; color: var(--ink); }
input[type="range"] { width: 100%; height: 42px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.quiet { min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 20px; background: var(--line); border: 1px solid var(--line); }
.metrics div { min-height: 70px; padding: 13px 14px; background: #1c1517; display: flex; flex-direction: column; gap: 8px; }
.metrics span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.metrics strong { font-size: 15px; }
.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; background: #1a1315; }
th, td { padding: 11px 12px; border-bottom: 1px solid rgba(216,173,85,.13); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; background: #261c1f; }
.empty-row td { color: var(--muted); text-align: center; padding: 24px; }
.result-strong, .result-reliable { color: var(--gold-light); font-weight: 700; }
.result-marginal { color: #e3a755; font-weight: 700; }
.result-not-detected { color: var(--red); font-weight: 700; }

dialog { width: min(620px, calc(100% - 28px)); max-height: min(760px, calc(100vh - 32px)); overflow-y: auto; border: 1px solid rgba(216,173,85,.48); border-radius: 10px; background: #211719; color: var(--ink); padding: clamp(24px, 5vw, 40px); box-shadow: 0 24px 80px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(8,5,6,.78); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-heading h2 { margin-top: 5px; font-size: 24px; }
.dialog-close { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--stone-light); border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
dialog > p, .instructions-list { color: #d4c7b5; font-size: 14px; line-height: 1.7; }
dialog > p + p { margin-top: 16px; }
.instructions-list { margin: 0; padding-left: 23px; }
.instructions-list li { padding-left: 6px; }
.instructions-list li + li { margin-top: 14px; }
.coming-soon { display: inline-block; margin-left: 5px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dialog-note { margin-top: 22px !important; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 12px !important; }
.compatibility-note { margin-top: 14px !important; color: var(--muted) !important; font-size: 12px !important; }
.compatibility-note strong { color: var(--ink); }
.download-status { min-height: 20px; margin-top: 10px !important; color: var(--gold-light) !important; font-size: 12px !important; }
footer { min-height: 58px; padding: 16px clamp(20px, 5vw, 68px); border-top: 1px solid var(--line); color: #887b7e; font-size: 11px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
footer strong { color: #aa8d55; }

@media (max-width: 700px) {
  .topbar { min-height: 76px; padding: 12px 16px; align-items: flex-start; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px; }
  .brand { display: contents; }
  .brand-home { grid-column: 1; grid-row: 1; }
  #brandTagline { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .status-badge { grid-column: 2; grid-row: 1; margin-top: 4px; white-space: nowrap; }
  .wordmark-header { font-size: 37px; }
  .wordmark-header .pram-word { font-size: 33px; }
  .wordmark-hero { font-size: 74px; }
  .wordmark-hero .pram-word { font-size: 66px; }
  .brand > span:last-child { font-size: 9px; line-height: 1.35; }
  .status-badge { margin-top: 4px; white-space: nowrap; }
  .hero { min-height: auto; padding: 48px 0 36px; }
  .sync-icon { width: 128px; height: 128px; margin-top: 25px; }
  
  .advanced-content { padding-inline: 16px; }
  .section-heading, .activity-heading { align-items: flex-start; }
  .segmented { width: 100%; }
  .segment { min-width: 0; white-space: normal; padding: 7px; }
  .settings-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  footer { padding: 14px 16px; }
}
@media (max-height: 700px) and (min-width: 701px) {
  .hero { min-height: auto; padding-top: 38px; }
  .sync-icon { width: 128px; height: 128px; margin-top: 18px; margin-bottom: 12px; }
  
}

