/* ==========================================================================
   emilywasilewski.com — responsive botanical/gaming theme
   No JavaScript, external fonts, CDNs, analytics, or third-party requests.
   Light/dark appearance follows the visitor's operating-system preference.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --canvas: #edf3ee;
  --canvas-deep: #dfe9e2;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #f9fbf9;
  --surface-muted: #edf4ef;
  --text: #17231d;
  --text-soft: #5f6d65;
  --accent: #176b4b;
  --accent-strong: #0d5439;
  --accent-soft: rgba(23, 107, 75, 0.12);
  --accent-glow: rgba(31, 139, 96, 0.18);
  --border: rgba(23, 65, 46, 0.14);
  --rule: rgba(23, 65, 46, 0.12);
  --shadow: 0 24px 70px rgba(18, 53, 37, 0.12);
  --shadow-soft: 0 12px 36px rgba(18, 53, 37, 0.08);

  --panel: #061b13;
  --panel-edge: #0e5138;
  --panel-w: clamp(24px, 7vw, 110px);
  --tile: 150px;

  --todo-bg: #f0f4e7;
  --todo-border: #a3b58d;
  --todo-text: #526044;
  --callout-bg: linear-gradient(135deg, rgba(23, 107, 75, 0.14), rgba(74, 154, 111, 0.06));

  --content: 1080px;
  --measure: 67ch;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;

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

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b1210;
    --canvas-deep: #111b17;
    --surface: rgba(20, 31, 26, 0.82);
    --surface-solid: #121d18;
    --surface-muted: #18261f;
    --text: #eef5f0;
    --text-soft: #a6b6ad;
    --accent: #65d39d;
    --accent-strong: #8be6b8;
    --accent-soft: rgba(101, 211, 157, 0.13);
    --accent-glow: rgba(101, 211, 157, 0.15);
    --border: rgba(167, 220, 190, 0.14);
    --rule: rgba(167, 220, 190, 0.12);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 14px 38px rgba(0, 0, 0, 0.25);

    --panel: #020b08;
    --panel-edge: #123d2d;

    --todo-bg: #20291d;
    --todo-border: #62745c;
    --todo-text: #bdc9b6;
    --callout-bg: linear-gradient(135deg, rgba(101, 211, 157, 0.14), rgba(101, 211, 157, 0.04));
  }
}

/* ---------------------------------------------------------------- reset */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 2rem;
  scroll-behavior: smooth;
  background: var(--panel);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  line-height: 1.7;
  background:
    radial-gradient(circle at 20% 10%, var(--accent-glow), transparent 28rem),
    radial-gradient(circle at 82% 78%, var(--accent-glow), transparent 34rem),
    linear-gradient(145deg, var(--canvas), var(--canvas-deep));

  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr) var(--panel-w);
  align-items: stretch;
}

::selection {
  background: var(--accent);
  color: var(--surface-solid);
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-strong);
}

/* ------------------------------------------------------- floral rails */

.margin {
  position: relative;
  min-height: 100%;
  background-color: var(--panel);
  background-image:
    linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.22)),
    url("../img/floral.svg");
  background-repeat: repeat-y;
  background-position: center top;
  background-size: auto, var(--tile) auto;
}

.margin::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 65%, rgba(0, 0, 0, 0.2));
}

.margin--left {
  box-shadow: inset -1px 0 0 var(--panel-edge);
}

.margin--right {
  box-shadow: inset 1px 0 0 var(--panel-edge);
}

/* ------------------------------------------------------------- page */

.page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  padding:
    clamp(1.25rem, 4vw, 3.25rem)
    clamp(1rem, 4.5vw, 4rem)
    clamp(2.25rem, 6vw, 5rem);

  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.page::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0 var(--panel-w);
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 58%, var(--accent-glow) 100%);
  opacity: 0.65;
}

.page > * {
  width: min(100%, var(--content));
  margin-inline: auto;
}

/* ---------------------------------------------------------- masthead */

.masthead {
  padding: clamp(1.45rem, 3.5vw, 2.8rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 84%, transparent));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}

.masthead::after {
  content: "";
  position: absolute;
  width: clamp(9rem, 22vw, 16rem);
  aspect-ratio: 1;
  right: clamp(-6rem, -6vw, -3rem);
  top: clamp(-7rem, -8vw, -4rem);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  pointer-events: none;
}

.masthead__name {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 16ch;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.masthead__handle {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  margin: 0.85rem 0 0;
  padding: 0.35rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.025em;
}

/* --------------------------------------------------------------- nav */

.nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 650;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--border);
  transform: translateY(-1px);
}

.nav a[aria-current="page"] {
  color: var(--surface-solid);
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
}

/* -------------------------------------------------------------- main */

main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.35rem);
  align-items: start;
}

.section {
  min-width: 0;
  padding: clamp(1.25rem, 2.8vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.section:first-child {
  grid-column: 1 / -1;
}

@media (hover: hover) {
  .section:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: var(--shadow);
  }
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 1.15rem + 1vw, 2.05rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;

  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.section h2::before {
  content: "";
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 0 70% 0 70%;
  background: var(--accent);
  box-shadow: 0 0 0 0.35rem var(--accent-soft);
  transform: rotate(-17deg);
}

.section h3 {
  margin: 1.7rem 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section p {
  max-width: var(--measure);
  margin: 0 0 1.05rem;
}

.section p:last-child {
  margin-bottom: 0;
}

.lede {
  max-width: 58ch;
  font-family: var(--display);
  font-size: clamp(1.25rem, 1.08rem + 0.6vw, 1.65rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--text);
}

/* --------------------------------------------------------- link lists */

.links {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  gap: 0.65rem;
}

.links li {
  min-width: 0;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.links a {
  color: var(--accent);
  font-weight: 720;
  text-decoration: none;
}

.links a:hover,
.links a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.links .note {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.5;
}

.section p a,
.figure a {
  font-weight: 650;
  text-decoration-thickness: 1px;
}

/* ------------------------------------------------------------- roster */

.roster {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 0.8rem;
}

.roster > li {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.roster h3 {
  margin: 0 0 0.45rem;
  color: var(--accent-strong);
  font-size: 1.08rem;
}

.roster p {
  margin: 0;
  color: var(--text-soft);
}

/* ------------------------------------------------------ placeholders */

.todo {
  border: 1px dashed var(--todo-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.95rem;
  background: var(--todo-bg);
  color: var(--todo-text);
  font-size: 0.93rem;
  font-style: italic;
}

.todo::before {
  content: "Write this bit: ";
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 760;
}

/* -------------------------------------------------------------- misc */

.callout {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-md);
  background: var(--callout-bg);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.3rem);
  font-weight: 600;
}

.footer {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
}

.footer a {
  color: var(--text-soft);
  font-weight: 650;
}

.skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: top 140ms ease;
}

.skip:focus {
  top: 1rem;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 820px) {
  :root {
    --panel-w: clamp(16px, 4vw, 34px);
    --tile: 110px;
  }

  main {
    grid-template-columns: 1fr;
  }

  .section:first-child {
    grid-column: auto;
  }

  .masthead__name {
    font-size: clamp(2.8rem, 12vw, 5.2rem);
  }
}

@media (max-width: 540px) {
  body {
    display: block;
  }

  .margin {
    display: none;
  }

  .page {
    padding: 0.85rem 0.85rem 1.5rem;
  }

  .page::before {
    inset: 0;
  }

  .masthead {
    padding: 1.25rem;
    border-radius: 22px;
  }

  .nav {
    gap: 0.4rem;
  }

  .nav a {
    min-height: 2.25rem;
    padding-inline: 0.68rem;
    font-size: 0.9rem;
  }

  .section {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .footer {
    border-radius: 18px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: currentColor;
  }

  .section,
  .masthead,
  .footer,
  .links li,
  .roster > li {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    display: block;
    background: #fff;
    color: #000;
  }

  .margin,
  .nav,
  .skip {
    display: none;
  }

  .page {
    padding: 0;
  }

  .page::before {
    display: none;
  }

  .masthead,
  .section,
  .footer {
    box-shadow: none;
    background: #fff;
    color: #000;
    break-inside: avoid;
  }

  main {
    display: block;
  }

  .section + .section {
    margin-top: 1rem;
  }

  a {
    color: #000;
  }
}
