@import url("tokens.css");

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--kraft);
  background-image:
    repeating-linear-gradient(97deg, rgba(109,90,63,.020) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(3deg,  rgba(36,28,20,.018) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08;
  color: var(--stencil); letter-spacing: .002em; margin: 0 0 var(--s2); }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 var(--s2); max-width: var(--measure); }
a { color: var(--barn-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--barn); }
[id] { scroll-margin-top: 7.5rem; }
::selection { background: var(--barn); color: var(--cream); }
:focus-visible { outline: 3px solid var(--barn); outline-offset: 2px; border-radius: var(--radius); }
* { scrollbar-color: var(--sack) var(--kraft-deep); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--stencil); color: var(--cream);
  padding: var(--s2) var(--s3); z-index: 200; border-radius: var(--radius); }
.skip:focus { left: var(--s2); top: var(--s2); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header: stencil block ---------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background-color: var(--kraft);
  background-image: repeating-linear-gradient(97deg, rgba(109,90,63,.03) 0 2px, transparent 2px 5px);
  border-bottom: var(--rule) solid var(--sack);
}
.masthead__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: var(--s3); padding: var(--s2) 0;
}
.stencilblock {
  justify-self: center; text-align: center; text-decoration: none;
  border: var(--rule) solid var(--stencil); border-radius: var(--radius);
  padding: .45rem 1.15rem .5rem; background: transparent;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stencilblock:hover { background: rgba(22,17,12,.06); transform: translateY(-1px); }
.stencilblock:active { transform: translateY(0); }
.stencilblock b {
  display: block; font-family: var(--display); font-weight: 400;
  font-size: clamp(1rem, 0.86rem + 0.62vw, 1.32rem); color: var(--stencil);
  line-height: 1.02; letter-spacing: .01em;
}
.stencilblock span {
  display: block; font-size: .72rem; letter-spacing: .2em; color: var(--sack);
  margin-top: .3rem;
}
.navlinks { display: flex; gap: var(--s3); align-items: center; margin: 0; padding: 0; list-style: none; }
.navlinks--r { justify-content: flex-end; }
.navlinks a {
  color: var(--ink); text-decoration: none; font-size: var(--step--1);
  letter-spacing: .04em; padding: .55rem .15rem; display: inline-block;
  border-bottom: var(--rule) solid transparent;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.navlinks a:hover { color: var(--stencil); border-bottom-color: var(--barn); }
.navlinks a[aria-current="page"] { border-bottom-color: var(--stencil); color: var(--stencil); }
.navtoggle { display: none; }

@media (max-width: 47rem) {
  .masthead__inner { grid-template-columns: 1fr; justify-items: center; gap: var(--s2); }
  .navlinks { display: none; }
  .navtoggle {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1rem;
    background: transparent; border: var(--rule) solid var(--sack); border-radius: var(--radius);
    font-family: var(--body); font-size: var(--step--1); color: var(--ink); cursor: pointer;
    letter-spacing: .06em;
  }
  .navtoggle svg { width: 18px; height: 18px; }
  .mnav { display: none; width: 100%; padding-bottom: var(--s2); }
  .mnav[data-open="true"] { display: block; }
  .mnav ul { list-style: none; margin: 0; padding: 0; }
  .mnav a {
    display: block; min-height: 44px; padding: .8rem .25rem; color: var(--ink);
    text-decoration: none; border-bottom: 1px dashed var(--sack); font-size: var(--step-0);
  }
  .mnav a[aria-current="page"] { color: var(--barn-deep); }
}
@media (min-width: 47.0625rem) { .mnav { display: none !important; } }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: var(--s4); }
.hero__frame { position: relative; border-radius: var(--radius); overflow: hidden; }
.hero__frame img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  object-position: center 38%;
  max-height: min(58vh, 30rem);
}
.hero__drift {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, rgba(255,238,201,0) 34%, rgba(255,236,196,.30) 50%, rgba(255,238,201,0) 66%);
  mix-blend-mode: soft-light; will-change: transform;
}
.hero__band {
  position: relative; margin: -3.6rem var(--s3) 0; z-index: 2;
  background-color: var(--kraft-lite);
  background-image: repeating-linear-gradient(97deg, rgba(109,90,63,.05) 0 2px, transparent 2px 5px);
  border: var(--rule) solid var(--stencil); border-radius: var(--radius);
  padding: var(--s3) var(--s4) var(--s4);
}
.hero__band h1 { margin-bottom: var(--s2); }
.stencilline { display: block; overflow: hidden; }
.stencilline > span { display: block; }
.hero__sub { font-size: var(--step-1); color: var(--sack); max-width: 46ch; margin-bottom: var(--s3); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }

@media (max-width: 40rem) {
  .hero__band { margin: -1.6rem var(--s1) 0; padding: var(--s3) var(--s2) var(--s3); }
  .hero__frame img { aspect-ratio: 3 / 2; max-height: 30vh; }
  .hero__band h1 { font-size: clamp(1.8rem, 1.20rem + 3.1vw, 2.4rem); }
  .hero__sub { font-size: var(--step-0); margin-bottom: var(--s2); }
  .hero__cta { gap: var(--s2); }
  .hero { padding-top: var(--s2); }
}

/* ---------- buttons and phone ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .8rem 1.5rem;
  background: var(--barn); color: var(--cream); text-decoration: none;
  border: var(--rule) solid var(--stencil); border-radius: var(--radius);
  font-family: var(--body); font-weight: 600; font-size: var(--step-0); letter-spacing: .02em;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color var(--dur) var(--ease), box-shadow 160ms var(--ease);
  box-shadow: 0 2px 0 var(--stencil);
}
.btn:hover { background: var(--barn-deep); color: var(--cream); transform: translateY(-1px); box-shadow: 0 3px 0 var(--stencil); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--stencil); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: 0 2px 0 var(--sack); }
.btn svg { width: 18px; height: 18px; }

.phonestencil {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .5rem;
  min-height: 44px;
  font-family: var(--display); font-size: var(--step-1); color: var(--stencil);
  text-decoration: none; letter-spacing: .01em; white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.phonestencil small { white-space: nowrap; }
.phonestencil small { font-family: var(--body); font-size: var(--step--1); letter-spacing: .16em; color: var(--sack); }
.phonestencil:hover { color: var(--barn); }
.phonestencil:hover small { color: var(--barn); }

/* ---------- sections and rules ---------- */
main > section { padding: var(--s6) 0; }
main > section:first-of-type { padding-top: var(--s3); }
.stitch { border: 0; border-top: var(--rule) dashed var(--sack); margin: 0; }
.lede { font-size: var(--step-1); color: var(--sack); max-width: 52ch; }
.inset {
  background-color: var(--kraft-lite);
  background-image: repeating-linear-gradient(97deg, rgba(109,90,63,.05) 0 2px, transparent 2px 5px);
  border: var(--rule) solid var(--sack); border-radius: var(--radius); padding: var(--s4);
}

.split { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 52rem) { .split { grid-template-columns: 1.05fr .95fr; gap: var(--s6); }
  .split--flip > *:first-child { order: 2; } }

.figure { border-radius: var(--radius); overflow: hidden; border: var(--rule) solid var(--sack); }
.figure img { width: 100%; object-fit: cover; }
/* keep tall portrait frames from driving a split row to an awkward height.
   object-position pulls the crop toward the subject rather than the sky. */
.split .figure img { max-height: 30rem; object-position: center 68%; }
figure { margin: 0; }
figcaption { font-size: var(--step--1); color: var(--sack); padding-top: var(--s1); }

/* photo strip: deliberately unequal sizes, not a card row */
.strip { display: grid; gap: var(--s3); }
@media (min-width: 46rem) { .strip { grid-template-columns: 1.4fr 1fr 1.2fr; align-items: end; } }
.strip .figure:nth-child(1) img { aspect-ratio: 4 / 3; }
.strip .figure:nth-child(2) img { aspect-ratio: 3 / 4; }
.strip .figure:nth-child(3) img { aspect-ratio: 1 / 1; }

/* ---------- signature: shelf elevation ---------- */
.shelf { margin-top: var(--s4); }
.shelf__svg { width: 100%; height: auto; display: block; }
.shelf__svg .board { fill: none; stroke: var(--stencil); stroke-width: 3; }
.shelf__svg .upright { fill: none; stroke: var(--stencil); stroke-width: 3; }
.shelf__svg .fill { fill: var(--barn); opacity: .22; transform-origin: left center; }
.shelf__svg .fill--b { fill: var(--sack); opacity: .26; }
.shelf__svg .lbl { font-family: var(--display); font-size: 15px; fill: var(--stencil); }
.shelf__svg .sub { font-family: var(--body); font-size: 12.5px; fill: var(--sack); }
.shelf__note { font-size: var(--step--1); color: var(--sack); margin-top: var(--s2); }

/* ---------- ruled rows, not cards ---------- */
.ruled { margin: var(--s4) 0 0; padding: 0; }
.ruled div { display: grid; gap: .2rem var(--s3); padding: var(--s3) 0; border-top: 1px dashed var(--sack); }
@media (min-width: 44rem) { .ruled div { grid-template-columns: 13rem 1fr; } }
.ruled dt { font-family: var(--display); color: var(--stencil); font-size: var(--step-0); }
.ruled dd { margin: 0; color: var(--ink); }
.ruled dd p { margin: 0; }

/* ---------- form ---------- */
.form { display: grid; gap: var(--s3); max-width: 40rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: var(--step--1); letter-spacing: .06em; color: var(--sack); }
.field input, .field select, .field textarea {
  font-family: var(--body); font-size: var(--step-0); color: var(--ink);
  background: var(--kraft-lite); border: var(--rule) solid var(--sack);
  border-radius: var(--radius); padding: .75rem .85rem; min-height: 48px; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--stencil); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--barn); box-shadow: 0 0 0 3px rgba(143,58,30,.24); outline: none;
}
.field input:invalid:not(:placeholder-shown) { border-color: var(--barn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formnote {
  border: var(--rule) solid var(--stencil); border-radius: var(--radius);
  background: var(--kraft-lite); padding: var(--s3); margin: 0;
}
.formnote[hidden] { display: none; }
.formnote strong { font-family: var(--display); font-weight: 400; display: block; margin-bottom: .35rem; }

/* ---------- map ---------- */
#map { height: 24rem; border: var(--rule) solid var(--sack); border-radius: var(--radius); background: var(--kraft-deep); }
.leaflet-container { font-family: var(--body); }
.pin {
  display: block; width: 20px; height: 20px; border-radius: 50%;
  background: var(--barn); border: var(--rule) solid var(--stencil);
  box-sizing: border-box;
}
.pin--alt { background: var(--sack); }

/* ---------- footer ---------- */
.foot {
  background: var(--stencil); color: var(--cream); padding: var(--s6) 0 var(--s5); margin-top: var(--s7);
}
.foot a { color: var(--cream); }
.foot a:hover { color: #ffd9c2; }
.foot__grid { display: grid; gap: var(--s4); }
@media (min-width: 48rem) { .foot__grid { grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s5); } }
.foot h2 { color: var(--cream); font-size: var(--step-1); margin-bottom: var(--s2); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .2rem; }
.foot li a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.foot li a:hover { text-decoration: underline; }
.foot p { color: #d6c8b2; }
.foot__fine { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px dashed var(--sack);
  font-size: var(--step--1); color: #b7a892; }
.foot__fine p { color: #b7a892; max-width: none; }

/* ---------- sticky mobile bar ---------- */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none;
  gap: 1px; background: var(--stencil); border-top: var(--rule) solid var(--stencil);
  transform: translateY(0); transition: transform 260ms var(--ease);
}
.stickybar[data-hide="true"] { transform: translateY(110%); }
.stickybar a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 56px; text-decoration: none; font-weight: 600; font-size: var(--step-0);
  background: var(--barn); color: var(--cream);
}
.stickybar a + a { background: var(--kraft-lite); color: var(--stencil); }
.stickybar svg { width: 18px; height: 18px; }
@media (max-width: 47rem) { .stickybar { display: flex; } body { padding-bottom: 56px; } }

/* ---------- motion ---------- */
/* Reveals stay visible by default so the page is complete without JS.
   Motion opts in only once JS confirms GSAP is present. */
.reveal { opacity: 1; transform: none; }
.is-animated .reveal { opacity: 0; transform: translateY(18px); }

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