/* ============================================
   Molly Measells — mollymeasells.com
   Palette: Pacific + Aegean. Airy, modern, warm.
   ============================================ */

:root {
  --ink:        #0F2233;
  --ink-soft:   #46586B;
  --ink-faint:  #8B9AA8;
  --sea:        #2C7DA0;
  --sea-deep:   #1B5A78;
  --foam:       #EDF5F8;
  --foam-deep:  #DCEBF1;
  --paper:      #FFFFFF;
  --coral:      #FF6F5E;
  --coral-deep: #E8543F;
  --sand:       #F5E9D7;
  --line:       #DFE7EC;

  --display: "Instrument Serif", Georgia, serif;
  --body:    "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gut:  clamp(1.25rem, 4vw, 3rem);
  --wide: 1160px;
  --read: 660px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--sea); text-decoration: none; }
a:hover { color: var(--coral); }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}
h1 { font-size: clamp(2.75rem, 7.5vw, 5.25rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h3 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }

.eyebrow {
  font-family: var(--body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sea);
  margin: 0 0 1rem;
}
.eyebrow--coral { color: var(--coral); }

.lede {
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.serif-em {
  font-family: var(--display);
  font-style: italic;
  color: var(--sea-deep);
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.wrap--read { max-width: calc(var(--read) + var(--gut) * 2); }

.band { padding-block: clamp(4rem, 10vw, 8rem); }
.band--foam { background: var(--foam); }
.band--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__in {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 1.1rem var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav__mark {
  font-family: var(--display);
  font-size: 1.375rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav__mark:hover { color: var(--ink); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-block: 2px;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--ink); }

.nav__toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  padding: .5rem; margin-right: -.5rem;
  color: var(--ink);
}
.nav__toggle svg { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0.85rem 1.6rem;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease),
              box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--coral { background: var(--coral); color: #fff; box-shadow: 0 6px 20px -8px rgba(255,111,94,.9); }
.btn--coral:hover { background: var(--coral-deep); color: #fff; box-shadow: 0 12px 28px -10px rgba(255,111,94,.95); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: 0.6rem 1.15rem; font-size: 0.875rem; }
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================
   HERO
   ============================================ */
.hero { position: relative; padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem); overflow: hidden; }
.hero__glow {
  position: absolute;
  top: -30%; right: -10%;
  width: min(70vw, 780px); aspect-ratio: 1;
  background: radial-gradient(circle, rgba(44,125,160,.13), rgba(44,125,160,0) 68%);
  pointer-events: none;
  z-index: 0;
}
.hero__glow--2 {
  top: 25%; right: auto; left: -18%;
  width: min(55vw, 560px);
  background: radial-gradient(circle, rgba(255,111,94,.11), rgba(255,111,94,0) 68%);
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero__title { margin-bottom: 1.5rem; }
.hero__title em {
  font-style: italic;
  color: var(--sea);
  display: block;
}
.hero__lede { max-width: 30rem; margin: 0 0 2.25rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__frame { position: relative; }
.hero__photo {
  width: 100%;
  border-radius: 260px 260px 18px 18px;
  object-fit: cover;
  aspect-ratio: 4/5;
  box-shadow: 0 30px 60px -30px rgba(15,34,51,.35);
}
.hero__badge {
  position: absolute;
  bottom: -1.25rem; left: -1.25rem;
  background: var(--paper);
  border-radius: 16px;
  padding: .9rem 1.15rem;
  box-shadow: 0 16px 36px -18px rgba(15,34,51,.4);
  text-align: left;
}
.hero__badge-k {
  font-size: 0.625rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .15rem;
}
.hero__badge-v {
  font-family: var(--display); font-size: 1.5rem; color: var(--ink); line-height: 1;
}

/* ============================================
   SIGNATURE — The Passage
   ============================================ */
.passage { position: relative; }
.passage__rail {
  position: relative;
  margin-top: 2.5rem;
  padding-top: 2.75rem;
}
.passage__line {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--line);
}
.passage__fill {
  position: absolute;
  top: 0; left: 0; height: 1px;
  background: var(--coral);
  width: 0;
  transition: width 2.2s var(--ease);
}
.passage__stops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.passage__stop { position: relative; padding-right: 1rem; }
.passage__dot {
  position: absolute;
  top: calc(-2.75rem - 4px);
  left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition: background .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
.passage__stop.is-on .passage__dot {
  background: var(--coral);
  border-color: var(--coral);
  transform: scale(1.25);
}
.passage__stop:last-child .passage__dot { border-style: dashed; }
.passage__k {
  font-size: 0.625rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 .3rem;
}
.passage__place {
  font-family: var(--display); font-size: clamp(1.15rem,2vw,1.5rem);
  color: var(--ink); line-height: 1.15; margin: 0 0 .3rem;
}
.passage__note { font-size: 0.875rem; color: var(--ink-soft); margin: 0; }

/* ============================================
   PROGRESS — rising water
   ============================================ */
.tide {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--foam);
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.tide__water {
  position: absolute;
  left: 0; bottom: 0; width: 100%;
  height: 0;
  background: linear-gradient(180deg, rgba(44,125,160,.30), rgba(44,125,160,.16));
  transition: height 2s var(--ease);
  z-index: 0;
}
.tide__water::before {
  content: "";
  position: absolute; top: -1px; left: 0;
  width: 100%; height: 2px;
  background: var(--sea);
  opacity: .55;
}
.tide__in {
  position: relative;
  z-index: 1;
  padding: 1.75rem;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.tide__num {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
  color: var(--ink);
}
.tide__num span { font-size: .5em; color: var(--ink-faint); }
.tide__meta { font-size: .875rem; color: var(--ink-soft); margin: .4rem 0 0; }

/* ============================================
   Generic pieces
   ============================================ */
.head { max-width: var(--read); margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.head--center { margin-inline: auto; text-align: center; }
.head p { margin: 1rem 0 0; }

.prose { max-width: var(--read); }
.prose p { margin: 0 0 1.4rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose .pull {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.25;
  color: var(--sea-deep);
  margin: 2.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--coral);
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Two ways to help ---------- */
.ways { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.way {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.way:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 22px 44px -24px rgba(15,34,51,.3);
}
.way h3 { margin-bottom: .65rem; }
.way p { color: var(--ink-soft); margin: 0 0 1.5rem; }
.way__n {
  font-family: var(--display);
  font-size: 1.125rem;
  color: var(--coral);
  display: block;
  margin-bottom: .75rem;
}

/* ---------- Notes / field updates ---------- */
.notes { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.note {
  background: var(--paper);
  padding: clamp(1.35rem, 3vw, 2rem) 0;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}
.note__date {
  font-size: .75rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
  padding-top: .45rem;
}
.note__t { font-family: var(--display); font-size: 1.5rem; margin: 0 0 .5rem; line-height: 1.2; }
.note__b { color: var(--ink-soft); margin: 0; }

/* Markdown inside a field note */
.note__b > *:first-child { margin-top: 0; }
.note__b > *:last-child { margin-bottom: 0; }
.note__b p { margin: 0 0 .9rem; }
.note__b h3, .note__b h4, .note__b h5, .note__b h6 {
  font-family: var(--display);
  color: var(--ink);
  line-height: 1.25;
  margin: 1.5rem 0 .5rem;
}
.note__b h3 { font-size: 1.25rem; }
.note__b h4 { font-size: 1.0625rem; }
.note__b h5, .note__b h6 { font-size: 1rem; }
.note__b strong { color: var(--ink); font-weight: 600; }
.note__b em { font-style: italic; }
.note__b a { color: var(--sea); text-decoration: underline; text-underline-offset: 2px; }
.note__b a:hover { color: var(--coral); }
.note__b ul, .note__b ol { margin: 0 0 .9rem; padding-left: 1.25rem; }
.note__b li { margin-bottom: .35rem; }
.note__b blockquote {
  margin: 1.1rem 0;
  padding: .15rem 0 .15rem 1.1rem;
  border-left: 2px solid var(--coral);
  font-family: var(--display);
  font-size: 1.1875rem;
  line-height: 1.4;
  color: var(--sea-deep);
}
.note__b code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875em;
  background: var(--foam);
  padding: .12em .4em;
  border-radius: 4px;
  color: var(--ink);
}
.note__b img { border-radius: 12px; margin: 1.1rem 0; }
.note__b hr { border: 0; height: 1px; background: var(--line); margin: 1.5rem 0; }


/* ---------- Gallery ---------- */
.gal { columns: 3; column-gap: 1rem; }
.gal__item { break-inside: avoid; margin-bottom: 1rem; position: relative; }
.gal__item img {
  width: 100%;
  border-radius: 14px;
  transition: transform .5s var(--ease);
}
.gal__item:hover img { transform: scale(1.015); }
.gal__cap {
  font-size: .8125rem; color: var(--ink-soft);
  margin: .6rem 0 0; padding-inline: .15rem;
}

/* ---------- Empty states ---------- */
.empty {
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 1rem;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--ink-soft);
}
.empty h3 { color: var(--ink); margin-bottom: .5rem; }
.empty p { margin: 0 auto; max-width: 34rem; }

/* ---------- Substack CTA ---------- */
.sub {
  background: var(--ink);
  color: #fff;
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.sub h2 { color: #fff; margin-bottom: .85rem; }
.sub p { color: rgba(255,255,255,.72); max-width: 34rem; margin: 0 auto 2rem; }
.sub .btn--coral { box-shadow: none; }

/* ---------- Footer ---------- */
.foot { background: var(--foam); padding-block: clamp(3rem, 7vw, 4.5rem) 2rem; }
.foot__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
}
.foot__mark { font-family: var(--display); font-size: 1.75rem; margin: 0 0 .6rem; }
.foot__blurb { color: var(--ink-soft); font-size: .9375rem; margin: 0; max-width: 24rem; }
.foot__h {
  font-size: .6875rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .9rem;
}
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.foot__list a { color: var(--ink-soft); font-size: .9375rem; }
.foot__list a:hover { color: var(--coral); }
.foot__bar {
  border-top: 1px solid var(--foam-deep);
  padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .75rem;
  justify-content: space-between;
  font-size: .8125rem; color: var(--ink-faint);
}

/* ---------- Reveal ----------
   Only hides when JS is confirmed running (html.js). If anything
   goes wrong, content renders normally instead of staying invisible. */
.js .rise { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .rise.is-in { opacity: 1; transform: none; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__frame { max-width: 380px; margin-inline: auto; order: -1; }
  .hero__photo { border-radius: 200px 200px 18px 18px; }
  .ways { grid-template-columns: 1fr; }
  .gal { columns: 2; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed;
    inset: 62px 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gut) 1.25rem;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__link { padding-block: .8rem; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }
  .nav__links .btn { margin-top: 1rem; justify-content: center; }
  .nav__toggle { display: block; }

  .passage__stops { grid-template-columns: 1fr; gap: 1.75rem; }
  .passage__rail { padding-top: 0; padding-left: 1.75rem; }
  .passage__line { top: 0; left: 4px; width: 1px; height: 100%; }
  .passage__fill { width: 1px !important; height: 0; transition: height 2.2s var(--ease); }
  .passage__dot { top: .35rem; left: -1.75rem; }

  .note { grid-template-columns: 1fr; gap: .5rem; }
  .note__date { padding-top: 0; }
  .gal { columns: 1; }
  .foot__grid { grid-template-columns: 1fr; }
  .hero__badge { left: 0; bottom: -1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .rise { opacity: 1; transform: none; }
}
