/* Flawgic — one page, dark, quiet. No frameworks, no webfonts, no tracking. */

:root {
  --bg:        #0b0d10;
  --bg-panel:  #12161c;
  --line:      #222831;
  --ink:       #e9e7e2;
  --ink-soft:  #a8adb6;
  --ink-faint: #6c727c;
  --accent:    #c9a227;  /* brass — the lamp you read by */
  --accent-2:  #6f9d97;  /* verdigris — the recovery side */

  /* The wordmark's stitching, as a repeatable rule. */
  --stitch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4'%3E%3Crect width='7' height='4' rx='2' fill='%234a5464'/%3E%3C/svg%3E");

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;

  /* A single soft light source, top-centre. */
  background-image: radial-gradient(70rem 40rem at 50% -12rem, #171b22 0%, transparent 70%);
  background-repeat: no-repeat;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
}

.frame {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 7rem) 1.5rem 4rem;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  text-align: center;
  margin-bottom: clamp(2.5rem, 8vh, 4.5rem);
}

/* Wide 2.6:1 wordmark — the dashed thread wants room to run. */
.logo {
  display: block;
  width: min(82%, 420px);
  height: auto;
  margin: 0 auto 1.5rem;
}

.wordmark {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1;
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: lowercase;
}

/* ── Quote of the day ─────────────────────────────────────────────────── */

.quote {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(1.75rem, 6vw, 2.75rem);
  position: relative;
}

/* Hairline of light along the top edge. */
.quote::before {
  content: "";
  position: absolute;
  inset: -1px auto auto 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.5), transparent);
}

.date {
  display: block;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}

.quote blockquote {
  margin: 0;
}

.quote blockquote p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5.2vw, 1.8rem);
  line-height: 1.42;
  text-wrap: pretty;
}

.quote blockquote p::before { content: "\201C"; margin-left: -.42em; }
.quote blockquote p::after  { content: "\201D"; }

.attribution {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem;
  justify-content: space-between;
  margin-top: 1.75rem;
  padding-top: calc(1.25rem + 4px);
  background: var(--stitch) left top repeat-x;
  background-size: 12px 4px;
}

.attribution cite {
  font-style: normal;
  font-size: .9rem;
  color: var(--ink-soft);
}

.work::before { content: " — "; color: var(--ink-faint); }
.work { color: var(--ink-faint); font-style: italic; }

.tag {
  flex: none;
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: .3rem .6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--accent);
  opacity: .85;
}
.tag[data-source="recovery"] { color: var(--accent-2); }

.countdown {
  margin: 1rem 0 0;
  text-align: center;
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

/* ── The creed ────────────────────────────────────────────────────────── */

.creed {
  margin-top: clamp(3.5rem, 12vh, 6rem);
}

.creed h2 {
  margin: 0 0 2rem;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.creed ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: creed;
}

.creed li {
  counter-increment: creed;
  padding-left: 2.5rem;
  position: relative;
}
.creed li + li { margin-top: 2.25rem; }

.creed li::before {
  content: counter(creed, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .15em;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--accent);
  opacity: .7;
}

.creed h3 {
  margin: 0 0 .4rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.35;
}

.creed p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
  text-wrap: pretty;
}

/* ── Colophon ─────────────────────────────────────────────────────────── */

.colophon {
  margin-top: clamp(3.5rem, 12vh, 6rem);
  padding-top: calc(2rem + 4px);
  background: var(--stitch) left top repeat-x;
  background-size: 12px 4px;
  color: var(--ink-faint);
  font-size: .84rem;
}

.colophon p { margin: 0 0 .85rem; }
.colophon .fine { font-size: .76rem; line-height: 1.55; }

/* ── Preferences ──────────────────────────────────────────────────────── */

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

@media print {
  body { background: #fff; color: #000; }
  .quote { border-color: #ccc; background: #fff; }
  .countdown, .skip { display: none; }
  /* Browsers drop background images when printing — give the rules a body. */
  .attribution, .colophon { border-top: 1px solid #ccc; background-image: none; }
}
