/* PJ at the South Pole
   VOICE   warm, personal field journal, readable for every age
   IDEA    the station's year: pink low-sun "day", then aurora "night"
   COLOUR  day = snow-pink + plum + rose; night = plum-black + aurora pink/green
   TYPE    Courier Prime typewriter headings, system sans body at 19px
   Change colors in the two blocks below. Everything else uses these variables. */

/* ---------- DAY (sun up: ~Sep 22 to ~Mar 21) ---------- */
:root, [data-season="day"] {
  color-scheme: light;
  --bg: #fff7fa;
  --card: #ffffff;
  --ink: #2b1824;
  --ink-soft: #6e5262;
  --line: #f1d9e3;
  --accent: #c2185b;          /* deep rose: links, buttons */
  --on-accent: #ffffff;
  --accent-soft: #fde3ee;     /* pills, tags */
  --accent-2: #e05a8a;        /* quick-update stripe */
  --bar: #3a1630;             /* header and footer */
  --bar-ink: #ffffff;
  --bar-soft: #f3cfe0;
  --hero-top: #ffc9dc;
  --hero-mid: #ffe4dc;
  --hero-ink: #3a1630;
  --hero-soft: #7a4a63;
  --stat-bg: rgba(255, 255, 255, .65);
  --stat-line: rgba(194, 24, 91, .22);
  --quote: #fdeef4;
  --fact: #3a1630;
  --sun-opacity: 1;
  --aurora-opacity: 0;
}

/* ---------- NIGHT (sun down: ~Mar 21 to ~Sep 22) ---------- */
[data-season="night"] {
  color-scheme: dark;
  --bg: #140d1d;
  --card: #1d1529;
  --ink: #f5eaf1;
  --ink-soft: #c9b4c4;
  --line: #34263f;
  --accent: #ff8cc0;          /* bright pink reads well on dark */
  --on-accent: #1a0f1a;
  --accent-soft: #3d1f35;
  --accent-2: #ff8cc0;
  --bar: #0b0712;
  --bar-ink: #ffffff;
  --bar-soft: #e7c6d8;
  --hero-top: #07040d;
  --hero-mid: #160c22;
  --hero-ink: #ffffff;
  --hero-soft: #e3cbdb;
  --stat-bg: rgba(255, 255, 255, .07);
  --stat-line: rgba(255, 255, 255, .16);
  --quote: #24182f;
  --fact: #2b1d3a;
  --sun-opacity: 0;
  --aurora-opacity: 1;
}

:root {
  --radius: 14px;
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html { font-size: 19px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; overflow-x: clip; transition: background .4s, color .4s; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.small { font-size: .85rem; }
h1, h2, h3, .brand, .stat-num, .fact-value { font-family: var(--type); font-weight: 700; letter-spacing: -.01em; }

/* Header */
.site-header { background: var(--bar); color: var(--bar-ink); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 60px; flex-wrap: wrap; padding-block: .4rem; }
.brand { color: var(--bar-ink); text-decoration: none; font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; }
.brand-mark { color: #ff8cc0; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav a { color: var(--bar-soft); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; font-size: .95rem; }
nav a:hover, nav a[aria-current] { background: rgba(255,255,255,.14); color: var(--bar-ink); }

/* Hero: pink low sun by day, pink + green aurora by night */
.hero { position: relative; overflow: hidden; color: var(--hero-ink); padding: 4.5rem 0 3.5rem;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 70%, var(--bg) 100%); }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun { position: absolute; right: 8%; bottom: 18%; width: 150px; height: 150px; border-radius: 50%; opacity: var(--sun-opacity);
  background: radial-gradient(circle, #fff6e8 0 30%, rgba(255, 214, 190, .8) 45%, rgba(255, 170, 200, 0) 72%); transition: opacity .6s; }
.aurora { position: absolute; inset: -20% -10% auto -10%; height: 140%; opacity: var(--aurora-opacity); transition: opacity .6s;
  background:
    radial-gradient(60% 38% at 22% 30%, rgba(255, 105, 180, .50), transparent 70%),
    radial-gradient(50% 32% at 68% 22%, rgba(80, 230, 170, .38), transparent 70%),
    radial-gradient(40% 30% at 86% 55%, rgba(190, 120, 255, .32), transparent 70%);
  filter: blur(20px); animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(4%) translateY(-3%) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } body { transition: none; } }
.hero-inner { position: relative; }
.eyebrow { font-size: .85rem; color: var(--hero-soft); margin: 0 0 .5rem; font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.08; margin: 0 0 .75rem; text-wrap: balance; }
.lede { font-size: 1.15rem; color: var(--hero-soft); max-width: 34rem; margin: 0 0 2rem; }
.stats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; max-width: 44rem; }
.pair { display: flex; justify-content: space-between; gap: 1rem; }
.pair .right { text-align: right; }
.progress { height: 6px; border-radius: 999px; background: var(--stat-line); margin-top: .7rem; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.stat { background: var(--stat-bg); border: 1px solid var(--stat-line); border-radius: var(--radius); padding: .9rem 1.2rem; backdrop-filter: blur(4px); }
.stat-num { display: block; font-size: 2rem; line-height: 1.1; }
.stat-label { font-size: .85rem; color: var(--hero-soft); }

/* Sections and cards */
.section-title { font-size: 1.45rem; margin: 2.75rem 0 1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(58, 22, 48, .07); }
.card-link { color: inherit; text-decoration: none; display: block; height: 100%; }
.card-link:hover h2 { color: var(--accent); }
.card-link img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-body { padding: 1.1rem 1.25rem 1.3rem; }
.card h2 { font-size: 1.3rem; line-height: 1.25; margin: .2rem 0 .5rem; }
.card p { margin: 0 0 .6rem; color: var(--ink-soft); }
.latest .card-link { display: grid; grid-template-columns: 1.3fr 1fr; }
.latest .card-link img { height: 100%; aspect-ratio: auto; }
.latest .card h2 { font-size: 1.7rem; }
@media (max-width: 760px) { .latest .card-link { grid-template-columns: 1fr; } .latest .card-link img { aspect-ratio: 16/10; } }
.meta { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.read-more { font-weight: 600; color: var(--accent); }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .75rem; padding: .1rem .55rem; border-radius: 999px; margin-right: .35rem; }
.dispatch { border-left: 5px solid var(--accent-2); }
.dispatch-text p { color: var(--ink); font-size: 1.05rem; }
.dispatch-img { border-radius: 10px; margin-top: .5rem; }
.button { display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none; padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600; margin: 2rem 0; }

/* Posts */
.page-head { padding-top: 2.5rem; }
.page-head h1, .post-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: .3rem 0 .6rem; text-wrap: balance; }
.post-cover img { width: 100%; aspect-ratio: 2 / 1; max-height: 70vh; object-fit: cover; }
@media (max-width: 600px) { .post-cover img { aspect-ratio: 4 / 3; } }
.post-head { padding-top: 2rem; }
.tags a { text-decoration: none; margin-right: .5rem; font-size: .9rem; }
.prose { font-size: 1.08rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose h2 { font-size: 1.45rem; margin: 2.2rem 0 .8rem; }
.prose blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 4px solid var(--accent); background: var(--quote); border-radius: 0 10px 10px 0; }
.photo { margin: 1.75rem 0; }
.photo img { border-radius: 10px; }
.photo figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: .4rem; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin: 1.75rem 0; }
.gallery img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.03); }
.fact { display: inline-flex; flex-direction: column; background: var(--fact); color: #fff; border-radius: var(--radius); padding: .8rem 1.2rem; margin: .3rem .4rem .3rem 0; }
.fact-value { font-size: 1.55rem; }
.fact-label { font-size: .8rem; color: #f0d2e1; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.post-nav a { text-decoration: none; font-weight: 600; color: var(--accent); max-width: 48%; }
.post-nav small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .8rem; }
.post-nav .newer { text-align: right; margin-left: auto; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(12, 6, 14, .95); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 80vh; margin: 0 auto; border-radius: 6px; }
.lightbox figcaption { color: #f3dbe7; margin-top: .6rem; font-size: .95rem; }
.lightbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; font-size: 2rem; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; line-height: 1; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Footer + theme switch */
.site-footer { margin-top: 4rem; background: var(--bar); color: var(--bar-soft); padding: 2rem 0; text-align: center; }
.site-footer a { color: var(--bar-ink); }
.season-switch { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: .5rem; font-size: .85rem; }
.season-switch button { font: inherit; color: var(--bar-soft); background: transparent; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: .35rem .8rem; min-height: 36px; cursor: pointer; }
.season-switch button[aria-pressed="true"] { background: #ff8cc0; border-color: #ff8cc0; color: #1a0f1a; font-weight: 700; }
button:focus-visible, a:focus-visible { outline: 3px solid #ff8cc0; outline-offset: 2px; }

/* Phones */
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-wide { grid-column: 1 / -1; }
  .stat { padding: .7rem .75rem; }
  .stat-num { font-size: 1.55rem; }
  .stat-label { font-size: .75rem; display: block; line-height: 1.3; }
  .sun { width: 90px; height: 90px; right: 4%; top: 1rem; bottom: auto; }
}

/* About page email */
.email-box { margin: 1rem 0 0; }
.email-box a { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.1rem; padding: .75rem 1.25rem; border-radius: var(--radius); text-decoration: none; overflow-wrap: anywhere; }
