:root {
  --paper: #f6f2e9;
  --paper-deep: #ece5d7;
  --ink: #19231f;
  --muted: #66716b;
  --line: #d4d0c6;
  --orange: #c8572f;
  --orange-dark: #923c25;
  --orange-soft: #f1d7ca;
  --olive: #56624b;
  --cream: #fffdf8;
  --shadow: 0 18px 50px rgba(38, 42, 34, 0.08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(200, 87, 47, 0.06), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1.5px solid var(--orange);
  border-radius: 50%; color: var(--orange); font-family: Georgia, serif; font-size: 21px; font-weight: 700;
}
.brand-name, .brand-subtitle { display: block; line-height: 1; }
.brand-name { font-family: Georgia, serif; font-size: 19px; letter-spacing: -0.02em; }
.brand-subtitle { margin-top: 5px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: 0.15em; }
.topbar-note { color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.02em; }
.live-dot, .status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--olive); vertical-align: 1px; }

.hero { min-height: 385px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 72px 36px 64px; }
.hero-copy { max-width: 680px; }
.eyebrow { margin: 0 0 15px; color: var(--orange); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: 0.12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-family: Georgia, serif; font-size: clamp(48px, 7.2vw, 86px); font-weight: 400; letter-spacing: -0.055em; line-height: 0.93; }
h1 em { color: var(--orange); font-style: normal; }
.hero-lede { max-width: 565px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-seal { position: relative; flex: 0 0 auto; width: 154px; height: 154px; display: grid; place-items: center; color: var(--orange); transform: rotate(8deg); }
.seal-ring { position: absolute; inset: 0; border: 1px solid var(--orange); border-radius: 50%; }
.seal-ring::before, .seal-ring::after { content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(200, 87, 47, 0.6); border-radius: 50%; }
.seal-ring::after { inset: 25px; border-style: solid; opacity: 0.55; }
.seal-text { z-index: 1; font-family: "DM Mono", monospace; font-size: 10px; line-height: 1.45; letter-spacing: 0.16em; text-align: center; }

.control-panel, .mission-panel, .links-section, .how-section { border-top: 1px solid var(--line); padding: 42px 36px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: clamp(28px, 4vw, 42px); font-weight: 400; letter-spacing: -0.045em; line-height: 1; }
.status-pill, .count-badge, .clock-label { display: inline-flex; align-items: center; height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field-wide { grid-column: span 1; }
.field-label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.hint { margin-left: 5px; color: var(--orange); font-family: "DM Mono", monospace; font-size: 9px; font-weight: 400; }
input[type="url"] { width: 100%; height: 47px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 253, 248, 0.55); color: var(--ink); outline: none; padding: 0 13px; font-family: "DM Mono", monospace; font-size: 11px; transition: border-color 160ms ease-out, box-shadow 160ms ease-out; }
input[type="url"]:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(200, 87, 47, 0.12); }
.field-help { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.date-picker { display: flex; gap: 8px; }
.date-option { flex: 1; min-width: 0; position: relative; }
.date-option input { position: absolute; opacity: 0; pointer-events: none; }
.date-option label { display: flex; min-height: 47px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 253, 248, 0.55); color: var(--muted); cursor: pointer; transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out; }
.date-option label:active { transform: scale(0.97); }
.date-option input:checked + label { border-color: var(--orange); background: var(--orange); color: #fff8ef; }
.date-option input:focus-visible + label { outline: 3px solid rgba(200, 87, 47, 0.23); outline-offset: 2px; }
.date-day { font-family: "DM Mono", monospace; font-size: 10px; }
.date-number { margin-top: 2px; font-size: 16px; font-weight: 800; line-height: 1; }
.rule-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.65; }
.rule-icon { display: inline-grid; flex: 0 0 auto; width: 17px; height: 17px; place-items: center; border: 1px solid var(--orange); border-radius: 50%; color: var(--orange); font-family: Georgia, serif; font-size: 12px; }

.mission-panel { position: sticky; top: 12px; z-index: 4; overflow: hidden; background: var(--ink); color: #f6f2e9; box-shadow: 0 16px 38px rgba(25, 35, 31, 0.16); }
.mission-panel::after { content: ""; position: absolute; right: -80px; bottom: -170px; width: 450px; height: 450px; border: 1px solid rgba(246, 242, 233, 0.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(246, 242, 233, 0.025), 0 0 0 70px rgba(246, 242, 233, 0.02); }
.mission-panel .eyebrow { color: #eea184; }
.mission-panel h2 { color: #f6f2e9; }
.mission-panel .clock-label { border-color: rgba(246, 242, 233, 0.2); color: rgba(246, 242, 233, 0.68); }
.mission-body { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.next-window-label { color: #eea184; font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: 0.05em; }
.next-window-time { margin: 8px 0 9px; font-family: "DM Mono", monospace; font-size: clamp(32px, 6vw, 65px); letter-spacing: -0.06em; line-height: 1; }
.next-window-meta { margin-bottom: 0; color: rgba(246, 242, 233, 0.65); font-size: 12px; }
.countdown-block { min-width: 238px; padding: 17px 18px 14px; border: 1px solid rgba(246, 242, 233, 0.2); border-radius: 10px; }
.countdown-caption { display: block; color: rgba(246, 242, 233, 0.57); font-size: 10px; }
.countdown-block strong { display: block; margin-top: 6px; color: #f6f2e9; font-family: "DM Mono", monospace; font-size: 27px; font-weight: 400; letter-spacing: -0.05em; }

.links-section { padding-bottom: 60px; }
.links-heading { align-items: center; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.button { min-height: 36px; padding: 0 13px; border-radius: 7px; border: 1px solid transparent; font-size: 11px; font-weight: 800; transition: transform 140ms ease-out, background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out; }
.button:active { transform: scale(0.97); }
.button:focus-visible { outline: 3px solid rgba(200, 87, 47, 0.25); outline-offset: 2px; }
.button-primary { background: var(--orange); color: #fffaf3; }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button-secondary:hover { border-color: var(--orange); color: var(--orange); }
.section-intro { max-width: 700px; margin: -8px 0 27px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.link-board { display: grid; gap: 25px; }
.day-group { display: grid; gap: 12px; }
.day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.day-heading h3 { margin-bottom: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 400; letter-spacing: -0.03em; }
.day-heading span { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; }
.ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ticket-card { position: relative; display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 16px; min-height: 100px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 253, 248, 0.42); transition: border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.ticket-card:hover { border-color: rgba(200, 87, 47, 0.55); background: var(--cream); }
.ticket-card.is-next { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(200, 87, 47, 0.1); }
.ticket-card.is-next::before { content: "NEXT"; position: absolute; top: -8px; left: 13px; padding: 2px 6px; background: var(--orange); color: #fff8ef; font-family: "DM Mono", monospace; font-size: 8px; letter-spacing: 0.08em; }
.ticket-time { font-family: "DM Mono", monospace; font-size: 24px; letter-spacing: -0.07em; }
.ticket-type { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 6px; padding: 3px 6px; border-radius: 4px; background: var(--paper-deep); color: var(--olive); font-family: "DM Mono", monospace; font-size: 9px; }
.ticket-type.attico { background: #dfe5dc; color: var(--olive); }
.ticket-meta { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ticket-path { display: block; max-width: 100%; margin-top: 7px; overflow-wrap: anywhere; color: var(--orange-dark); font-family: "DM Mono", monospace; font-size: 8px; line-height: 1.45; }
.ticket-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.ticket-action { min-width: 62px; height: 29px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font-size: 10px; font-weight: 800; transition: transform 140ms ease-out, border-color 160ms ease-out, color 160ms ease-out, background 160ms ease-out; }
.ticket-action:hover { border-color: var(--orange); color: var(--orange); }
.ticket-action:active { transform: scale(0.97); }
.ticket-action.primary { border-color: var(--orange); background: var(--orange); color: #fff8ef; }
.ticket-action.primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }
.ticket-action:focus-visible { outline: 3px solid rgba(200, 87, 47, 0.22); outline-offset: 2px; }

.how-section { padding-bottom: 50px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how-card { min-height: 175px; padding: 22px; border-radius: 9px; background: var(--paper-deep); }
.step-number { color: var(--orange); font-family: "DM Mono", monospace; font-size: 10px; }
.how-card h3 { margin: 30px 0 8px; font-size: 15px; }
.how-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 36px 32px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; line-height: 1.6; letter-spacing: 0.02em; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(360px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid rgba(246, 242, 233, 0.15); border-radius: 7px; background: var(--ink); color: #f6f2e9; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 32px, 620px); }
  .topbar { min-height: 72px; }
  .topbar-note { font-size: 9px; }
  .hero { min-height: auto; padding: 56px 0 53px; }
  .hero-seal { width: 122px; height: 122px; }
  .hero-lede { font-size: 13px; }
  .control-panel, .mission-panel, .links-section, .how-section { padding-right: 0; padding-left: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .mission-panel { top: 8px; }
  .mission-body { align-items: stretch; flex-direction: column; }
  .countdown-block { min-width: 0; }
  .links-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .ticket-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .how-card { min-height: 0; }
  .how-card h3 { margin-top: 18px; }
  .footer { padding: 18px 0 30px; flex-direction: column; gap: 7px; }
}

@media (max-width: 480px) {
  .page-shell { width: min(100% - 24px, 620px); }
  .topbar-note { display: none; }
  h1 { font-size: clamp(45px, 15vw, 67px); }
  .hero { gap: 15px; padding-top: 48px; }
  .hero-seal { width: 88px; height: 88px; }
  .seal-text { font-size: 7px; }
  .hero-lede { font-size: 12px; line-height: 1.65; }
  .mission-panel { top: 6px; padding-top: 28px; padding-bottom: 28px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .mission-heading { flex-direction: row; align-items: center; }
  .date-picker { gap: 5px; }
  .date-option label { min-height: 44px; }
  .ticket-card { grid-template-columns: 78px 1fr; gap: 10px; padding: 13px; }
  .ticket-time { font-size: 21px; }
  .ticket-actions { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
  .ticket-action { flex: 1; }
  .countdown-block strong { font-size: 24px; }
}

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