/* ==========================================================================
   Utility Pages Pack: layout and components
   1. Base   2. Shell (minimal, dark, split)   3. Components   4. Responsive
   ========================================================================== */

/* ---------- 1. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 2. Shell ---------- */
.up { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.up-band { height: 4px; background: var(--gradient); flex: none; }

.up-header, .up-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-inline: var(--gutter);
  flex: none;
}
.up-header { min-height: 80px; }
.up-footer { min-height: 72px; font-size: var(--fs-caption); color: var(--muted); flex-wrap: wrap; }
.up-footer nav { display: flex; gap: var(--s-4); }
.up-footer a { color: var(--muted); text-decoration: none; }
.up-footer a:hover { color: var(--ink); text-decoration: underline; }
.up-header-link { color: var(--muted); font-weight: 600; font-size: var(--fs-small); text-decoration: none; }
.up-header-link:hover { color: var(--ink); }

.up-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.up-logo:hover { color: var(--ink); }
.up-logo svg { width: 32px; height: 32px; flex: none; }
.up-logo .mark-bg { fill: var(--ink); }
.up-logo .mark-fg { stroke: var(--bg); }

.up-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: var(--s-7) var(--gutter);
}
.up--minimal .up-main, .up--dark .up-main { padding-inline: clamp(24px, 11vw, 160px); }

.up-content { display: grid; gap: var(--s-6); justify-items: start; max-width: 900px; }
.up-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: var(--s-9);
  align-items: center;
  width: 100%;
  max-width: 1120px;
}

/* Split style */
.up--split { flex-direction: row; }
.up-panel {
  position: sticky;
  top: 0;
  width: min(42vw, 600px);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  background: var(--panel-bg);
  flex: none;
}
.up-panel .up-logo { color: #E6E9EF; }
.up-panel .up-logo .mark-bg { fill: #E6E9EF; }
.up-panel .up-logo .mark-fg { stroke: var(--panel-bg); }
.up-panel-word {
  font-size: clamp(5rem, 2rem + 9vw, 12.5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
  align-self: flex-start;   /* shrink to the word so the full gradient shows */
  max-width: 100%;
}
.up-panel-word[data-length="long"] { font-size: clamp(3.5rem, 1.5rem + 6vw, 8.5rem); }
.up-panel-caption { color: var(--panel-muted); font-size: var(--fs-caption); }
.up-split-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.up--split .up-main { padding-inline: clamp(24px, 6.5vw, 96px); }
.up--split .up-content { max-width: 640px; }

/* ---------- 3. Components ---------- */

/* Badge */
.up-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-caption);
  font-weight: 600;
}
.up-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.up-badge[data-state="ok"] { color: var(--ok); }
.up-badge[data-state="pulse"]::before { animation: up-pulse 1.4s ease-in-out infinite; }
@keyframes up-pulse { 50% { opacity: 0.25; } }

/* Headings and text */
.up-title { font-size: var(--fs-display); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; max-width: 16ch; text-wrap: balance; }
.up-title--l { font-size: var(--fs-display-l); line-height: 1.04; max-width: 18ch; }
.up-heading { font-size: var(--fs-heading); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; }
.up-lede { font-size: var(--fs-lede); color: var(--muted); line-height: 1.5; max-width: 40ch; }
.up-mono { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--muted); }

/* Giant code numerals (404, 500) */
.up-code {
  font-size: var(--fs-numeral);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: calc(var(--s-3) * -1);
}
.up-code--gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Icons */
.up-icon { width: 56px; height: 56px; color: var(--muted); }
.up-icon--circle { display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.up-icon--circle svg { width: 26px; height: 26px; }

/* Buttons */
.up-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-link {
  margin-left: var(--s-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Text links row */
.up-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin: 0; padding: 0; list-style: none; }
.up-links a { font-weight: 600; font-size: var(--fs-small); text-decoration: none; }
.up-links a:hover { text-decoration: underline; }

/* Inline form (email signup, search) */
.up-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); width: 100%; max-width: 520px; }
.up-field { display: grid; gap: var(--s-2); flex: 1 1 260px; }
.up-field label { font-size: var(--fs-caption); font-weight: 600; }
.up-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.up-field input::placeholder { color: var(--muted); }
.up-field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.up-field input[aria-invalid="true"] { border-color: var(--err); }
.up-form-msg { flex-basis: 100%; font-size: var(--fs-caption); font-weight: 500; min-height: 1.2em; }
.up-form-msg[data-state="error"] { color: var(--err); }
.up-form-msg[data-state="ok"] { color: var(--ok); }

/* Countdown */
.up-countdown { display: grid; grid-template-columns: repeat(4, 148px); gap: var(--s-4); margin: 0; }
.up-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 8px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.up-tile-value { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.up-tile-unit { font-size: var(--fs-caption); color: var(--muted); }
.up-countdown-done { font-weight: 600; color: var(--ok); }

/* Progress bar */
.up-progress { display: grid; gap: var(--s-3); width: 100%; max-width: 640px; }
.up-progress-label { font-size: 1.25rem; font-weight: 600; }
.up-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.up-bar span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: 4px;
  background: var(--gradient);
  background-size: calc(100% / (var(--fraction, 1))) 100%;
  transition: width 0.8s cubic-bezier(.2, .7, .2, 1);
}

/* Milestones (a real sequence) */
.up-steps { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; list-style: none; }
.up-steps li { display: grid; gap: 2px; }
.up-steps strong { font-size: var(--fs-small); font-weight: 600; }
.up-steps span { font-size: var(--fs-caption); color: var(--muted); }
.up-steps [data-state="done"] span { color: var(--ok); }
.up-steps [data-state="current"] span { color: var(--accent); }

/* Card (maintenance return time, order summary) */
.up-card {
  display: grid;
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.up-card-label { font-size: var(--fs-caption); font-weight: 600; color: var(--muted); }
.up-card-value { font-size: var(--fs-display-l); font-weight: 800; line-height: 1.04; letter-spacing: -0.02em; }
.up-card-meta { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-caption); color: var(--muted); }
.up-card--inline { max-width: 480px; padding: var(--s-5) var(--s-6); }
.up-card--inline .up-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.up-card--inline .up-card-value { font-size: 1.25rem; font-weight: 600; letter-spacing: 0; }

.up-summary { margin: 0; padding-block: var(--s-2); }
.up-summary div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 14px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.up-summary div:last-child { border-bottom: 0; }
.up-summary dt { color: var(--muted); }
.up-summary dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- 4. Responsive ---------- */
@media (max-width: 1100px) {
  .up-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .up-grid .up-card { max-width: 480px; }
}

@media (max-width: 960px) {
  .up--split { flex-direction: column; }
  .up-panel {
    position: static;
    width: 100%;
    height: auto;
    gap: var(--s-6);
    padding: var(--s-5) var(--gutter) var(--s-6);
  }
  .up-panel-word { font-size: clamp(4rem, 18vw, 7rem); }
  .up-panel-word[data-length="long"] { font-size: clamp(3rem, 13vw, 5rem); }
}

@media (max-width: 720px) {
  .up-header { min-height: 64px; }
  .up-header-link { display: none; }
  .up-footer { justify-content: flex-start; padding-block: var(--s-4); }
  .up-main { padding-block: var(--s-6); align-items: flex-start; }
  .up-content { gap: var(--s-5); }
  .up-countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); width: 100%; }
  .up-tile { padding: 14px 4px 12px; }
  .up-tile-value { font-size: 1.9rem; }
  .up-form .btn, .up-actions .btn { width: 100%; }
  .up-actions { width: 100%; }
  .up-card { padding: var(--s-5); }
}

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