/* ==========================================================================
   Maintenance Page — Swiss / Editorial Restraint
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F3EE;
  --ink: #171614;
  --ink-secondary: #4D4A44;
  --ink-muted: #7A766E;
  --rule: rgba(23, 22, 20, 0.14);
  --rule-strong: rgba(23, 22, 20, 0.34);
  --accent: #9A3412;
  --btn-bg: #171614;
  --btn-bg-hover: #2E2C28;
  --btn-fg: #F5F3EE;
  --surface-hover: rgba(23, 22, 20, 0.045);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121210;
  --ink: #EDEAE2;
  --ink-secondary: #B4B0A6;
  --ink-muted: #7F7B72;
  --rule: rgba(237, 234, 226, 0.13);
  --rule-strong: rgba(237, 234, 226, 0.32);
  --accent: #D97757;
  --btn-bg: #EDEAE2;
  --btn-bg-hover: #FFFFFF;
  --btn-fg: #121210;
  --surface-hover: rgba(237, 234, 226, 0.06);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Page Shell — Asymmetric Editorial Framing */
.shell {
  min-height: 100dvh;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--rule);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.meta-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  margin-right: -10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-muted);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.theme-switch:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.theme-switch:focus-visible,
.action-btn:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
}

.theme-switch svg {
  width: 14px;
  height: 14px;
}

[data-theme="light"] .icon-sun,
[data-theme="light"] .theme-label-dark,
[data-theme="dark"] .icon-moon,
[data-theme="dark"] .theme-label-light {
  display: none;
}

/* Main Content */
.content {
  padding: clamp(44px, 9vh, 88px) 0 clamp(40px, 8vh, 72px);
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

h1 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 5.2vw, 3.45rem);
  font-weight: 400;
  line-height: 1.09;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 16ch;
  margin-bottom: 24px;
}

h1 em {
  font-style: italic;
  font-weight: 400;
}

.message {
  font-size: clamp(1rem, 1.5vw, 1.09rem);
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 52ch;
}

.message strong {
  color: var(--ink);
  font-weight: 500;
}

sup {
  font-size: 0.65em;
  line-height: 0;
  vertical-align: super;
}

/* Architectural Specification Strip */
.spec-grid {
  position: relative;
  margin-top: clamp(32px, 5vh, 48px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.spec-cell {
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spec-cell + .spec-cell {
  padding-left: 22px;
  border-left: 1px solid var(--rule);
}

.spec-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.spec-label svg {
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.spec-value {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.spec-value--mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.mono-note {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 3px;
}

/* Hairline progress embedded directly on bottom border */
.spec-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  pointer-events: none;
}

.spec-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width 0.6s ease;
}

/* Actions Row */
.actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--btn-bg);
  border-radius: 3px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.action-btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.4s ease;
}

.action-btn:hover .action-icon {
  transform: rotate(90deg);
}

.action-btn.is-spinning .action-icon {
  animation: spin 0.65s linear infinite;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.hint svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Footer */
.colophon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.colophon-meta {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  letter-spacing: 0.03em;
}

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

/* Responsive */
@media (max-width: 660px) {
  .masthead {
    padding: 20px 0 16px;
  }

  .content {
    padding: 36px 0 36px;
  }

  h1 {
    max-width: none;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-cell {
    padding: 16px 0;
  }

  .spec-cell + .spec-cell {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .colophon {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 0 24px;
  }
}

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