/* A Smarter Day — desk-card design system.
 * One dominant paper card on a deep navy desk. Calm, tactile, focused.
 * Fraunces (display serif) + Rubik (UI). WCAG 2.2 AA targets throughout. */

:root {
  --sd-navy: #041e42;
  --sd-navy-2: #0a2a55;
  --sd-desk-line: rgba(120, 180, 205, 0.07);
  --sd-paper: #fdf9f0;
  --sd-paper-edge: #f1e9d8;
  --sd-slip: #f6efdf;
  --sd-ink: #17223a;
  --sd-ink-soft: #4a5468;
  --sd-teal: #0e7c86;
  --sd-teal-deep: #0a5b63;
  --sd-lake: #155e9c;
  --sd-amber: #a3611b;
  --sd-cream-text: #e8ecf4;
  --sd-cream-dim: #a9b6cc;
  --sd-focus: #35b5c2;
  --sd-radius: 18px;
  --sd-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sd-sans: "Rubik", "Segoe UI", -apple-system, sans-serif;
  --sd-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body.sd-body {
  font-family: var(--sd-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--sd-ink);
  background-color: var(--sd-navy);
  /* faint lake-swell lines across the desk */
  background-image:
    repeating-radial-gradient(ellipse 1200px 500px at 50% -200px,
      transparent 0 79px, var(--sd-desk-line) 79px 81px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- skip link + focus ---------- */
.sd-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--sd-paper); color: var(--sd-ink);
  padding: 0.6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.sd-skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--sd-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- header ---------- */
.sd-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem;
  max-width: 60rem; margin: 0 auto; width: 100%;
}
.sd-brand {
  display: flex; align-items: baseline; gap: 0.55rem;
  text-decoration: none; color: var(--sd-cream-text);
  margin-right: auto;
}
.sd-brand-mark { width: 1.7rem; height: 1.7rem; align-self: center; flex: none; }
.sd-brand-name {
  font-family: var(--sd-serif);
  font-weight: 600; font-size: 1.25rem; letter-spacing: 0.01em;
}
.sd-brand-from { font-size: 0.78rem; color: var(--sd-cream-dim); letter-spacing: 0.02em; }
.sd-dot { color: var(--sd-focus); }

.sd-nav { display: flex; gap: 0.25rem; }
.sd-nav a {
  color: var(--sd-cream-dim); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
  padding: 0.45rem 0.8rem; border-radius: 999px;
}
.sd-nav a:hover { color: var(--sd-cream-text); background: rgba(255,255,255,0.07); }
.sd-nav a[aria-current="page"] {
  color: var(--sd-navy); background: var(--sd-cream-text);
}

/* ---------- main / deck ---------- */
.sd-main {
  flex: 1;
  width: 100%; max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.sd-deck { position: relative; margin-top: 1rem; }
/* the stack: two cards resting beneath today's */
.sd-deck::before, .sd-deck::after {
  content: ""; position: absolute; inset: 0;
  background: var(--sd-paper-edge);
  border-radius: var(--sd-radius);
  z-index: 0;
}
.sd-deck::before { transform: rotate(-1.1deg) translateY(7px); opacity: 0.5; }
.sd-deck::after  { transform: rotate(0.8deg) translateY(4px); opacity: 0.7; }

.sd-card {
  position: relative; z-index: 1;
  background: var(--sd-paper);
  border-radius: var(--sd-radius);
  padding: 1.75rem 1.6rem 1.6rem;
  box-shadow:
    0 1px 2px rgba(2, 12, 27, 0.35),
    0 12px 32px rgba(2, 12, 27, 0.45);
  /* paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.17 0 0 0 0 0.1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: sd-settle 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes sd-settle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sd-card { animation: none; }
  * { transition: none !important; }
}

.sd-card-top {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.4rem 1rem;
  margin-bottom: 1.1rem;
}
.sd-dateline {
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sd-ink-soft);
}
.sd-pillar {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border: 1.5px solid currentColor; border-radius: 999px;
  /* a hair of stamp rotation */
  transform: rotate(-1deg);
}
.sd-pillar--do-this            { color: var(--sd-teal-deep); }
.sd-pillar--think-better       { color: var(--sd-lake); }
.sd-pillar--know-the-limits    { color: var(--sd-amber); }
.sd-pillar--make-something     { color: #b2503d; }
.sd-pillar--work-smarter       { color: #2e7d4f; }
.sd-pillar--behind-the-curtain { color: #6247aa; }
.sd-pillar--human-advantage    { color: #8a6d1d; }

.sd-title {
  font-family: var(--sd-serif);
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--sd-ink);
  margin-bottom: 0.8rem;
  text-wrap: balance;
}
.sd-lead {
  font-size: 1.12rem; line-height: 1.55;
  color: var(--sd-ink-soft);
  margin-bottom: 1.4rem;
  max-width: 38rem;
}

/* ---------- the action slip ---------- */
.sd-action {
  background: var(--sd-slip);
  border: 1px dashed rgba(23, 34, 58, 0.35);
  border-radius: 10px;
  padding: 1.1rem 1.1rem 0.9rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.sd-action::before {
  content: "";
  position: absolute; top: -9px; left: 50%;
  width: 74px; height: 18px; transform: translateX(-50%) rotate(-1.5deg);
  background: rgba(14, 124, 134, 0.18);
  border-left: 1px solid rgba(255,255,255,0.5);
  border-right: 1px solid rgba(255,255,255,0.5);
  /* a piece of tape holding the slip on */
}
.sd-action-text {
  font-family: var(--sd-mono);
  font-size: 0.95rem; line-height: 1.65;
  white-space: pre-wrap;
  color: var(--sd-ink);
  margin-bottom: 0.9rem;
  user-select: all;
}

/* ---------- buttons ---------- */
.sd-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--sd-sans); font-size: 0.92rem; font-weight: 600;
  color: var(--sd-ink);
  background: transparent;
  border: 1.5px solid rgba(23, 34, 58, 0.4);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
  min-height: 44px;
}
.sd-btn svg { width: 1em; height: 1em; }
.sd-btn:hover { background: rgba(23, 34, 58, 0.06); }
.sd-btn:active { transform: translateY(1px); }
.sd-btn--primary {
  background: var(--sd-navy); color: var(--sd-paper);
  border-color: var(--sd-navy);
}
.sd-btn--primary:hover { background: var(--sd-navy-2); }
.sd-btn--done, .sd-btn--primary.sd-btn--done {
  background: var(--sd-teal-deep); border-color: var(--sd-teal-deep); color: #fff;
}
.sd-btn--active { border-color: var(--sd-teal-deep); color: var(--sd-teal-deep); }
.sd-btn--quiet { border-color: transparent; color: var(--sd-ink-soft); }
.sd-copy-status {
  font-size: 0.85rem; font-weight: 500; color: var(--sd-teal-deep);
  margin-left: 0.6rem;
}

/* ---------- card sections ---------- */
.sd-why h2, .sd-watchout h2, .sd-example h2, .sd-related h2 {
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sd-ink-soft);
  margin-bottom: 0.35rem;
}
.sd-why, .sd-example { margin-bottom: 1.25rem; max-width: 38rem; }
.sd-watchout {
  border-left: 3px solid var(--sd-amber);
  padding-left: 0.9rem;
  margin-bottom: 1.25rem; max-width: 38rem;
}
.sd-watchout h2 { color: var(--sd-amber); }

.sd-card-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  border-top: 1px solid rgba(23, 34, 58, 0.12);
  padding-top: 1.1rem;
}
.sd-permalink {
  font-size: 0.85rem; color: var(--sd-ink-soft); margin-top: 1rem;
}
.sd-permalink a { color: var(--sd-teal-deep); }

/* ---------- related ---------- */
.sd-related { margin-top: 1.75rem; }
.sd-related h2 { color: var(--sd-cream-dim); }
.sd-related-link {
  display: block;
  background: rgba(253, 249, 240, 0.06);
  border: 1px solid rgba(253, 249, 240, 0.18);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.sd-related-link:hover { background: rgba(253, 249, 240, 0.12); }
.sd-related-link .sd-pillar { background: var(--sd-paper); transform: none; font-size: 0.65rem; }
.sd-related-title {
  display: block; font-family: var(--sd-serif);
  font-size: 1.15rem; font-weight: 600; color: var(--sd-cream-text);
  margin: 0.45rem 0 0.2rem;
}
.sd-related-lead { display: block; font-size: 0.9rem; color: var(--sd-cream-dim); }

.sd-tomorrow {
  text-align: center; font-size: 0.9rem; color: var(--sd-cream-dim);
  margin-top: 1.75rem;
}
.sd-tomorrow a { color: var(--sd-focus); }

/* ---------- install nudge ---------- */
.sd-install[hidden] { display: none; }
.sd-install {
  margin-top: 1.5rem;
  background: rgba(253, 249, 240, 0.06);
  border: 1px solid rgba(253, 249, 240, 0.18);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: var(--sd-cream-text);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
}
.sd-install p { flex: 1 1 16rem; font-size: 0.92rem; }
.sd-install .sd-btn { color: var(--sd-cream-text); border-color: rgba(253,249,240,0.4); }
.sd-install .sd-btn:hover { background: rgba(253,249,240,0.1); }
.sd-install .sd-btn--quiet { border-color: transparent; color: var(--sd-cream-dim); }

/* ---------- page head (browse/saved/about) ---------- */
.sd-pagehead { margin: 1rem 0 1.5rem; color: var(--sd-cream-text); }
.sd-pagehead h1 {
  font-family: var(--sd-serif); font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 600; margin-bottom: 0.4rem;
}
.sd-pagehead p { color: var(--sd-cream-dim); max-width: 34rem; }

/* ---------- browse ---------- */
.sd-browse-controls { margin-bottom: 1.25rem; }
.sd-search-label { position: absolute; left: -9999px; }
.sd-search {
  width: 100%; max-width: 26rem;
  font: inherit; color: var(--sd-ink);
  background: var(--sd-paper);
  border: none; border-radius: 10px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.9rem;
}
.sd-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sd-filter {
  font-family: var(--sd-sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sd-cream-dim);
  background: transparent;
  border: 1.5px solid rgba(253, 249, 240, 0.3);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  min-height: 36px;
}
.sd-filter:hover { color: var(--sd-cream-text); border-color: rgba(253,249,240,0.55); }
.sd-filter[aria-pressed="true"] {
  background: var(--sd-cream-text); color: var(--sd-navy); border-color: var(--sd-cream-text);
}

.sd-browse-list { list-style: none; display: grid; gap: 0.75rem; }
.sd-browse-item a {
  display: block;
  background: var(--sd-paper);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(2, 12, 27, 0.35);
  transition: transform 0.12s ease;
}
.sd-browse-item a:hover { transform: translateY(-2px); }
.sd-browse-item .sd-pillar { transform: none; font-size: 0.62rem; }
.sd-browse-title {
  display: block; font-family: var(--sd-serif);
  font-size: 1.15rem; font-weight: 600; color: var(--sd-ink);
  margin: 0.45rem 0 0.15rem;
}
.sd-browse-lead { display: block; font-size: 0.9rem; color: var(--sd-ink-soft); }
.sd-browse-empty { color: var(--sd-cream-dim); }

.sd-saved-empty {
  color: var(--sd-cream-dim);
  background: rgba(253, 249, 240, 0.05);
  border: 1px dashed rgba(253, 249, 240, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
}
.sd-saved-empty a { color: var(--sd-focus); }
.sd-saved-empty p + p { margin-top: 0.5rem; }

/* ---------- prose (about/offline) ---------- */
.sd-prose {
  background: var(--sd-paper);
  border-radius: var(--sd-radius);
  padding: 1.6rem;
  box-shadow: 0 12px 32px rgba(2, 12, 27, 0.45);
}
.sd-prose h2 {
  font-family: var(--sd-serif); font-size: 1.3rem; font-weight: 600;
  margin: 1.3rem 0 0.4rem;
}
.sd-prose h2:first-child { margin-top: 0; }
.sd-prose p, .sd-prose ul { margin-bottom: 0.8rem; max-width: 40rem; }
.sd-prose ul { padding-left: 1.2rem; }
.sd-prose a { color: var(--sd-teal-deep); }
.sd-prose .sd-btn { margin-right: 0.5rem; }

/* ---------- footer ---------- */
.sd-footer {
  text-align: center;
  padding: 2.25rem 1.25rem 2.5rem;
  border-top: 1px solid rgba(253, 249, 240, 0.12);
}
.sd-footer-brand { color: var(--sd-cream-text); font-weight: 500; }
.sd-footer-brand a { color: var(--sd-cream-text); text-decoration: none; }
.sd-footer-brand a:hover { color: var(--sd-focus); }
.sd-footer-tag { color: var(--sd-cream-dim); font-size: 0.9rem; margin: 0.15rem 0 0.9rem; }
.sd-footer-cta {
  display: inline-block;
  color: var(--sd-focus); text-decoration: none; font-weight: 600;
  border: 1.5px solid rgba(53, 181, 194, 0.5);
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  transition: background 0.15s ease;
}
.sd-footer-cta:hover { background: rgba(53, 181, 194, 0.12); }
.sd-footer-fine { margin-top: 1.25rem; font-size: 0.8rem; color: var(--sd-cream-dim); }
.sd-footer-fine a { color: var(--sd-cream-dim); }

/* ---------- narrow screens ---------- */
@media (max-width: 30rem) {
  .sd-header { padding: 0.85rem 1rem; }
  .sd-brand-from { display: none; }
  .sd-nav { width: 100%; justify-content: space-between; }
  .sd-nav a { padding: 0.45rem 0.6rem; }
  .sd-main { padding: 0.75rem 0.9rem 2.5rem; }
  .sd-card { padding: 1.4rem 1.15rem 1.3rem; }
  .sd-copy-status { display: block; margin: 0.5rem 0 0; }
}

/* ---------- print: the card, nothing else ---------- */
@media print {
  body.sd-body { background: #fff; }
  .sd-header, .sd-footer, .sd-nav, .sd-card-actions, .sd-related,
  .sd-tomorrow, .sd-install { display: none !important; }
  .sd-card { box-shadow: none; border: 1px solid #ccc; }
}
