/* ---------------------------------------------------------------
   Coco — warm editorial scrapbook
   Paper, ink, one amber accent, photographs as physical objects.
--------------------------------------------------------------- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-400.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f5edde;
  --paper-raised: #fbf7ee;
  --ink: #2b2119;
  --muted: #5f4f3b;
  --line: rgba(43, 33, 25, 0.16);
  --line-strong: rgba(43, 33, 25, 0.28);
  --accent: #c35a21;
  --accent-deep: #8e3d13;
  --tape: rgba(214, 190, 148, 0.72);
  --paper-shadow: 0 1px 1px rgba(43, 33, 25, 0.08),
    0 22px 40px -26px rgba(43, 33, 25, 0.62);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  --display: "Bricolage Grotesque", "Arial Black", "Helvetica Neue", sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(2.5rem, 8vw, 7rem);
  --measure: 62ch;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 16% 5%, rgba(255, 253, 247, 0.95), transparent 40%),
    radial-gradient(circle at 88% -3%, rgba(195, 90, 33, 0.09), transparent 33%),
    radial-gradient(rgba(43, 33, 25, 0.045) 0.55px, transparent 0.65px);
  background-size: auto, auto, 4px 4px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--paper-raised);
}

h1,
h2,
p,
figure,
dl,
dd,
blockquote {
  margin: 0;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Masthead ------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--line-strong);
}

.masthead-inner,
.page,
.colophon {
  width: min(1120px, calc(100% - var(--gutter)));
  margin-inline: auto;
}

.masthead-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 0 1.05rem;
}

.wordmark {
  position: relative;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.wordmark::after {
  content: "";
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.12em;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-0.02em);
}

.masthead-meta {
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Hero ---------------------------------------------------------- */

.page {
  padding: clamp(2.75rem, 6vw, 5rem) 0 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.82fr);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 6rem);
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-copy {
  padding-bottom: clamp(0.25rem, 2vw, 1.5rem);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(4.4rem, 15vw, 10.5rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.04em;
  margin-left: -0.04em;
  margin-bottom: clamp(1.8rem, 3.5vw, 2.8rem);
  max-width: 100%;
  white-space: nowrap;
}

.age {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 1.0625rem;
  line-height: 1.4;
  margin-bottom: 0.45rem;
}

.age::before {
  content: "";
  flex: 0 0 auto;
  align-self: center;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

.born {
  margin-left: calc(6px + 0.55rem);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.birthday-note {
  display: inline-block;
  margin: 1.1rem 0 0 calc(6px + 0.55rem);
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--accent);
  color: var(--accent-deep);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.birthday-note[hidden] {
  display: none;
}

.portrait {
  position: relative;
  justify-self: end;
  width: min(100%, 400px);
  margin-top: clamp(1.25rem, 4vw, 3.5rem);
  padding: 0.7rem 0.7rem 2.3rem;
  background: var(--paper-raised);
  box-shadow: var(--paper-shadow);
  transform: rotate(1.6deg);
  cursor: zoom-in;
  transition: transform 300ms var(--spring);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e9dcc7;
}

.portrait-caption {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.2;
  text-align: right;
}

.portrait:hover,
.portrait:focus-visible {
  transform: rotate(0deg) translateY(-4px);
}

.portrait:active {
  transform: rotate(0deg) scale(0.988);
  transition-duration: 110ms;
}

.tape {
  position: absolute;
  top: -0.6rem;
  z-index: 2;
  width: 3.4rem;
  height: 1.25rem;
  background: linear-gradient(
    180deg,
    rgba(231, 211, 172, 0.9),
    var(--tape)
  );
  box-shadow: 0 1px 1px rgba(43, 33, 25, 0.12);
  mix-blend-mode: multiply;
}

.tape-left {
  left: 1.15rem;
  transform: rotate(-7deg);
}

.tape-right {
  right: 1.15rem;
  transform: rotate(5deg);
}

/* Section furniture -------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  border-top: 1px solid var(--line-strong);
  padding-top: 0.85rem;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.section-rule {
  flex: 1 1 auto;
  align-self: center;
  height: 1px;
  background: var(--line);
}

.section-note {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.2;
}

/* About --------------------------------------------------------- */

.about {
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  gap: clamp(2.25rem, 6vw, 5.5rem);
  align-items: start;
}

.about-prose {
  max-width: var(--measure);
}

.about-prose p {
  margin-bottom: 1.15rem;
  font-size: 1.0625rem;
  line-height: 1.64;
}

.about-prose .lede {
  font-size: 1.1rem;
}

.about-prose blockquote {
  margin: 2rem 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--accent-deep);
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  font-style: italic;
  line-height: 1.24;
  letter-spacing: -0.012em;
}

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

.facts {
  border-top: 1px solid var(--line-strong);
}

.fact {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.82rem 0 0.86rem;
  border-bottom: 1px solid var(--line);
}

.fact dt {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1.3;
}

.fact dt::before {
  content: "";
  flex: 0 0 auto;
  align-self: center;
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.fact dd {
  text-align: right;
  font-size: 1rem;
  line-height: 1.35;
}

/* Gallery ------------------------------------------------------- */

.photos {
  padding-bottom: clamp(4rem, 9vw, 7rem);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(1.15rem, 2.3vw, 1.9rem) clamp(1rem, 2vw, 1.6rem);
}

.gallery figure {
  position: relative;
  padding: 0.5rem 0.5rem 1.55rem;
  background: var(--paper-raised);
  box-shadow: var(--paper-shadow);
  transform: rotate(var(--rot, 0deg));
  cursor: zoom-in;
  transition: transform 280ms var(--spring);
}

.gallery figure:nth-child(4n + 1) {
  --rot: -1.35deg;
}

.gallery figure:nth-child(4n + 2) {
  --rot: 0.85deg;
}

.gallery figure:nth-child(4n + 3) {
  --rot: 1.2deg;
}

.gallery figure:nth-child(4n + 4) {
  --rot: -0.7deg;
}

.gallery figure:hover,
.gallery figure:focus-visible {
  transform: rotate(0deg) translateY(-4px);
}

.gallery figure:active {
  transform: rotate(0deg) scale(0.985);
  transition-duration: 110ms;
}

.gallery img {
  display: block;
  width: 100%;
  /* the HTML height="1024" attribute maps to height:1024px, which overrides
     aspect-ratio and blows each tile up into a ~1000px-tall strip. */
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 35%;
  background: #e9dcc7;
}

.gallery figure:nth-child(4n + 1)::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  z-index: 2;
  width: 3.1rem;
  height: 1.05rem;
  margin-left: -1.55rem;
  background: linear-gradient(
    180deg,
    rgba(231, 211, 172, 0.9),
    var(--tape)
  );
  box-shadow: 0 1px 1px rgba(43, 33, 25, 0.12);
  transform: rotate(-2deg);
  mix-blend-mode: multiply;
}

.gallery figure:nth-child(6n + 2)::after {
  content: "";
  position: absolute;
  top: 0.28rem;
  left: 50%;
  z-index: 3;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: -0.275rem;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3ad7d, var(--accent) 68%);
  box-shadow: 0 2px 3px rgba(43, 33, 25, 0.38);
}

/* Footer -------------------------------------------------------- */

.colophon {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--line-strong);
  padding: 1.35rem 0 3.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.colophon-mark {
  flex: 0 0 auto;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Lightbox ------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 5vw, 4rem);
  background: radial-gradient(
    circle at 50% 42%,
    rgba(43, 33, 25, 0.93),
    rgba(18, 13, 9, 0.975)
  );
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 250ms var(--spring), visibility 0s 260ms;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 250ms var(--spring), visibility 0s;
}

.lightbox-frame {
  padding: 0.65rem;
  max-width: min(92vw, 1200px);
  background: var(--paper-raised);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.5);
  transform: scale(0.96) translateY(8px);
  transition: transform 300ms var(--spring);
}

.lightbox.is-open .lightbox-frame {
  transform: scale(1) translateY(0);
}

.lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(245, 237, 222, 0.42);
  border-radius: 50%;
  background: rgba(245, 237, 222, 0.07);
  color: var(--paper);
  cursor: pointer;
  transition: transform 220ms var(--spring);
}

.lightbox-close::before,
.lightbox-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 1.5px;
  background: currentColor;
}

.lightbox-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  transform: scale(1.07);
}

.lightbox-close:focus-visible {
  outline-color: var(--paper);
  outline-offset: 3px;
}

.lightbox-close:active {
  transform: scale(0.93);
}

body.lightbox-open {
  overflow: hidden;
}

/* Responsive ---------------------------------------------------- */

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 2.75rem;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .portrait {
    justify-self: start;
    width: min(76%, 360px);
    margin-top: 0;
    margin-left: clamp(0rem, 4vw, 2rem);
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.75rem;
  }

  .facts {
    max-width: 32rem;
  }
}

@media (max-width: 620px) {
  .masthead-inner {
    gap: 1rem;
  }

  .masthead-meta {
    font-size: 0.82rem;
    text-align: right;
  }

  .hero h1 {
    font-size: clamp(3.9rem, 18vw, 5.3rem);
  }

  .gallery figure {
    padding: 0.42rem 0.42rem 1.05rem;
  }

  .portrait {
    width: min(82%, 330px);
    margin-top: 0;
    margin-left: 0;
  }

  .colophon {
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 2.5rem;
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 2rem;
  }

  .section-head {
    gap: 0.7rem;
  }

  .section-note {
    font-size: 0.82rem;
  }
}

/* Reduced motion ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .portrait,
  .portrait:hover,
  .portrait:focus-visible,
  .portrait:active {
    transform: rotate(1.6deg);
  }

  .gallery figure,
  .gallery figure:hover,
  .gallery figure:focus-visible,
  .gallery figure:active {
    transform: rotate(var(--rot, 0deg));
  }

  .lightbox-frame,
  .lightbox.is-open .lightbox-frame {
    transform: none;
  }

  .lightbox-close:hover,
  .lightbox-close:focus-visible,
  .lightbox-close:active {
    transform: none;
  }
}
