/* site.css — the Day & Night design system for shelbycorbitt.com
   Day: pastel blue with a touch of peach. Night (data-theme="night"): a calm starry sky.
   Every text color here passes WCAG AA (4.5:1) on its background. */

:root {
  /* Day */
  --ground: #F2F6FB;        /* page background */
  --surface: #FFFFFF;       /* cards */
  --tint: #E3ECF8;          /* pastel blue panels, tags */
  --line: #D6E1EF;          /* borders */
  --line-strong: #C3D3EA;   /* outlined buttons */
  --ink: #1C2940;           /* headings, primary text      13.4:1 */
  --body: #44536A;          /* paragraphs                     7.2:1 */
  --muted: #5A6A82;         /* subtitles, labels, footer      5.1:1 */
  --link: #2F5B9A;          /* links, eyebrows                6.3:1 */
  --button: #3B66A8;        /* filled buttons (white text)    5.8:1 */
  --cornflower: #A9C3E8;    /* decor only */
  --peach: #F2C7A8;         /* decor only, the warm touch */
  --shadow: 0 10px 36px rgba(28, 41, 64, 0.10);

  /* Night */
  --sky: #101B33;
  --dusk: #18264A;
  --night-line: #2B3B63;
  --starlight: #EEF1F8;     /* 15.1:1 on --sky */
  --moonlight: #A7B4CC;     /*  8.2:1 on --sky */
  --star-gold: #F1DFA8;
  --mint: #9ED9BE;

  --font-display: 'Lora', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --page: 1120px;
}

/* A starry night sky, used by night panels and night pages */
.starry, [data-theme="night"] {
  background:
    radial-gradient(2px 2px at 9% 14%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 27% 38%, var(--moonlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 9%, var(--star-gold) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 26%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 12%, var(--starlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 94% 46%, var(--moonlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 64%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 16% 72%, var(--starlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 52% 88%, var(--star-gold) 50%, transparent 51%),
    linear-gradient(180deg, var(--sky) 0%, #1A2A4C 100%);
  color: var(--starlight);
}

*, *::before, *::after { box-sizing: border-box; }
/* No italics anywhere on the site (Shelby's preference) */
body.site, body.site * { font-style: normal !important; }
html { -webkit-text-size-adjust: 100%; }
body.site {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}
.site a { color: var(--link); }
.site a:hover { color: var(--ink); }
.site :focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 16px; }
.site-name { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--ink) !important; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.site-nav a:hover { color: var(--link); }
.site-nav .lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.site-nav .lang-toggle button { border: 0; min-height: 34px; padding: 0 12px; font: 700 12px var(--font-body); letter-spacing: 0.06em; background: var(--surface); color: var(--ink); cursor: pointer; }
.site-nav .lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

/* ---------- Type ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--link); }
.serif-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.lede { font-family: var(--font-display); font-style: normal; font-size: 20px; line-height: 1.65; color: var(--body); margin: 0; max-width: 62ch; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 22px; }
.section-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 36px); margin: 0; }
.section-head p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Buttons, tags ----------
   Buttons need both classes (class="btn btn-primary") so pages with their own .btn-primary are not affected. */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 500 15px var(--font-body); text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn.btn-primary { background: var(--button); color: #FFFFFF !important; }
.btn.btn-primary:hover { background: #2F5B9A; }
.btn.btn-secondary { border-color: var(--line-strong); color: var(--ink) !important; background: transparent; }
.btn.btn-secondary:hover { border-color: var(--link); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--tint); color: var(--link); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
a.card { text-decoration: none; color: var(--ink); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.icon-tile { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 88px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-top: 28px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; }

/* ---------- Night pages ----------
   <body class="site night" style="--accent: #F1DC8A"> turns the shared frame (header, footer,
   buttons, links) into the calm starry-night version. Each Night page picks one soft accent,
   for example Space Rocks uses #F2C7A8. */
body.site.night {
  --ground: var(--sky);
  --surface: var(--dusk);
  --tint: #1F2F57;
  --line: var(--night-line);
  --line-strong: #3A4C78;
  --ink: var(--starlight);
  --body: var(--moonlight);
  --muted: var(--moonlight);
  --link: var(--accent, var(--star-gold));
  --button: var(--accent, var(--star-gold));
  --shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
  background: var(--sky);   /* paints the whole canvas; the sky itself is the fixed layer below */
  color: var(--starlight);
}
/* The sky: a fixed layer behind everything, so it stays put while the page scrolls (works on iPhone too) */
body.site.night::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 6% 9%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 18% 31%, var(--moonlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 29% 6%, var(--star-gold) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 22%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 4%, var(--starlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 10%, var(--star-gold) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 11% 52%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 87% 58%, var(--starlight) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 4% 76%, var(--moonlight) 50%, transparent 51%),
    radial-gradient(2px 2px at 94% 81%, var(--starlight) 50%, transparent 51%),
    linear-gradient(180deg, #0E182E 0%, #13213F 55%, #1C2D52 100%);
}
body.site.night .site-header { background: transparent; }
body.site.night .site-header, body.site.night .site-footer { position: relative; z-index: 2; }
body.site.night a:hover, body.site.night .site-nav a:hover { color: var(--accent, var(--star-gold)); }
body.site.night .btn.btn-primary { color: var(--sky) !important; }
body.site.night .btn.btn-primary:hover { background: var(--starlight); }

/* ---------- "How it's built" write-ups ----------
   One section at the bottom of each project page. Uses the theme variables, so it looks right on
   Day pages and Night pages without page-specific colors. */
.build { position: relative; z-index: 1; max-width: 860px; margin: 96px auto 0; padding: 0 24px;
  font-family: var(--font-body); font-size: 16px; line-height: 1.65; color: var(--ink); text-align: left; }
.build > .eyebrow { margin: 0; }
.build h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 36px); line-height: 1.15; margin: 8px 0 14px; color: var(--ink); text-transform: none; letter-spacing: -0.01em; }
.build h3 { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.3; margin: 0 0 10px; color: var(--ink); }
.build p { margin: 0 0 14px; color: var(--body); max-width: 68ch; }
.build code { font-family: var(--font-mono); font-size: 0.88em; background: var(--tint); color: var(--ink); padding: 0.05em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.flow { list-style: none; margin: 28px 0 36px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; counter-reset: step; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; counter-increment: step; min-width: 0; }
.flow li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-bottom: 8px;
  border-radius: 50%; background: var(--tint); color: var(--link); font: 700 12px var(--font-body); }
.flow b { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.flow span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.55; color: var(--body); }
.build-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 44px; }
.build ul.notes { margin: 0; padding: 0 0 0 18px; color: var(--body); }
.build ul.notes li { margin: 0 0 10px; }
.build ul.notes b { color: var(--ink); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--tint); color: var(--link); }
.build-note { margin-top: 28px !important; font-size: 14px; color: var(--muted) !important; }

/* Subpages: the header nav and footer links sit closer together on phones */
@media (max-width: 560px) {
  .site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
  .site-nav { gap: 4px 16px; }
  .site-footer { margin-top: 56px; }
}

@media (prefers-reduced-motion: reduce) { a.card { transition: none; } a.card:hover { transform: none; } }
