/* Fonts */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Karla"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/karla-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Karla"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/karla-latin-500-normal.woff2") format("woff2"); }

/* Palette: day */
:root {
  --bg: #F8FBFA;      /* soft white */
  --text: #24222B;    /* charcoal */
  --iris: #5B45B0;    /* deep iris */
  --mint: #7FDCCB;    /* mint */
  --jade: #0E7C6B;    /* jade teal, small text */
  --line: rgba(36, 34, 43, 0.12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Karla", system-ui, sans-serif;
}
/* Palette: night */
[data-mode="night"] {
  --bg: #18142B;      /* deep violet */
  --text: #ECEAF2;    /* pale lilac-grey */
  --iris: #C9B8F2;    /* soft lilac */
  --mint: #9FF0E0;    /* bright mint */
  --jade: #9FF0E0;
  --line: rgba(236, 234, 242, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; }

/* Nav (shared) */
.nav { display: flex; flex-wrap: wrap; gap: clamp(16px, 3vw, 44px); align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-size: clamp(15px, 1.35vw, 19px);
  padding-bottom: 4px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--iris); }
/* Day/night sliding switch */
.mode { position: relative; width: 52px; height: 28px; padding: 0; border: 0; border-radius: 28px;
  background: #E6E0F7; cursor: pointer; transition: background .3s; flex: none;
  margin-bottom: 6px; /* matches the links' underline space so the switch centres on the text */ }
.mode .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--iris); color: var(--bg); display: flex; align-items: center; justify-content: center;
  transition: left .3s, background .3s; }
.mode svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mode .i-moon { display: none; fill: currentColor; stroke: none; }
[data-mode="night"] .mode { background: #2E2650; }
[data-mode="night"] .mode .knob { left: 27px; }
[data-mode="night"] .mode .i-sun { display: none; }
[data-mode="night"] .mode .i-moon { display: block; }
@media (prefers-reduced-motion: reduce) { .mode, .mode .knob { transition: none; } }

/* ---------- Homepage ---------- */
/* Fill the window exactly so the homepage never scrolls */
.home { position: relative; width: 100%; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; }
.scene { position: absolute; inset: 0;
  background: url("../img/hero-day.webp") 20% 100% / cover no-repeat; }
[data-mode="night"] .scene { background-image: url("../img/hero-night.webp"); }
.home .nav { position: absolute; right: 4%; top: 5%; z-index: 1; }
/* Soft glow keeps menu words readable where the leaves reach the menu on taller screens */
.home .nav a { text-shadow: 0 0 6px var(--bg), 0 0 12px var(--bg), 0 0 2px var(--bg); }
.intro { position: absolute; left: 50%; top: 49%; max-width: 44%; z-index: 1; }
.label { margin: 0 0 0.5em; font-size: clamp(13px, 1.1vw, 17px); letter-spacing: 0.04em; color: var(--iris); }
.intro h1 { margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 4.4vw, 66px); letter-spacing: -0.01em; line-height: 1.1; }
.intro .line { margin: 0.6em 0 0; font-size: clamp(15px, 1.4vw, 22px); line-height: 1.5; color: var(--jade); }

/* ---------- Inner pages ---------- */
.sky { position: absolute; top: 0; left: 0; width: 100%; height: 340px; z-index: 0; pointer-events: none;
  background: url("../img/sky-day.webp") right top / 60% auto no-repeat;
  mask-image: linear-gradient(to right, transparent 40%, #000 62%), linear-gradient(to bottom, #000 40%, transparent);
  mask-composite: intersect; }
[data-mode="night"] .sky { background-image: url("../img/sky-night.webp"); }
.top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 36px 4%; }
.home-link { font-family: var(--serif); font-weight: 500; font-size: 26px; text-decoration: none; }
.page { position: relative; z-index: 1; max-width: 760px; margin: 120px auto; padding: 0 24px; }
.page h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(44px, 5vw, 64px); margin: 0; line-height: 1.1; }
.page .intro-line { color: var(--jade); font-size: 19px; margin: 10px 0 56px; }

.item { padding: 26px 0; border-top: 1px solid var(--line); }
.item:last-child { border-bottom: 1px solid var(--line); }
.item h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); margin: 0 0 6px; }
.item h2 a { text-decoration: none; }
/* Small status chip beside a heading, e.g. "Beta" */
.chip { display: inline-block; vertical-align: middle; margin-left: 10px; padding: 3px 10px 4px;
  border: 1px solid var(--jade); border-radius: 999px; color: var(--jade);
  font-family: var(--sans); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1; position: relative; top: -3px; }
.item p { margin: 0 0 10px; font-size: 17px; line-height: 1.6; }
.item p:last-child { margin-bottom: 0; }
.item .more { color: var(--iris); font-size: 16px; }
.date { color: var(--jade); font-size: 14px; margin: 0 0 4px !important; }

.prose p { font-size: 18px; line-height: 1.75; margin: 0 0 1.2em; max-width: 620px; }

/* Contact: a row of icon links */
.icons { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.icons a { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--iris);
  transition: border-color .2s, background .2s, transform .2s; }
.icons a:hover { border-color: var(--iris); background: rgba(91, 69, 176, 0.06); transform: translateY(-2px); }
[data-mode="night"] .icons a:hover { background: rgba(201, 184, 242, 0.1); }
.icons svg { width: 26px; height: 26px; fill: currentColor; }
.icons svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .icons a { transition: none; } .icons a:hover { transform: none; } }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  /* Homepage fills the screen: menu, then the picture stretches, then your name */
  .home { height: auto; overflow: visible; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
  .home .nav { position: static; order: 1; padding: 18px 14px 12px; }
  .scene { position: relative; order: 2; inset: auto; width: 100%; flex: 1; min-height: 420px;
    background-position: 10% 100%; background-size: cover; }
  .intro { position: static; order: 3; max-width: none; padding: 24px 24px 32px; }

  .top { flex-direction: column; align-items: stretch; padding: 24px 14px; }
  .home-link { padding: 0 6px; }
  .nav { justify-content: space-between; gap: 8px; flex-wrap: nowrap; }
  .sky { height: 240px; background-size: 100% auto; }
  .page { margin: 48px auto 80px; padding: 0 20px; }
  .page .intro-line { margin-bottom: 36px; }
}
