/* ==========================================================================
   Havens Pathway Inc. — risograph poster system
   Four inks on bone paper. Type at poster scale. Grain on everything.
   ========================================================================== */

:root {
  --paper:  #FBF7EE;
  --ink:    #161220;
  --violet: #4B2EE8;
  --flare:  #FF4B1F;
  --sun:    #FFC93C;
  --teal:   #00A98F;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body:    "Newsreader", Georgia, serif;

  --gutter: clamp(1.25rem, 4vw, 5rem);
  --maxw: 1560px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.16rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.035em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--violet); color: #fff; }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}
.p-violet :focus-visible, .p-ink :focus-visible { outline-color: var(--sun); }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 300;
  background: var(--sun); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  padding: .7rem 1.1rem; border-radius: 2px; text-decoration: none;
  transition: top .18s ease;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------- ink panels */
.panel {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 8.5rem);
  isolation: isolate;
  overflow: hidden;
}
.panel > .inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw);
  margin-inline: auto; padding-inline: var(--gutter);
}

/* Paper grain over every field, multiplied the way ink sits on stock */
.panel::after {
  content: "";
  position: absolute; inset: 0; z-index: 3;
  background-image: url("img/grain.png");
  background-size: 300px 300px;
  mix-blend-mode: multiply;
  opacity: .55;
  pointer-events: none;
}

.p-paper  { background: var(--paper); color: var(--ink); }
.p-violet { background: var(--violet); color: var(--paper); }
.p-flare  { background: var(--flare);  color: var(--ink); }
.p-sun    { background: var(--sun);    color: var(--ink); }
.p-teal   { background: var(--teal);   color: var(--ink); }
.p-ink    { background: var(--ink);    color: var(--paper); }

/* ------------------------------------------------------------------- type */
.d1 { font-size: clamp(2.9rem, 8.2vw, 7rem); line-height: .9; }
.d2 { font-size: clamp(2.1rem, 4.6vw, 3.9rem); }
.d3 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); }
.d4 { font-size: clamp(1.3rem, 2.1vw, 1.9rem); line-height: 1.02; letter-spacing: -.025em; }

.lede { font-size: clamp(1.18rem, 1.8vw, 1.62rem); line-height: 1.4; max-width: 38ch; }
.body { max-width: 62ch; }
.small { font-family: var(--display); font-weight: 600; font-size: .92rem; line-height: 1.35; }

/* A label set as a rotated sticker, not a tracked-out eyebrow */
.sticker {
  display: inline-block;
  font-family: var(--display); font-weight: 700; font-size: .94rem;
  letter-spacing: -.01em;
  background: var(--ink); color: var(--paper);
  padding: .42rem .95rem;
  transform: rotate(-2.2deg);
  border-radius: 2px;
}
.sticker.s-sun    { background: var(--sun);    color: var(--ink); }
.sticker.s-flare  { background: var(--flare);  color: var(--ink); }
.sticker.s-teal   { background: var(--teal);   color: var(--ink); }
.sticker.s-paper  { background: var(--paper);  color: var(--ink); }
.sticker.s-violet { background: var(--violet); color: var(--paper); }

.rule { height: 10px; background: currentColor; margin-block: clamp(1.5rem, 3vw, 2.75rem); }
.rule.thin { height: 3px; opacity: .45; }

/* --------------------------------------------------------------- masthead */
.masthead { position: relative; z-index: 50; background: var(--ink); color: var(--paper); }
.masthead .inner {
  max-width: var(--maxw); margin-inline: auto; padding: .85rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.logo {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.04em;
  text-decoration: none;
}
.logo svg { flex: none; }
.mainnav { display: none; gap: 1.35rem; font-family: var(--display); font-weight: 600; font-size: .95rem; }
@media (min-width: 1000px) { .mainnav { display: flex; } }
.mainnav a { text-decoration: none; opacity: .72; }
.mainnav a:hover { opacity: 1; }
.mainnav a.on { opacity: 1; box-shadow: inset 0 -4px 0 var(--sun); }
.navcta {
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  background: var(--sun); color: var(--ink);
  padding: .5rem 1rem; text-decoration: none; border-radius: 2px;
}
.navtoggle {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  background: transparent; color: var(--paper);
  border: 3px solid rgba(251,247,238,.4); border-radius: 2px;
  padding: .4rem .8rem; cursor: pointer;
}
@media (min-width: 1000px) { .navtoggle { display: none; } }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 1.25rem var(--gutter);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer[hidden] { display: none; }
.drawer a { text-decoration: none; }
.drawer__list { margin-top: 2rem; display: grid; }
.drawer__list a {
  display: block; font-family: var(--display); font-weight: 800;
  font-size: clamp(1.7rem, 8vw, 2.4rem); letter-spacing: -.04em;
  padding: .5rem 0; border-bottom: 3px solid rgba(251,247,238,.18);
}
.drawer__list a.on { color: var(--sun); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 700; font-size: 1.02rem;
  padding: .85rem 1.5rem; border-radius: 2px; text-decoration: none;
  border: 3px solid currentColor;
}
.btn.fill { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.fill-sun { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.btn.fill-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ------------------------------------------------------------------ grids */
.grid { display: grid; gap: clamp(1.5rem, 3vw, 3rem); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-73 { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
.g-46 { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); }
.g-55 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .g-2, .g-3, .g-73, .g-46, .g-55 { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------- hero */
.hero { position: relative; min-height: 88vh; display: flex; align-items: flex-end; padding-block: clamp(3rem, 6vw, 6rem); }
.hero .art { position: absolute; inset: 0; z-index: 0; }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero .scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(22,18,32,.06) 0%, rgba(22,18,32,.18) 45%, rgba(22,18,32,.34) 100%);
}
.hero .inner { position: relative; z-index: 2; color: var(--paper); }

.pagehead { padding-block: clamp(3.5rem, 7vw, 7rem) clamp(3rem, 6vw, 6rem); }

/* -------------------------------------------------------- directory rows */
.rows { border-top: 3px solid currentColor; }
.row {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 1rem 2.5rem; padding-block: clamp(1rem, 2.2vw, 1.65rem);
  border-bottom: 3px solid currentColor; align-items: start;
}
@media (max-width: 900px) { .row { grid-template-columns: minmax(0, 1fr); gap: .35rem; } }
.row h3 { font-size: clamp(1.3rem, 2.2vw, 1.85rem); }

/* ------------------------------------------------------------ pill lists */
.pills { display: flex; flex-wrap: wrap; gap: .55rem; }
.pill {
  font-family: var(--display); font-weight: 600; font-size: .98rem;
  border: 3px solid currentColor; padding: .38rem .85rem; border-radius: 100px;
}

/* ------------------------------------------------------------ tick lists */
.ticks li { position: relative; padding-left: 1.7rem; margin-bottom: .55rem; font-size: 1.06rem; break-inside: avoid; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 11px; height: 11px; background: currentColor;
}

/* --------------------------------------------------------------- figures */
.slot { position: relative; }
.slot img { width: 100%; height: auto; }

/* ----------------------------------------------------------------- forms */
.field { border: 3px solid currentColor; background: transparent; }
.field input, .field textarea, .field select {
  width: 100%; border: 0; background: transparent; color: inherit;
  font-family: var(--body); font-size: 1.05rem; padding: .85rem .9rem;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; }
.field:focus-within { box-shadow: 0 0 0 3px var(--violet); }

/* ---------------------------------------------------------------- footer */
.foot { background: var(--ink); color: var(--paper); }
.foot .inner { max-width: var(--maxw); margin-inline: auto; padding: clamp(3rem, 6vw, 5rem) var(--gutter); }
.foot a { text-decoration: none; opacity: .75; }
.foot a:hover { opacity: 1; text-decoration: underline; }
.foot h4 { font-size: .86rem; font-weight: 700; color: var(--sun); margin-bottom: .7rem; letter-spacing: 0; }

.statusnote {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 600; font-size: .9rem;
  border: 3px solid currentColor; padding: .38rem .9rem; border-radius: 100px;
}
.statusnote::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   Scroll motion. Every start state is scoped to html.motion, which is only
   added by JavaScript when reduced motion has NOT been requested. With
   scripts off, none of these rules apply and nothing is hidden.
   ========================================================================== */

:root { --ghost-a: #FF4B1F; --ghost-b: #00A98F; }
.p-violet { --ghost-a: #FFC93C; --ghost-b: #FF4B1F; }
.p-flare  { --ghost-a: #4B2EE8; --ghost-b: #FFC93C; }
.p-sun    { --ghost-a: #4B2EE8; --ghost-b: #FF4B1F; }
.p-teal   { --ghost-a: #FFC93C; --ghost-b: #4B2EE8; }
.p-ink    { --ghost-a: #FF4B1F; --ghost-b: #00A98F; }

html.motion .ink-register {
  text-shadow: 14px -11px 0 var(--ghost-a), -12px 9px 0 var(--ghost-b);
  opacity: .22;
}
html.motion .ink-register.is-in { animation: register .72s cubic-bezier(.16,.8,.24,1) forwards; }
@keyframes register {
  0%   { text-shadow: 14px -11px 0 var(--ghost-a), -12px 9px 0 var(--ghost-b); opacity: .22; }
  55%  { opacity: 1; }
  80%  { text-shadow: -3px 2px 0 var(--ghost-a), 2px -2px 0 var(--ghost-b); }
  100% { text-shadow: 0 0 0 var(--ghost-a), 0 0 0 var(--ghost-b); opacity: 1; }
}

html.motion .sheet-rise { opacity: 0; transform: translate3d(0, 18px, 0); }
html.motion .sheet-rise.is-in {
  opacity: 1; transform: none;
  transition: opacity .5s ease var(--stagger, 0ms),
              transform .62s cubic-bezier(.2,.8,.25,1) var(--stagger, 0ms);
}

html.motion .stamp { opacity: 0; transform: rotate(-2.2deg) scale(.86); transform-origin: left center; }
html.motion .stamp.is-in {
  opacity: 1; transform: rotate(-2.2deg) scale(1);
  transition: opacity .28s ease, transform .34s cubic-bezier(.2,1.5,.4,1);
}

/* A photograph is revealed the way a sheet clears the drum */
html.motion .plate { overflow: hidden; }
html.motion .plate img { transform: scale(1.1); transition: transform 1.1s cubic-bezier(.2,.8,.25,1); }
html.motion .plate.is-in img { transform: scale(1); }
html.motion .plate::before {
  content: ""; position: absolute; inset: 0; z-index: 4;
  background: var(--ghost-a); transform: translateY(0);
}
html.motion .plate.is-in::before {
  transform: translateY(-101%);
  transition: transform .78s cubic-bezier(.76,0,.18,1);
}

/* Hero curtain: the photograph is pinned and the next sheet stacks over it */
html.motion .hero { position: sticky; top: 0; z-index: 0; }
html.motion main > section:not(.hero) { position: relative; z-index: 1; }
html.motion .hero::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: var(--ink); opacity: var(--cover, 0); pointer-events: none;
}

/* Footer curtain: the page scrolls off the footer rather than into it */
html.motion.footer-curtain main { position: relative; z-index: 2; }
html.motion.footer-curtain .foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; }

/* Reading position */
.progress-track { height: 3px; background: rgba(251,247,238,.16); overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--sun); transform: scaleX(0); transform-origin: left center; }

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

@media print {
  .masthead, .drawer, .progress-track { display: none !important; }
  .panel { padding-block: 1.5rem; }
  .panel::after { display: none; }
  body { background: #fff; color: #000; }
}

/* Contact form status notes and honeypot ---------------------------------- */
.formnote {
  border: 3px solid currentColor; padding: .9rem 1.1rem; margin-bottom: 1.2rem;
  font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.4;
}
.formnote--bad { border-style: dashed; }
/* Off-screen rather than display:none — some bots skip hidden fields. */
.hp-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Small phones: keep logo, Contact and Menu on one line without sideways scroll */
@media (max-width: 480px) {
  .masthead .inner { gap: .6rem; }
  .logo { font-size: 1.05rem; gap: .45rem; }
  .logo svg { width: 26px; height: 26px; }
  .navcta { padding: .45rem .7rem; }
  .navtoggle { padding: .35rem .6rem; }
}
@media (max-width: 359px) { .navcta { display: none; } }
