/* ============================================================
   Danielle Piper — portfolio site
   Base styles / design system
   ============================================================ */

:root {
  --ink:        #26211e;   /* warm near-black text */
  --ink-soft:   #5c5349;   /* muted body / captions */
  --paper:      #f4f3ef;   /* warm gallery bone */
  --paper-2:    #eae7df;   /* subtle raised surface */
  --line:       #ddd7cc;   /* hairline borders */
  --accent:     #7c2d3a;   /* mihkwâ — oxblood / berry red */
  --accent-ink: #5f2029;   /* darker accent for hover */
  --sage:       #5f6650;   /* prairie sage — secondary label hue */
  --max:        1080px;
  --gap:        clamp(1rem, 4vw, 3rem);
  --serif:      "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gap); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 243, 239, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}
.brand {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600;
  color: var(--ink); letter-spacing: .01em; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }
.nav-links a {
  color: var(--ink-soft); font-size: .95rem; text-decoration: none;
  padding-block: .25rem; border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle { display: none; }

/* ---------- home banner image (wide, natural ratio) ---------- */
.home-banner { width: 100%; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.home-banner img { width: 100%; height: auto; display: block; }

/* ---------- home banner slideshow ---------- */
.banner-slideshow {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 68vh; overflow: hidden;
  background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.banner-slideshow img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: center 38%; opacity: 0; transition: opacity 1s ease;
}
.banner-slideshow img.active { opacity: 1; }
.banner-credit {
  position: absolute; right: .6rem; bottom: .55rem; z-index: 2;
  background: rgba(38, 33, 30, .6); color: #fff; font-size: .72rem;
  letter-spacing: .03em; padding: .2rem .55rem; border-radius: 6px;
}
@media (max-width: 640px) { .banner-slideshow { aspect-ratio: 4 / 3; } }
@media (prefers-reduced-motion: reduce) { .banner-slideshow img { transition: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); }
.syllabics {
  font-family: var(--serif); font-size: clamp(2.4rem, 7vw, 4rem);
  color: var(--accent); margin: 0 0 1.25rem; line-height: 1.1;
}
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 62ch; color: var(--ink); }
.lede + .lede { margin-top: 1rem; }

/* intro + "Upcoming" box side by side on wide screens, stacked on phones */
.hero-grid.has-aside {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
}
.hero-aside { position: sticky; top: 5rem; }
.card.upcoming { border-top: 4px solid var(--accent); }
.card.upcoming h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.card.upcoming p:last-child { margin-bottom: 0; color: var(--ink-soft); }
@media (max-width: 860px) {
  .hero-grid.has-aside { grid-template-columns: 1fr; }
  .hero-aside { position: static; }
}

/* ---------- sections ---------- */
section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  color: var(--sage); font-weight: 700; margin: 0 0 .6rem;
}

/* ---------- announcement card ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 0 1px 2px rgba(42,35,32,.04);
}
.card h2 { margin-bottom: .25em; }

/* ---------- newsletter ---------- */
.newsletter { max-width: 620px; }
.newsletter p { color: var(--ink-soft); }
.signup {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem;
}
.signup input[type="email"] {
  flex: 1 1 240px; padding: .8rem 1rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.signup input[type="email"]:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.btn {
  display: inline-block; padding: .8rem 1.4rem; font-size: 1rem; font-weight: 600;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px; cursor: pointer;
}
.btn:hover { background: var(--accent-ink); color: #fff; text-decoration: none; }
.stub-note {
  font-size: .82rem; color: var(--ink-soft); margin-top: .6rem; font-style: italic;
}

/* ---------- project grid ---------- */
.grid {
  display: grid; gap: clamp(1rem, 3vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tile { display: block; color: var(--ink); }
.tile:hover { text-decoration: none; color: var(--ink); }
.tile-img { border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.tile img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  transition: transform .5s ease;
}
.tile h3 { transition: color .2s ease; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile:hover h3, .tile:focus-visible h3 { color: var(--accent); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.tile .thumb-fallback {
  border-radius: 12px; aspect-ratio: 4 / 3; background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-family: var(--serif); font-size: 1.1rem; text-align: center; padding: 1rem;
}
.tile h3 { margin: .7rem 0 .1rem; }
.tile .year { color: var(--ink-soft); font-size: .9rem; }

/* ---------- article / long text ---------- */
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.1rem; }
.prose h2 { margin-top: 2rem; }
.muted { color: var(--ink-soft); font-style: italic; }

/* ---------- project detail ---------- */
.proj-head { padding-top: clamp(2rem, 5vw, 3rem); }
.proj-head .eyebrow a { color: var(--sage); }
.proj-year { color: var(--ink-soft); font-size: 1.05rem; margin-top: -.3rem; }
.hero-link { display: block; cursor: zoom-in; margin-block: 1.5rem; }
.proj-hero {
  width: 100%; border-radius: 14px;
  max-height: 78vh; object-fit: contain; background: var(--paper-2);
}
/* photos keep their own shape (no cropping), flowing into up to 3 columns */
.gallery {
  columns: 3 240px; column-gap: clamp(.6rem, 2vw, 1rem); margin-block: 1.5rem 1rem;
}
.gallery .gimg {
  display: block; break-inside: avoid; margin-bottom: clamp(.6rem, 2vw, 1rem);
  border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--paper-2);
}
.audio-label { color: var(--sage); font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
.sc-player { border-radius: 10px; margin-bottom: 1.5rem; max-width: 640px; }
.gallery img { width: 100%; height: auto; transition: transform .4s ease; }
@media (max-width: 560px) { .gallery { columns: 2; } } /* phones: two narrow columns browse better than one huge one */
.gallery .gimg:hover img { transform: scale(1.03); }
.gallery .gimg:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- photo viewer (lightbox) ---------- */
html.lb-open { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #fff;
}
.lightbox::backdrop { background: rgba(20, 17, 15, .94); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-figure {
  margin: 0; width: 100%; height: 100%; padding: 4.5rem 5rem 3rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
}
.lb-img {
  max-width: 100%; max-height: calc(100dvh - 8rem); width: auto; height: auto;
  object-fit: contain; border-radius: 6px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.lb-count { font-size: .85rem; letter-spacing: .08em; color: rgba(255, 255, 255, .7); min-height: 1.2em; }
.lb-btn {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; padding: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
  font-size: 1.9rem; line-height: 1;
}
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(255, 255, 255, .22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 640px) {
  /* phones: photo uses the full width; arrows sit at the bottom, within thumb reach */
  .lb-figure { padding: 4rem .5rem 5.5rem; }
  .lb-img { max-height: calc(100dvh - 10rem); border-radius: 4px; }
  .lb-prev, .lb-next { top: auto; bottom: 1.25rem; transform: none; }
  .lb-prev { left: calc(50% - 4rem); }
  .lb-next { right: calc(50% - 4rem); }
}

/* video embeds (media page) */
.video-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 1rem 0 2.5rem; max-width: 900px; }
.video-embed { margin: 0; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed figcaption { margin-top: .55rem; color: var(--ink-soft); font-size: .9rem; line-height: 1.4; }

/* CV specific */
.cv-section { margin-bottom: 2rem; }
.cv-section h2 { border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.cv-entry { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding-block: .4rem; }
.cv-entry .yr { color: var(--accent); font-weight: 600; }
@media (max-width: 520px){ .cv-entry { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--paper-2);
  padding-block: 2.5rem; margin-top: 3rem;
}
.socials { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0 0 1rem; }
.socials a { color: var(--ink); font-weight: 600; }
.foot-fine { color: var(--ink-soft); font-size: .85rem; }

/* ---------- responsive nav ---------- */
@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex; background: none; border: 1px solid var(--line);
    border-radius: 8px; padding: .45rem .6rem; cursor: pointer; color: var(--ink); font-size: 1rem;
  }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--line); padding: .5rem var(--gap) 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding-block: .6rem; border-bottom: 1px solid var(--line); width: 100%; }
  .site-header { position: relative; }
}
