/* ═══════════════════════════════════════════════════════════════
   shorette.com — "night into day" experiment
   White page, the Dovedale night at the top, a spine of time
   running through the register and the diary.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "IM Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell-sc.woff2") format("woff2");
}
@font-face {
  font-family: "Zeyada";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/zeyada/zeyada.woff2") format("woff2");
}
@font-face {
  font-family: "Academica";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/academica/Academica-Book.otf") format("opentype");
}
/* amiri subset: arabic letters, digits, diacritics, ayah ornaments */
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/amiri/amiri-arabic-subset.woff2") format("woff2");
}

.ar { font-family: "Amiri", serif; }

:root {
  --paper: #ffffff;
  --ink: #1d1712;
  --ink-rgb: 29, 23, 18;
  --accent: #7e342a;
  --muted: #6f665c;
  --hairline: rgba(var(--ink-rgb), 0.16);
  --measure: 37rem;
  --column: 60rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Academica", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
/* the link idiom: dotted for internal, solid for external */
a[href]:not([href^="http"]):not([href^="mailto"]):not([href^="#"]) {
  text-decoration-style: dotted;
}
a[href^="http"] { text-decoration-style: solid; }
a:hover { color: var(--accent); }

img { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg.moon {
  width: 0.9em;
  height: 0.9em;
  color: var(--accent);
  vertical-align: -0.1em;
}
svg.fleuron {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--accent);
  display: block;
}

/* ═══════════ the white nav (subpages) ═══════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}
.nav-bar {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.nav-brand {
  font-family: "IM Fell English", serif;
  text-decoration: none;
  font-size: 1.02rem;
}
.nav-brand .moon { margin-right: 0.4rem; }
.site-nav ul {
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); font-style: italic; }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration: dotted underline; text-underline-offset: 3px; }

/* ═══════════ the night banner: the page dawns out of it ═══════════ */

.night {
  position: relative;
  height: clamp(19rem, 48vh, 28rem);
  overflow: hidden;
  background: #101b22; /* night sky while the image loads */
}
.night img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* anchor the crop toward the top: on wide screens the strip crops
     vertically, and center-cropping lands the moon right under the nav */
  object-position: 50% 15%;
  display: block;
}
.night__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 18, 22, 0.34) 0%,
    rgba(12, 18, 22, 0) 26%,
    rgba(12, 18, 22, 0) 55%,
    rgba(255, 255, 255, 0.06) 82%,
    var(--paper) 100%
  );
}
/* the overlaid nav, written on the night sky */
.night__nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.85rem 1.2rem;
  color: #fff;
}
.night__nav a {
  color: #fff;
  text-decoration: none;
  /* legible over the moon's bright disc on wide screens */
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65), 0 0 3px rgba(0, 0, 0, 0.45);
}
.night__brand {
  margin: 0;
  font-family: "IM Fell English", serif;
  font-size: 1.05rem;
  font-weight: normal;
}
.night__nav .moon { color: #fff; }
.night__nav ul {
  display: flex;
  gap: 1.6rem;
  margin: 0; padding: 0; list-style: none;
}
.night__nav li a { font-size: 0.95rem; }
.night__nav li a:hover { font-style: italic; }

/* ═══════════ content column & sections ═══════════ */

.content {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.content--full { max-width: none; padding: 0; }

.column {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.leaf {
  position: relative;
  padding: 2.6rem 0 2.2rem;
}
.leaf__head {
  font-family: "IM Fell English SC", serif;
  font-weight: normal;
  font-size: 1.02rem;
  letter-spacing: 0.07em;
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.6rem;
}

/* ── the epigraph ── */

.epigraph { text-align: center; padding-top: 2.8rem; }
.epigraph .fleuron { margin: 0 auto 1.4rem; }
.epigraph blockquote {
  margin: 0 auto;
  max-width: 32em;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 1.16rem;
  line-height: 1.6;
}
.epigraph blockquote p { margin: 0; }
.epigraph figcaption {
  margin-top: 0.8rem;
  font-family: "IM Fell English SC", serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* the epigraph */
.epigraph .quran { margin: 0.6rem 0 0; }
.epigraph .quran blockquote {
  font-family: "Amiri", serif;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 2.05;
  max-width: 22em;
}
.epigraph .quran__gloss {
  margin: 0.9rem auto 0;
  max-width: 32em;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── the preface: drop cap, margin glosses ── */

.preface { max-width: var(--measure); margin: 0 auto; }
.preface p { margin: 0 0 1.1rem; }
.preface .home-lede .dropcap {
  font-family: "IM Fell English", serif;
  float: left;
  font-size: 3.3rem;
  line-height: 0.8;
  padding: 0.2rem 0.5rem 0 0;
  color: var(--accent);
}
.signature {
  text-align: right;
  font-family: "Zeyada", cursive;
  font-size: 1.7rem;
  transform: rotate(-1.2deg);
  margin: 1.4rem 0.8rem 0 0;
}

/* the margin glosses — the preface reserves room for them on wide screens */
@media (min-width: 56rem) {
  .preface { max-width: calc(var(--measure) + 20rem); }
  .preface p, .preface .signature { max-width: var(--measure); margin-left: auto; margin-right: auto; }
}
.note {
  position: absolute;
  width: 8.8rem;
  font-family: "Zeyada", cursive;
  font-size: 1.32rem;
  line-height: 1.15;
  color: var(--muted);
  font-variant-emoji: text;
}
.note--l { left: 0; text-align: right; transform: rotate(-1.4deg); }
.note--r { right: 0; transform: rotate(1.1deg); }
/* the margin glosses are a wide-screen pleasure */
@media (max-width: 56rem) {
  .note { display: none; }
}

/* the life counter: a tally in the text */
.life-counter {
  position: relative;
  white-space: nowrap;
  cursor: help;
  font-variant-numeric: tabular-nums;
}
.life-counter__readout {
  padding: 0 0.1em;
  border-bottom: 1px dotted var(--ink);
  transition: background-color 140ms ease, color 140ms ease;
}
.life-counter:hover .life-counter__readout,
.life-counter:focus .life-counter__readout {
  background: var(--ink);
  color: var(--paper);
}
.life-counter:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
.life-counter__panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  z-index: 20;
  display: grid;
  gap: 0.12rem;
  min-width: 11rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 0 4px 14px rgba(var(--ink-rgb), 0.12);
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}
.life-counter:hover .life-counter__panel,
.life-counter:focus .life-counter__panel {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── the register: entries hung on the spine of time ── */

.register { max-width: 46rem; margin: 0 auto; }
.register ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.register li {
  display: grid;
  grid-template-columns: 5.5rem 1.4rem 1fr;
  align-items: baseline;
  min-height: 1.9rem;
}
.register .tick {
  position: relative;
  align-self: stretch;
  border-left: 1px solid var(--hairline);
}
.register .tick::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.register li.live .tick::before {
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.3; } }
.pulse__time {
  text-align: right;
  padding-right: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}
.pulse__verb {
  font-style: italic;
  color: var(--muted);
  margin-right: 0.3rem;
}
.pulse__label { text-decoration: none; }
a.pulse__label { text-decoration-style: dotted; }
.pulse__detail { color: var(--muted); font-size: 0.9em; }
.pulse__dot { display: none; } /* the live marker is the spine tick */

/* ═══════════ footer ═══════════ */

.site-footer {
  max-width: var(--column);
  margin: 1.5rem auto 0;
  padding: 1.6rem 1.2rem 2.8rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer .ar { font-size: 1.1rem; line-height: 1; }
.site-footer .tonight {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
}
.site-footer .tonight svg { vertical-align: -0.15em; margin-right: 0.25rem; color: var(--ink); }

/* ═══════════ the diary (seeds) ═══════════ */

.dove { margin: 0; position: relative; height: clamp(12rem, 30vh, 16rem); overflow: hidden; }
.dove img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.dove__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(12,18,22,0) 60%, rgba(255,255,255,0.5) 88%, var(--paper) 100%);
}

.seeds-bar {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--hairline);
  font-family: "IM Fell English SC", serif;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}
.seeds-bar a { text-decoration: none; }

.seeds-layout {
  max-width: var(--column);
  margin: 0 auto;
  padding: 1.8rem 1.2rem 0;
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2.4rem;
}

/* the almanac calendar */
.seeds-cal { font-size: 0.86rem; }
.cal-year summary {
  cursor: pointer;
  font-family: "IM Fell English SC", serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  list-style: none;
}
.cal-year summary::before {
  content: "";
  display: inline-block;
  border: 4px solid transparent;
  border-left-color: var(--accent);
  margin-right: 0.45rem;
  transition: transform 0.15s;
}
.cal-year[open] summary::before { transform: rotate(90deg) translateX(1px); }
.cal-count { color: var(--muted); font-size: 0.78rem; margin-left: 0.3rem; }
.cal-month { margin: 0.5rem 0 0.9rem 0.6rem; }
.cal-month__name { font-style: italic; color: var(--muted); font-size: 0.82rem; }
.cal-days { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.cal-days li { display: flex; justify-content: space-between; padding: 0.06rem 0; }
.cal-days a { text-decoration: none; font-variant-numeric: tabular-nums; }
.cal-days a:hover { color: var(--accent); }

/* the stream, hung on the spine */
.seeds-stream {
  border-left: 1px solid var(--hairline);
  padding-left: 1.5rem;
}
.day { position: relative; margin-bottom: 2.4rem; }
.day::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 4px);
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 0.8rem;
}
.day__wd {
  font-family: "IM Fell English SC", serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-right: 0.5rem;
}
.day__date { font-style: italic; color: var(--muted); font-size: 0.9rem; }
.day__count { color: var(--muted); font-size: 0.8rem; }

.seed { margin-bottom: 1.6rem; }
.seed__head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.seed__entry-no {
  font-family: "IM Fell English SC", serif;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.seed__time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
.seed__title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 1.3rem;
  margin: 0.1rem 0 0;
  flex-basis: 100%;
}
.seed__line { margin: 0; }
.seed__verb { font-style: italic; color: var(--muted); }
.seed__detail { color: var(--muted); font-size: 0.9em; }
.seed__body { margin-top: 0.45rem; }
.seed__body p { margin: 0.45rem 0; }
.seed__body blockquote {
  margin: 0.6rem 0;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline);
  font-style: italic;
}
.seed--essay .seed__body { font-size: 1.02rem; }

/* quote kind: a pull-quote */
.seed__quote { margin: 0.4rem 0 0; }
.seed__quote blockquote {
  margin: 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 1px solid var(--hairline);
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.55;
}
.seed__quote blockquote p { margin: 0; }
.seed__quote figcaption { margin: 0.35rem 0 0 1.2rem; font-size: 0.85rem; color: var(--muted); }
.seed__quote figcaption::before { content: "— "; }

.seed__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin-top: 0.55rem;
  font-size: 0.82rem;
}
.seed__tags a { color: var(--muted); text-decoration: none; margin-right: 0.45rem; }
.seed__tags a:hover { color: var(--accent); }
.seed__leads-label { color: var(--muted); margin-right: 0.3rem; font-style: italic; }
.seed__leads a { text-decoration-style: dotted; }

/* references (goldmark footnotes) */
.seed__body .footnotes { margin-top: 0.9rem; font-size: 0.82rem; color: var(--muted); }
.seed__body .footnotes hr {
  height: 0;
  margin: 0.9rem 0 0;
  border: none;
  border-top: 1px solid var(--hairline);
}
.seed__body .footnotes ol { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.seed__body .footnotes p { margin: 0.2rem 0; }
.seed__body sup a.footnote-ref,
.seed__body .footnote-backref { color: var(--accent); text-decoration: none; }
.seed__body sup a.footnote-ref::before { content: "["; }
.seed__body sup a.footnote-ref::after { content: "]"; }

/* tag archive pages */
.tag-back { font-size: 0.9rem; }
.tag-back a { text-decoration: none; }
.tag-title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 1.6rem;
  margin: 0.4rem 0 1.4rem;
}

/* ═══════════ mobile ═══════════ */

@media (max-width: 46rem) {
  /* the tally panel floats over the text as a popover — no pushing, no clipping.
     (the counter stops being the containing block; the leaf takes over) */
  .life-counter { position: static; }
  .life-counter__panel {
    bottom: auto;
    left: 0.9rem;
    right: 0.9rem;
    min-width: 0;
    white-space: normal;
    transform: none;
    box-shadow: 0 6px 18px rgba(var(--ink-rgb), 0.16);
  }
  .life-counter:hover .life-counter__panel,
  .life-counter:focus .life-counter__panel { transform: none; }
  body { font-size: 16px; }
  .night { height: 16rem; }
  .night__nav { flex-direction: column; gap: 0.3rem; }
  .night__nav ul { gap: 1.1rem; }
  .night__nav li a { font-size: 0.88rem; }
  .nav-bar { flex-wrap: wrap; gap: 0.3rem 1rem; }
  .site-nav ul { gap: 1rem; }
  .register li { grid-template-columns: 4.4rem 1.1rem 1fr; }
  .seeds-layout { grid-template-columns: 1fr; gap: 1.4rem; }
  .seeds-cal { border-bottom: 1px solid var(--hairline); padding-bottom: 1rem; }
  .seeds-stream { border-left: none; padding-left: 0; }
  .day::before { display: none; }
  .signature { margin-right: 0.2rem; }
}
