/* MERCHAN NeuroStudio, hand-written stylesheet. See STYLE.md for the rules. */

/* ---------- Fonts, self-hosted ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f1e7;
  --ink: #23201c;
  --terracotta: #c3603f;
  --terracotta-deep: #a84e30;
  --terracotta-deeper: #96452a;
  --olive: #6c6f4e;
  --sand: #e5d8bf;
  --sand-soft: #efe6d2;
  --display: "Fraunces", Georgia, serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --wide: 72rem;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.13rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta-deep); text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }
h1, h2, h3 { font-family: var(--display); font-weight: 480; line-height: 1.12; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--terracotta-deep);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.25s ease;
}
.btn:hover { background: var(--terracotta-deeper); color: var(--bg); }
.btn-small { padding: 0.55em 1.2em; font-size: 0.92rem; }
.cta-short { display: none; }
@media (max-width: 620px) {
  .brand { font-size: 1.05rem; }
  .site-header { gap: 1rem; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
.btn-light { background: var(--bg); color: var(--ink); }
.btn-light:hover { background: var(--sand); color: var(--ink); }
.cta-group { margin-top: 2rem; }
.cta-group.center { text-align: center; margin-top: 3.5rem; }
.reassure { margin-top: 0.7rem; font-size: 0.92rem; color: var(--olive); }
.contact .reassure { color: var(--sand); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  background: rgba(246, 241, 231, 0.93);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--sand);
}
.brand {
  font-family: var(--display);
  font-weight: 620;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.brand span { font-weight: 380; font-style: italic; }
.site-nav { display: flex; gap: 1.3rem; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--terracotta-deep); }
.site-nav small { color: var(--olive); font-size: 0.75em; margin-right: 0.15em; }
@media (max-width: 860px) {
  .site-nav { display: none; }
}

/* ---------- Layout primitives ---------- */
.section { max-width: var(--wide); margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) clamp(1rem, 4vw, 3rem); }
.section-tint { max-width: none; background: var(--sand-soft); }
.section-tint > * { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.section-head { display: flex; align-items: baseline; gap: 1.2rem; margin-bottom: 1.6rem; }
.numeral {
  font-family: var(--display);
  font-weight: 320;
  font-size: clamp(3.2rem, 2.5rem + 4vw, 6rem);
  line-height: 0.9;
  color: var(--terracotta);
  opacity: 0.35;
}
.section-intro { max-width: var(--measure); color: var(--ink); margin-bottom: 2.5rem; }
.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 1.1rem;
}

/* ---------- Arch mask, the signature ---------- */
.arch picture, .arch img { border-radius: 999px 999px 0 0; }
.arch figcaption { font-size: 0.88rem; color: var(--olive); margin-top: 0.8rem; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero h1 { font-size: clamp(2rem, 1.4rem + 3.2vw, 3.7rem); font-weight: 420; }
.hero .lede { max-width: var(--measure); margin-top: 1.4rem; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); }
.hero-figure { margin: 0; }
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { order: -1; max-width: min(26rem, 100%); }
}

/* ---------- Manifesto ---------- */
.manifesto {
  background: var(--ink);
  color: var(--sand);
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1rem, 4vw, 3rem);
}
.manifesto p {
  max-width: 46rem;
  margin: 0 auto 1.6rem;
  font-family: var(--display);
  font-weight: 350;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.5;
}
.manifesto p:last-child { margin-bottom: 0; }
.manifesto-close { color: var(--terracotta); font-style: italic; }

/* ---------- Studio split ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.portrait-figure { max-width: min(24rem, 100%); }
.split-text p { max-width: var(--measure); margin-bottom: 1.2rem; }
.pull-quote { border-left: 3px solid var(--terracotta); padding-left: 1.3rem; margin: 2rem 0; }
.pull-quote p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.55rem);
  line-height: 1.4;
}
.credentials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 2rem; margin-top: 2.2rem; }
.credentials dt { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--olive); }
.credentials dd { margin: 0.15rem 0 0; }
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .credentials { grid-template-columns: 1fr; gap: 1rem; }
}

/* ---------- Services cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1.2rem; }
.card {
  background: var(--bg);
  border: 1px solid var(--sand);
  border-radius: 4px 4px 2.5rem 4px;
  padding: 1.8rem 1.6rem 2rem;
}
.card h3 { margin-bottom: 0.7rem; color: var(--terracotta-deep); }
.card p { font-size: 0.99rem; }

/* ---------- Method ---------- */
.method-list { list-style: none; max-width: 52rem; }
.method-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(1.2rem, 3vw, 2.5rem);
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--sand);
}
.method-list li:last-child { border-bottom: none; }
.step-num {
  grid-row: span 2;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 2rem + 3vw, 4.5rem);
  line-height: 1;
  color: var(--terracotta);
  opacity: 0.45;
  min-width: 2ch;
}
.method-list h3 { margin-bottom: 0.4rem; }
.method-list p { max-width: var(--measure); }

/* ---------- Projects gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.5rem); align-items: start; }
.gallery-item { margin: 0; }
.gallery-item:nth-child(even) { margin-top: clamp(1rem, 4vw, 3.5rem); }
.gallery-item img { border-radius: 4px; width: 100%; }
.gallery-item.arch img { border-radius: 999px 999px 0 0; }
.gallery-item figcaption { font-size: 0.92rem; color: var(--olive); margin-top: 0.8rem; max-width: 30rem; }
.gallery-note { font-size: 0.88rem; color: var(--olive); margin-top: 2rem; }
@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-item:nth-child(even) { margin-top: 0; }
}
.case-study {
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--bg);
  border: 1px solid var(--sand);
  border-radius: 4px;
  padding: clamp(1.8rem, 4vw, 3rem);
  max-width: 46rem;
}
.case-study h3 { color: var(--terracotta-deep); margin-bottom: 1rem; }
.case-study p { margin-bottom: 1rem; }
.case-study p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 46rem; }
.faq-list details { border-bottom: 1px solid var(--sand); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.3rem 0;
  font-family: var(--display);
  font-weight: 460;
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.5em;
  line-height: 1;
  color: var(--terracotta);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 0 1.5rem; max-width: var(--measure); }
.faq-list summary:hover { color: var(--terracotta-deep); }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--bg); }
.contact-inner { max-width: var(--wide); margin: 0 auto; padding: clamp(4.5rem, 10vw, 8rem) clamp(1rem, 4vw, 3rem); }
.contact h2 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.2rem); margin-bottom: 1.2rem; }
.contact p { max-width: var(--measure); }
.contact a { color: var(--sand); }
.contact a:hover { color: #fff; }
.contact .btn-light { color: var(--ink); }
.contact .btn-light:hover { color: var(--ink); }
.contact-alt { margin-top: 2.5rem; }
.contact-meta { margin-top: 1rem; font-size: 0.92rem; color: var(--sand); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--sand);
  color: var(--olive);
  font-size: 0.95rem;
}
.site-footer p { margin-bottom: 0.3rem; }

/* ---------- Reveals, progressive enhancement only ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  html.js .reveal.in { opacity: 1; transform: none; }
}
