/* UltraHosting — shared styles */

:root {
  --paper: #faf7f2;
  --paper-2: #f1ece3;
  --ink: #211e1a;
  --ink-soft: #5c564d;
  --line: #ddd5c8;
  --accent: #c0533e;
  --accent-ink: #ffffff;
  --card: #ffffff;
  --good: #2e7d4f;
  --shadow: 0 1px 3px rgba(33, 30, 26, 0.08), 0 6px 20px rgba(33, 30, 26, 0.06);
  --radius: 10px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191713;
    --paper-2: #211e19;
    --ink: #e9e4da;
    --ink-soft: #a89f92;
    --line: #383329;
    --accent: #d96a54;
    --accent-ink: #1c1a16;
    --card: #232019;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin-top: 2em; }
h3 { font-size: 1.2rem; margin-top: 1.5em; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 1.25rem;
  max-width: 62rem;
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand .ultra { color: var(--accent); }

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a.active { background: var(--ink); color: var(--paper); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Hero */
.hero { padding: 3.5rem 0 1rem; }
.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: 24ch; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; }

/* Cards */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin: 1.5rem 0; }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

a.card { text-decoration: none; color: inherit; display: block; transition: transform 0.12s ease, border-color 0.12s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }

.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.card .meta { color: var(--ink-soft); font-size: 0.92rem; }

/* Palette move cards */
.move-card { border-top: 4px solid var(--move-color, var(--accent)); }
.move-card .stems { margin: 0.6rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.95rem; }
.move-card .stems li { margin-bottom: 0.3rem; font-style: italic; }

.chip {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.chip.move { color: #fff; border: none; background: var(--move-color, var(--accent)); }
@media (prefers-color-scheme: dark) {
  .chip.move { color: #fff; }
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 2rem; font-size: 0.96rem; }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
td em { color: var(--ink-soft); }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { font-size: 1.15rem; padding: 0.7rem 1.6rem; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }

/* Forms */
input[type="text"], input[type="number"], textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  width: 100%;
}
textarea { min-height: 5.5rem; resize: vertical; }
label { font-weight: 600; font-size: 0.92rem; display: block; margin: 0.9rem 0 0.3rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 8rem; }

/* Drill stage */
.stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  margin: 1.5rem 0;
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stage .prompt {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.35;
  flex: 1;
}

.stage .prompt .sub { font-family: var(--font-body); font-size: 1rem; color: var(--ink-soft); margin-top: 0.8rem; }

.stage .round-label { font-size: 0.85rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

.timebar { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.timebar .fill { height: 100%; background: var(--accent); border-radius: 999px; width: 100%; }

.reveal {
  border-left: 3px solid var(--good);
  padding: 0.5rem 1rem;
  background: var(--paper-2);
  border-radius: 0 8px 8px 0;
  font-size: 0.98rem;
}

.reflection { max-width: 40rem; }

.done-check { color: var(--good); font-weight: 700; }

/* Big deal cards (Palette Draw) */
.deal-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1.5rem 0; }
.deal-card {
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem 1.1rem;
  color: #fff;
  background: var(--move-color, var(--accent));
  box-shadow: var(--shadow);
  min-height: 11rem;
  display: flex;
  flex-direction: column;
}
.deal-card h3 { color: #fff; margin: 0 0 0.4rem; }
.deal-card p { font-size: 0.92rem; margin: 0 0 0.6rem; opacity: 0.94; }
.deal-card .stem { font-style: italic; font-size: 0.9rem; opacity: 0.88; margin-top: auto; }
.deal-card.used { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Timer tool */
.timer-total {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin: 0.5rem 0;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 0.6rem;
  cursor: pointer;
  user-select: none;
}
.person-row.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.person-row .name { font-weight: 700; min-width: 7rem; }
.person-row .clock { font-variant-numeric: tabular-nums; font-size: 1.2rem; min-width: 5.2rem; }
.person-row .share-track { flex: 1; height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.person-row .share-fill { height: 100%; background: var(--accent); border-radius: 999px; width: 0; transition: width 0.3s linear; }
.person-row .pct { min-width: 3.2rem; text-align: right; color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.person-row .remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; padding: 0.2rem; }
.person-row .remove:hover { color: var(--accent); }
.person-row.over .share-fill { background: var(--move-color, #b3261e); }

/* Silence ring */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem 0; }
.ring { transform: rotate(-90deg); }
.ring .track { stroke: var(--paper-2); }
.ring .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.ring-label {
  font-family: var(--font-display);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

/* Learn pages */
.learn-body h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.standard {
  border-left: 3px solid var(--accent);
  padding: 0.7rem 1.1rem;
  background: var(--paper-2);
  border-radius: 0 8px 8px 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 1.5rem 0;
}
.crosslink { font-size: 0.92rem; color: var(--ink-soft); }

/* Utility */
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

details { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem; margin: 0.6rem 0; background: var(--card); }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 0.5rem; }

.notice {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.notice.ok { border-color: var(--good); }

@media (max-width: 40rem) {
  .site-header .bar { gap: 0.6rem; }
  .person-row .name { min-width: 5rem; }
  .person-row .pct { display: none; }
}
