/* Fog, Salt & Pine — site styles
   Palette and type from brand-kit/brand-tokens.json and docs/BRAND_GUIDE.md */

@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --forest: #26382f;
  --sage: #879487;
  --fog: #a6aaa4;
  --sea-glass: #829891;
  --driftwood: #746354;
  --linen: #e9e3d7;
  --ivory: #f4efe4;
  --moss: #505a40;
  --charcoal: #292b29;
  --dark-sage: #4f5c4d;

  --rule: rgba(38, 56, 47, 0.28);
  --rule-light: rgba(233, 227, 215, 0.3);
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --wrap: 1120px;
  --text: 34em;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(5rem, 11vw, 9.5rem);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--linen);
  background-image: url("../img/paper-grain.png");
  background-size: 180px 180px;
  color: var(--forest);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--moss); }
:focus-visible { outline: 2px solid var(--sea-glass); outline-offset: 4px; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.12; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.measure { max-width: var(--text); margin-inline: auto; }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  padding: 0.5rem 1rem; background: var(--forest); color: var(--ivory);
}
.skip-link:focus { top: 1rem; }

/* ---------- Type helpers ---------- */
.label {
  margin: 0;
  color: var(--driftwood);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  line-height: 1.8;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
}
.display {
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.statement {
  font-size: clamp(1.45rem, 2.7vw, 2.15rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
}
.lede { font-size: clamp(1.2rem, 1.9vw, 1.35rem); line-height: 1.65; }
.rule {
  width: min(14rem, 50%);
  height: 1px;
  margin: 1.6rem auto;
  border: 0;
  background: currentColor;
  opacity: 0.45;
}
.rule--short { width: 4.5rem; }
.dot { padding-inline: 0.55em; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
}
.brand {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header--over {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  border-bottom-color: rgba(244, 239, 228, 0.28);
  color: var(--ivory);
}
.site-header--over a:hover { color: var(--ivory); }
.site-header--over .button:hover { background: var(--ivory); color: var(--forest); }
.nav { display: flex; align-items: center; gap: clamp(1.1rem, 3vw, 2.4rem); }
.nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav a { white-space: nowrap; }
.nav a[aria-current="page"] { text-decoration: underline; }
.button {
  display: inline-block;
  padding: 0.7rem 1.3rem 0.62rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: 500 0.8rem/1 var(--serif);
  letter-spacing: 0.24em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}
.button:hover { background: var(--forest); color: var(--ivory); }
.button--solid { background: var(--forest); color: var(--ivory); border-color: var(--forest); }
.button--solid:hover { background: var(--moss); border-color: var(--moss); color: var(--ivory); }

@media (max-width: 760px) {
  .site-header .wrap { flex-direction: column; gap: 0.9rem; padding-block: 1.25rem 1rem; }
  .brand { font-size: 0.98rem; }
  .nav { gap: 1.2rem; }
  .nav a { font-size: 0.74rem; letter-spacing: 0.18em; }
  .nav .button { padding: 0.55rem 0.8rem 0.5rem; }
}
@media (max-width: 520px) {
  .site-header .nav-long { display: none; }
  .nav { gap: 1rem; }
  .nav a { letter-spacing: 0.14em; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.7); }
.section--forest { background: var(--forest); color: var(--ivory); }
.section--forest .label { color: var(--ivory); }
.section--forest a:hover { color: var(--ivory); }
.section--ivory { background: var(--ivory); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); text-align: center; }
.section-head .label { margin-bottom: 1rem; }

/* ---------- Opening scene ---------- */
.scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(640px, 100svh, 980px);
  overflow: hidden;
  background: #8d918b;
  color: var(--ivory);
  isolation: isolate;
}
.scene-photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 55%;
  transform-origin: 40% 60%;
}
.js .scene-photo { animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.07) translateX(-1%); } }
.scene-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(22, 30, 26, 0.5) 0%, rgba(22, 30, 26, 0) 22%),
    radial-gradient(ellipse 60% 55% at 50% 52%, rgba(233, 227, 215, 0.16), rgba(233, 227, 215, 0) 70%),
    linear-gradient(0deg, rgba(38, 56, 47, 0.92) 0%, rgba(38, 56, 47, 0) 30%);
}
.scene-fog { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.scene-fog span {
  position: absolute;
  inset: -20% -40%;
  background:
    radial-gradient(ellipse 22% 12% at 22% 58%, rgba(236, 234, 228, 0.42), rgba(236, 234, 228, 0) 70%),
    radial-gradient(ellipse 28% 10% at 64% 46%, rgba(236, 234, 228, 0.34), rgba(236, 234, 228, 0) 70%),
    radial-gradient(ellipse 18% 9% at 86% 66%, rgba(236, 234, 228, 0.3), rgba(236, 234, 228, 0) 70%);
  filter: blur(14px);
}
.scene-fog span + span { opacity: 0.7; transform: translateX(18%) translateY(-6%) scaleY(1.3); }
.js .scene-fog span { animation: fog 46s ease-in-out infinite alternate; }
.js .scene-fog span + span { animation-duration: 64s; animation-direction: alternate-reverse; }
@keyframes fog { from { translate: -7% 0; } to { translate: 7% 1%; } }

.scene-body {
  display: grid;
  justify-items: center;
  gap: 1.6rem;
  padding: 7.5rem var(--gutter) 6.5rem;
  text-align: center;
}
.patch { margin: 0; line-height: 0; }
.patch img {
  width: clamp(290px, 40vw, 580px);
  transform: rotate(-1.2deg);
}
.js .patch img { animation: sew 1.6s cubic-bezier(.2, .7, .2, 1) 0.15s both; }
@keyframes sew {
  from { opacity: 0; transform: translateY(18px) rotate(-3deg) scale(0.97); }
  to { opacity: 1; transform: rotate(-1.2deg); }
}
.scene-label {
  margin: 0;
  color: var(--ivory);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(20, 28, 24, 0.55);
  font-variant-numeric: lining-nums;
}
.js .scene-label { animation: bloom 1.4s ease 0.9s both; }
.scene-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  width: 1px;
  height: 3.2rem;
  overflow: hidden;
  background: rgba(244, 239, 228, 0.3);
}
.scene-cue span {
  position: absolute;
  inset: 0;
  background: var(--ivory);
  transform: translateY(-100%);
}
.js .scene-cue span { animation: cue 2.6s ease-in-out 1.6s infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (max-width: 760px) {
  .scene { min-height: clamp(600px, 92svh, 820px); }
  .scene-photo { object-position: 30% 55%; }
  .scene-body { padding-top: 9rem; }
  .patch img { width: min(86vw, 420px); }
  .scene-label { font-size: 0.7rem; letter-spacing: 0.22em; }
}

/* ---------- Philosophy band ---------- */
.philosophy .label { line-height: 2.4; }
.philosophy .statement { max-width: 30em; margin: 0 auto; }

/* ---------- Elements triptych ---------- */
.elements {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
.element { text-align: center; }
.element img { width: 112px; margin: 0 auto 1.25rem; }
.element h3 { font-size: 1.6rem; letter-spacing: 0.22em; text-transform: uppercase; }
.element .rule { margin-block: 1rem 1.2rem; }
.element p { font-size: 1.06rem; }
@media (max-width: 820px) {
  .elements { grid-template-columns: 1fr; max-width: 30rem; margin-inline: auto; gap: 3.5rem; }
}

/* ---------- Brand studies ---------- */
.studies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  max-width: 1080px;
  margin-inline: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.studies figure { margin: 0; }
.studies img { width: 100%; aspect-ratio: 434 / 724; object-fit: cover; }
.studies figcaption {
  margin-top: 0.85rem;
  color: var(--driftwood);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}
.note { margin-top: 2.25rem; color: var(--driftwood); font-size: 0.95rem; font-style: italic; text-align: center; }
@media (max-width: 900px) {
  .studies {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    scrollbar-width: thin;
  }
  .studies li { scroll-snap-align: start; }
}

/* ---------- Collections ---------- */
.collections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
}
.collection {
  padding: 2.5rem 1.6rem 2rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.collection + .collection { border-left: 1px solid var(--rule); }
.collection img { width: 96px; margin: 0 auto 1.2rem; }
.collection h3 { font-size: 1.15rem; letter-spacing: 0.18em; line-height: 1.4; text-transform: uppercase; }
.collection p { margin: 0.9rem 0 0; font-size: 1.02rem; }
.status {
  margin-top: 1.1rem;
  color: var(--moss);
  font-size: 0.95rem;
  font-style: italic;
}
.center-link { margin-top: 3rem; text-align: center; }
@media (max-width: 960px) {
  .collections { grid-template-columns: repeat(2, 1fr); }
  .collection:nth-child(3) { border-left: 0; }
}
@media (max-width: 560px) {
  .collections { grid-template-columns: 1fr; }
  .collection + .collection { border-left: 0; }
}

/* ---------- Feature (image + text) ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.feature img { width: 100%; }
.feature .title { margin: 1rem 0 1.4rem; }
.feature .rule { margin-inline: 0; width: 4.5rem; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
}

/* ---------- Bleed feature ---------- */
.bleed {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: center;
  background: var(--ivory);
}
.bleed-photo { width: 100%; height: auto; }
.bleed-text { padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem); max-width: 34rem; }
.bleed-text .title { margin: 1rem 0 0; }
.bleed-text .rule { margin-inline: 0; width: 4.5rem; }
@media (max-width: 860px) {
  .bleed { grid-template-columns: 1fr; }
}

/* ---------- Signup ---------- */
.signup { text-align: center; }
.signup .title { margin: 1rem 0 0.4rem; }
.signup-form {
  display: flex;
  max-width: 32rem;
  margin: 2.2rem auto 0;
  border: 1px solid var(--forest);
}
.signup-form input {
  flex: 1;
  min-width: 0;
  padding: 0.95rem 1.1rem;
  border: 0;
  background: transparent;
  color: var(--forest);
  font: 400 1.08rem var(--serif);
}
.signup-form input::placeholder { color: var(--driftwood); opacity: 1; }
.signup-form input:focus-visible { outline-offset: -4px; }
.signup-form .button { border: 0; border-left: 1px solid var(--forest); }
.form-message { min-height: 1.6em; margin: 1rem 0 0; color: var(--moss); font-style: italic; }
@media (max-width: 480px) {
  .signup-form { flex-direction: column; }
  .signup-form .button { border-left: 0; border-top: 1px solid var(--forest); padding-block: 1rem; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: var(--ivory); padding-block: 4.5rem 2.5rem; text-align: center; }
.footer-logo { width: min(100%, 430px); margin: 0 auto 0.5rem; }
.site-footer .rule { margin-block: 1.6rem 1.8rem; }
.site-footer .nav { justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.site-footer .label { color: var(--ivory); font-size: 0.72rem; }
.site-footer small { display: block; margin-top: 1.4rem; color: var(--ivory); font-size: 0.85rem; }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 3.5rem); text-align: center; }
.page-head img.icon { width: 88px; margin: 0 auto 1.4rem; }
.page-head .display { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.page-head .lede { max-width: 30em; margin: 1.3rem auto 0; }
.plate { padding-block: 1rem clamp(3rem, 6vw, 5rem); }
.plate img { width: min(100%, 1040px); margin-inline: auto; }
.prose h2 {
  margin: 3.2rem 0 1rem;
  font-size: 1.35rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.prose h2:first-child { margin-top: 0; }

.entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: 2.6rem;
  border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry img { width: 100%; max-width: 7.5rem; }
.entry h2, .entry h3 { margin: 0.2rem 0 0.8rem; font-size: 1.45rem; letter-spacing: 0.16em; text-transform: uppercase; }
.entry p:last-child { margin-bottom: 0; }
.entry .status { margin-top: 0; }
.entry ul { margin: 0 0 1rem; padding-left: 1.1rem; }
@media (max-width: 560px) {
  .entry { grid-template-columns: 4.5rem 1fr; }
}

.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; padding: 0 0 2rem 3.4rem; }
.steps li::before {
  counter-increment: step;
  content: counter(step, upper-roman) ".";
  position: absolute;
  left: 0;
  top: 0.1rem;
  color: var(--driftwood);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.steps h3 { margin-bottom: 0.4rem; font-size: 1.2rem; letter-spacing: 0.16em; text-transform: uppercase; }

.materials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.15rem;
}
.materials li + li::before { content: "·"; padding-inline: 0.8rem; color: var(--driftwood); }

.signoff { text-align: center; padding-bottom: 0; }
.signoff img { width: min(78vw, 380px); margin: 0 auto; transform: rotate(-1.2deg); }

.not-found { min-height: 60vh; display: grid; place-content: center; text-align: center; padding-block: 5rem; }
.not-found img { width: 110px; margin: 0 auto 1.6rem; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@keyframes bloom { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .scene-photo, .js .scene-fog span, .js .patch img, .js .scene-label, .js .scene-cue span { animation: none; }
  .js .patch img { transform: rotate(-1.2deg); }
}
