/* Standup Brief — design identity: a calm "morning briefing".
   Warm paper, editorial serif display, a sunrise-coral accent. Self-contained:
   system font stacks only, no external fonts or assets. Not a terminal look. */

:root {
  --paper: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #f1ebe0;
  --ink: #26232b;
  --muted: #726c76;
  --faint: #9a949e;
  --line: #e7e0d5;
  --accent: #db5427;   /* sunrise coral */
  --accent-soft: #f6e3d8;
  --gold: #b8841a;
  --plum: #8a4b7a;
  --shadow: 0 1px 2px rgba(38, 35, 43, .04), 0 10px 30px rgba(38, 35, 43, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16141a;
    --surface: #1e1b23;
    --surface-2: #26222c;
    --ink: #ece7e0;
    --muted: #9a949e;
    --faint: #6e6873;
    --line: #2c2833;
    --accent: #f0764f;
    --accent-soft: #3a2418;
    --gold: #e0a94a;
    --plum: #c98fbb;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sunrise {
  height: 5px;
  background: linear-gradient(90deg, var(--gold), var(--accent) 55%, var(--plum));
}

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1.4rem; }

/* ---- Masthead ---- */
.masthead { padding: 2.4rem 0 1.6rem; border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.brandline { display: flex; align-items: center; gap: .85rem; }
.mark {
  display: grid; place-items: center; width: 3rem; height: 3rem; flex: none;
  color: var(--accent); background: var(--accent-soft); border-radius: 12px;
}
.kicker { margin: 0 0 .15rem; text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 700; color: var(--accent); }
.wordmark { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.01em; line-height: 1; }
.dateline { text-align: right; }
.greeting { margin: 0; font-family: var(--serif); font-size: 1.1rem; font-style: italic; color: var(--ink); }
.date-full { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* ---- Layout ---- */
.layout { display: grid; grid-template-columns: 1fr; gap: 1.4rem; padding: 1.6rem 0 3.5rem; }
@media (min-width: 860px) { .layout { grid-template-columns: 1fr 17rem; align-items: start; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.5rem 1.7rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .7rem; margin-bottom: .3rem; }
.panel-title { margin: 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.panel-meta { display: flex; align-items: center; gap: .8rem; }
.updated { color: var(--faint); font-size: .78rem; font-variant-numeric: tabular-nums; }

.btn-refresh {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font: inherit; font-size: .8rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .7rem; transition: color .15s, border-color .15s, background .15s;
}
.btn-refresh:hover { color: var(--accent); border-color: var(--accent); }
.btn-refresh svg { transition: transform .5s ease; }
.btn-refresh.spin svg { transform: rotate(360deg); }

/* ---- Brief content: editorial sections ---- */
.brief-body { padding-top: .4rem; }
.brief-section { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.brief-section:first-child { border-top: none; padding-top: .7rem; }
.brief-h {
  display: flex; align-items: center; gap: .55rem; margin: 0 0 .55rem;
  font-family: var(--sans); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .11em; color: var(--muted);
}
.brief-h::before { content: ""; width: .5rem; height: .5rem; border-radius: 2px; background: var(--accent); flex: none; }
.s-shipped  .brief-h::before { background: var(--gold); }
.s-pending  .brief-h::before { background: var(--plum); }
.s-calendar .brief-h::before { background: var(--accent); }
.s-todo     .brief-h { color: var(--ink); font-size: .8rem; }
.s-todo     .brief-h::before { background: var(--accent); width: .6rem; height: .6rem; border-radius: 50%; }

.brief-section ul { margin: .2rem 0; padding-left: 1.15rem; }
.brief-section li { margin: .3rem 0; }
.brief-section p { margin: .45rem 0; }
.brief-section a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.brief-section a:hover { border-bottom-color: currentColor; }
.brief-section em { color: var(--muted); font-style: italic; }
.brief-section strong { font-weight: 650; }

.back-link { display: inline-flex; align-items: center; margin: 0 0 .5rem; background: none; border: none; cursor: pointer; color: var(--accent); font: inherit; font-size: .85rem; padding: 0; }
.back-link:hover { text-decoration: underline; }

/* ---- States ---- */
.state { padding: 1.4rem 0 1.2rem; }
.state h3 { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 0 0 .4rem; }
.state p { color: var(--muted); margin: .3rem 0 0; max-width: 42rem; }
.state.pending { border-left: 3px solid var(--gold); padding-left: 1.1rem; }
.state.error { border-left: 3px solid var(--accent); padding-left: 1.1rem; }

/* Loading skeleton */
.skeleton { padding: .8rem 0; }
.skeleton span {
  display: block; height: .85rem; margin: .8rem 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.skeleton span:nth-child(1) { width: 45%; }
.skeleton span:nth-child(2) { width: 90%; }
.skeleton span:nth-child(3) { width: 80%; }
.skeleton span:nth-child(4) { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } .btn-refresh svg { transition: none; } }

/* ---- History ---- */
.history-list { list-style: none; margin: .3rem 0 0; padding: 0; }
.history-list li.muted { color: var(--muted); font-size: .88rem; padding: .4rem .1rem; }
.history-list button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  text-align: left; background: none; border: none; cursor: pointer; color: var(--ink);
  font: inherit; font-size: .9rem; padding: .5rem .5rem; border-radius: 9px;
  font-variant-numeric: tabular-nums; transition: background .12s, color .12s;
}
.history-list button:hover { background: var(--accent-soft); color: var(--accent); }
.history-list button[aria-current="true"] { color: var(--accent); font-weight: 600; }
.pill { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .45rem; }

.muted { color: var(--muted); }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--line); padding: 1.2rem 0 2.5rem; }
.foot-inner { color: var(--faint); font-size: .8rem; }
