/* ==========================================================
   Emily Wittenhagen — writer, poet, editor
   Recreates the original site's look: orange header, swirl
   logo, soft blue fog background, Nova Oval + Didact Gothic.
   ========================================================== */

:root {
  --orange: #c4742d;
  --orange-dark: #a65e1f;
  /* Blues are darkened from the original #a0d6f0 for readability (WCAG AA):
     --sky is 5.2:1 on white and 4.5:1 on the fog's darkest tone;
     --sky-deep is 6.9:1 on white. */
  --sky: #2a72a0;          /* name / heading blue */
  --sky-deep: #1d5f8a;     /* link blue */
  --ink: #111;
  --text: #333;
  --muted: #6b6b6b;
  --card: #fff;
  --fog-1: #ffffff;
  --fog-2: #e7effb;
  --fog-3: #cfdff5;
  --line: #e3e8ef;
  --shadow: 0 2px 10px rgba(30, 50, 80, 0.12);
  --shadow-hover: 0 8px 24px rgba(30, 50, 80, 0.18);

  --font-display: "Nova Oval", "Didact Gothic", system-ui, sans-serif;
  --font-body: "Didact Gothic", "Century Gothic", "Avenir Next", system-ui, sans-serif;

  --max: 1170px;
  --gutter: 20px;
  --header-h: 78px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--fog-1);
}

main { flex: 1; position: relative; z-index: 1; padding-bottom: 72px; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sky-deep); text-underline-offset: 3px; }
a:hover { color: var(--orange); }

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

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 4px;
}
.skip-link:focus { left: 8px; }

/* ---------- Fog background ----------
   A CSS fallback; assets/js/site.js upgrades it to the animated
   Vanta fog (like the original) when motion is allowed. */
.fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 10% 20%, var(--fog-2), transparent 70%),
    radial-gradient(50vw 50vh at 90% 45%, var(--fog-3), transparent 70%),
    radial-gradient(70vw 50vh at 20% 85%, var(--fog-3), transparent 70%),
    radial-gradient(40vw 30vh at 70% 10%, var(--fog-2), transparent 70%),
    var(--fog-1);
}
.fog canvas { opacity: .85; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: 820px; }
.container--portfolio { max-width: 980px; }

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--sky);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.1;
  margin: 48px 0 8px;
  text-align: center;
}
.page-intro { text-align: center; margin: 0 0 40px; color: var(--ink); }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--sky);
  font-size: 2rem;
  text-align: center;
  margin: 64px 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--orange);
  color: #fff;
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo img { width: 60px; height: auto; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 36px;
}
.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: .02em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav a:hover { color: #fde7d3; }
.site-nav a[aria-current="page"] { color: #dde9fb; border-bottom-color: #dde9fb; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  margin: 5px 0;
  background: #fff;
  transition: transform .2s, opacity .2s;
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .site-logo img { width: 48px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--orange);
    display: none;
    box-shadow: 0 8px 16px rgba(0,0,0,.12);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .site-nav a[aria-current="page"] { border-bottom-color: rgba(255,255,255,.2); }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Home hero ---------- */
.hero {
  text-align: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.hero__photo {
  width: min(424px, 80vw);
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto;
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--sky);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin: 32px 0 4px;
}
.hero__tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--ink);
  margin: 0;
}

.hero__intro {
  max-width: 620px;
  margin: 16px auto 0;
  font-size: 1rem;
  color: var(--text);
}

/* ---------- Post cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-card__image img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
.post-card__body { padding: 20px 18px 24px; }
.post-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 0 0 8px;
}
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--orange); }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card__meta { font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.post-card__excerpt { font-size: .95rem; color: var(--muted); margin: 0; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding-top: 48px;
}
.about__photo { width: 100%; }
.about .page-title { text-align: left; margin-top: 0; font-size: 2.2rem; color: var(--ink); }
.about__text p { font-size: 1rem; }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; padding-top: 24px; }
}

/* ---------- Prose (posts, about) ---------- */
.prose p { margin: 0 0 1.1em; }
.prose img { margin: 32px auto; }
.prose img.narrow { max-width: 420px; }
.prose a { color: var(--sky-deep); }

/* ---------- Portfolio ---------- */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -16px 0 40px;
}
.filters button {
  font: inherit;
  font-size: .9rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--orange);
  background: #fff;
  color: var(--orange-dark);
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--orange); color: #fff; }

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 20px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.85);
}
.pub[hidden] { display: none; }
.pub__image img { width: 120px; max-height: 170px; object-fit: contain; object-position: top; }
.pub__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.4;
}
.pub__title a { color: inherit; text-decoration: none; }
.pub__title a:hover { color: var(--orange); }
.pub__date { font-weight: 400; }
.pub__details { font-style: italic; margin: 0; }
.pub__publisher, .pub__note, .pub__sample { margin: 2px 0 0; font-size: .95rem; }
.pub__honor { margin: 6px 0 0; font-size: .95rem; color: var(--orange-dark); }
.pub__honor a { color: inherit; }
.pub__status {
  display: inline-block;
  margin: 8px 0 0;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--orange-dark);
}
.pub__links { margin: 10px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.pub__link {
  font-size: .85rem;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
}
.pub__link:hover { background: var(--orange-dark); color: #fff; }
.pub__link--post { background: #fff; color: var(--orange-dark); border: 1px solid var(--orange); }
.pub__link--post:hover { background: #fff7f0; color: var(--orange-dark); }

@media (max-width: 520px) {
  .pub { grid-template-columns: 80px 1fr; gap: 16px; padding: 16px; }
  .pub__image img { width: 80px; }
}

/* ---------- Post page ---------- */
.post__header { text-align: center; padding-top: 48px; }
.post__meta { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.post__title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin: 0 0 12px;
}
.post__subtitle { font-size: 1.2rem; color: var(--muted); margin: 0; }
.post__hero { margin: 32px 0; }
.post__hero img { margin: 0 auto; max-height: 640px; width: auto; }
.post__content { background: rgba(255,255,255,.85); padding: 32px clamp(20px, 4vw, 40px) 16px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; box-shadow: var(--shadow); }

.post__pubs { margin-top: 40px; }
.post__pubs h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--sky-deep);
  font-size: 1.4rem;
  margin: 0 0 16px;
}
.pub-list--compact .pub { grid-template-columns: 80px 1fr; gap: 16px; padding: 16px; }
.pub-list--compact .pub__image img { width: 80px; }

.post__pager {
  display: flex;
  justify-content: space-between;
  margin: 40px 0 0;
}
.post__pager a {
  color: var(--orange-dark);
  text-decoration: none;
}
.post__pager a:hover { text-decoration: underline; }

/* ---------- Contact / misc ---------- */
.contact, .notfound { text-align: center; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
}
.button:hover { background: var(--orange-dark); color: #fff; }
button.button { font: inherit; font-size: 1.05rem; border: 0; cursor: pointer; }
.email-reveal { margin: 24px 0; }
.email-reveal__result { margin: 0; }
.email-reveal__result .button { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.9);
  border-top: 1px solid var(--line);
  padding: 32px var(--gutter) 20px;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;
}
.site-footer__brand img { width: 56px; }
.site-footer__name { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--orange); line-height: 1.2; }
.site-footer__tagline { display: block; font-size: .95rem; }
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }
.social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
}
.social a:hover { background: var(--orange-dark); color: #fff; }
.site-footer__nav {
  max-width: var(--max);
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: .9rem;
}
.site-footer__nav a { color: var(--sky-deep); }
.poetry-more { margin-top: 48px; }
.site-footer__copy { text-align: center; font-size: .8rem; color: var(--muted); margin: 24px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
