:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --ink: #171713;
  --soft-ink: #69675f;
  --line: rgba(23, 23, 19, 0.18);
  --brass: #987b45;
  --display: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.masthead {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4.6vw, 72px);
  border-bottom: 1px solid var(--line);
  animation: masthead-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wordmark {
  display: grid;
  gap: 1px;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark span:last-child {
  color: var(--brass);
}

.masthead > p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loading-surface,
.mobile-error {
  position: relative;
  min-height: 100svh;
  padding: 122px clamp(24px, 8vw, 128px) 88px;
}

.loading-surface {
  display: flex;
  align-items: center;
}

.session-copy {
  width: min(760px, 100%);
  margin-left: clamp(0px, 5vw, 82px);
  animation: session-in 900ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.eyebrow,
.error-code {
  margin: 0 0 21px;
  color: var(--brass);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.session-copy h1,
.mobile-error h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.session-copy h1 {
  max-width: 690px;
  font-size: clamp(54px, 7.2vw, 104px);
  line-height: 0.92;
}

.loading-status {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: clamp(38px, 5vw, 64px);
}

.precision-spinner {
  width: 17px;
  height: 17px;
  display: block;
  border: 1px solid rgba(23, 23, 19, 0.2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 950ms linear infinite;
}

.loading-label {
  margin: 0;
  color: var(--soft-ink);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.loading-label::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: ellipsis 1.6s steps(4, end) infinite;
}

.page-rule {
  position: relative;
  width: min(600px, 86vw);
  height: 1px;
  margin-top: 28px;
  overflow: hidden;
  background: var(--line);
}

.page-rule span {
  position: absolute;
  width: 24%;
  height: 1px;
  left: -24%;
  top: 0;
  background: var(--brass);
  animation: rule-pass 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.mobile-error {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-inline: clamp(28px, 9vw, 56px);
  text-align: left;
}

.device-signal {
  position: relative;
  width: 54px;
  height: 60px;
  margin-bottom: 35px;
  animation: fault-pulse 3.2s ease-in-out infinite;
}

.device-outline {
  position: absolute;
  width: 30px;
  height: 52px;
  left: 10px;
  top: 4px;
  border: 1px solid rgba(23, 23, 19, 0.66);
  border-radius: 7px;
}

.device-outline::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  background: rgba(23, 23, 19, 0.46);
}

.device-strike {
  position: absolute;
  width: 64px;
  height: 1px;
  left: -5px;
  top: 30px;
  transform: rotate(-44deg);
  background: var(--brass);
}

.mobile-error h1 {
  max-width: 510px;
  font-size: clamp(47px, 14vw, 72px);
  line-height: 0.95;
}

.error-message {
  max-width: 420px;
  margin: 27px 0 0;
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.6;
}

html.is-mobile .loading-surface {
  display: none;
}

html.is-mobile .mobile-error {
  display: flex;
  animation: session-in 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.privacy-note {
  position: fixed;
  z-index: 10;
  left: clamp(24px, 4.6vw, 72px);
  bottom: max(25px, env(safe-area-inset-bottom));
  color: var(--soft-ink);
  animation: note-in 850ms 440ms both;
}

.privacy-note details {
  position: relative;
}

.privacy-note summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: #77746c;
  cursor: pointer;
  list-style: none;
  font-size: 8px;
  font-weight: 620;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.privacy-note summary::-webkit-details-marker {
  display: none;
}

.privacy-note summary::after {
  content: "+";
  color: var(--brass);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}

.privacy-note details[open] summary::after {
  content: "−";
}

.privacy-note summary:hover,
.privacy-note summary:focus-visible {
  color: var(--ink);
  outline: none;
}

.privacy-note p {
  position: absolute;
  width: min(520px, calc(100vw - 48px));
  left: 0;
  bottom: 34px;
  margin: 0;
  padding: 15px 0;
  color: var(--soft-ink);
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  animation: notice-open 220ms ease-out both;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes ellipsis {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

@keyframes masthead-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes session-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes note-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rule-pass {
  0% { transform: translateX(0); }
  55%, 100% { transform: translateX(520%); }
}

@keyframes fault-pulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}

@keyframes notice-open {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .masthead {
    min-height: 78px;
    padding-inline: 24px;
  }

  .masthead > p {
    max-width: 110px;
    text-align: right;
    line-height: 1.4;
  }

  html:not(.is-desktop) .loading-surface {
    display: none;
  }

  html:not(.is-desktop) .mobile-error {
    display: flex;
  }

  .privacy-note {
    left: 24px;
    right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .precision-spinner { animation-duration: 3s; }
  .masthead,
  .session-copy,
  .page-rule span,
  .device-signal,
  .mobile-error,
  .privacy-note { animation: none; }
}
