/* RoastDrive — The Roast Atlas */
@import url('https://fonts.googleapis.com/css2?family=Epilogue:ital,wght@0,400;0,500;0,700;1,400&family=Fira+Mono:wght@400;500&family=Literata:ital,opsz,wght@0,7..72,600;0,7..72,700;1,7..72,600&display=swap');

:root {
  --chalk: #F1F2EF;
  --fog: #E4E6E2;
  --charcoal: #17191A;
  --olive: #6E7A3B;
  --olive-dark: #5A652F;
  --slate: #7A7E76;
  --link-on-light: #6E7A3B;
  --max-w: 72rem;
  --header-h: 4.5rem;
  --radius: 2px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 100%; }

body {
  font-family: 'Epilogue', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--chalk);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-h);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link-on-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--charcoal); }

h1, h2 {
  font-family: 'Literata', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3, h4, h5, h6 {
  font-family: 'Epilogue', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: clamp(2.75rem, 5.5vw, 5.125rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.mono, .hero-eyebrow, figcaption.mono {
  font-family: 'Fira Mono', monospace;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
}

.lead { font-size: 1.125rem; color: rgba(23, 25, 26, 0.82); max-width: 36rem; }

/* Surface pairs */
.surface-chalk { background: var(--chalk); color: var(--charcoal); }
.surface-charcoal { background: var(--charcoal); color: var(--chalk); }
.surface-fog { background: var(--fog); color: var(--charcoal); }
.surface-olive { background: var(--olive); color: var(--chalk); }

.surface-charcoal a { color: var(--chalk); }
.surface-charcoal a:hover { color: var(--olive); }
.surface-olive a { color: var(--chalk); }

.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

/* Atlas grid wash on light surfaces */
.surface-chalk::before,
.surface-fog::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.04;
  background-image:
    linear-gradient(var(--charcoal) 1px, transparent 1px),
    linear-gradient(90deg, var(--charcoal) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--chalk);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-header.is-sticky {
  background: var(--charcoal);
  border-bottom-color: rgba(241, 242, 239, 0.08);
  box-shadow: 0 4px 24px rgba(23, 25, 26, 0.25);
}

.site-header.is-sticky .logo-text,
.site-header.is-sticky .nav-link { color: var(--chalk); }

.site-header.is-sticky .nav-link:hover,
.site-header.is-sticky .nav-link.is-active { color: var(--olive); }

.site-header.is-sticky .nav-link.is-active::after,
.site-header.is-sticky .nav-link:hover::after { background: var(--olive); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.logo-mark { width: 2rem; height: 2rem; }

.logo-text {
  font-family: 'Literata', serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--charcoal);
  transition: color var(--transition);
}

.nav-centre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  flex-wrap: wrap;
}

.nav-link {
  font-family: 'Epilogue', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--charcoal);
  padding: 0.25rem 0;
  position: relative;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--olive);
  transition: width var(--transition), left var(--transition);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
  left: 0;
}

.nav-link.is-active { color: var(--olive); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: inherit;
}

.nav-toggle span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: var(--transition);
}

.site-header.is-sticky .nav-toggle { color: var(--chalk); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-centre {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--charcoal);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .nav-centre.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-centre .nav-link { color: var(--chalk); }
}

/* Hero — The Roast Road */
.hero-roast-road {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vh, 6rem) 0 clamp(2rem, 5vh, 4rem);
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--charcoal);
  position: relative;
}

.hero-topline::before,
.hero-topline::after {
  content: '';
  position: absolute;
  bottom: -3px;
  width: 6px;
  height: 6px;
  background: var(--olive);
}

.hero-topline::before { left: 0; }
.hero-topline::after { right: 0; }

.hero-brand {
  font-family: 'Fira Mono', monospace;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.hero-tagline {
  font-family: 'Fira Mono', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--slate);
  text-align: right;
}

.hero-slogan { max-width: 48rem; margin-bottom: 1.5rem; }
.hero-slogan .accent { color: var(--olive); }

.hero-standfirst {
  max-width: 35rem;
  color: rgba(23, 25, 26, 0.8);
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.trust-strip {
  font-family: 'Fira Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--slate);
  margin-bottom: 2.5rem;
}

/* Photo plate */
.photo-plate {
  position: relative;
  border: 1px solid var(--charcoal);
  padding: 0.5rem;
  background: var(--chalk);
  box-shadow: 0 12px 40px rgba(23, 25, 26, 0.08);
  transition: box-shadow var(--transition), transform var(--transition);
}

.photo-plate::before,
.photo-plate::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--olive);
}

.photo-plate::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.photo-plate::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.photo-plate img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero-roast-road .photo-plate {
  max-width: 38rem;
  margin-top: 2.5rem;
}

.photo-plate--section {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.photo-plate--compact img {
  max-height: 220px;
}

.grid-2 .photo-plate img,
.atlas-moment .photo-plate img {
  max-height: 280px;
}

.photo-plate figcaption {
  padding: 0.75rem 0.25rem 0.25rem;
}

.js .photo-plate.is-bloomed {
  box-shadow: 0 20px 56px rgba(23, 25, 26, 0.12);
  transform: translateY(-12px);
}

/* Roast curve arc */
.roast-curve-section { padding: clamp(4rem, 10vw, 6rem) 0; }

.roast-curve-inner {
  position: relative;
  max-width: 40rem;
  margin: 2rem auto 0;
  padding-top: 3rem;
}

.roast-curve-svg {
  width: 100%;
  height: auto;
  display: block;
}

.roast-curve-path {
  fill: none;
  stroke: var(--olive);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}

.js .roast-curve-path.is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s ease; }

.roast-baseline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--charcoal);
}

.roast-nodes {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 0.5rem;
}

.roast-node {
  text-align: center;
  flex: 1;
}

.roast-node-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
  margin: 0 auto 0.5rem;
  opacity: 0.35;
  transition: opacity var(--transition), transform var(--transition);
}

.js .roast-node.is-lit .roast-node-dot {
  opacity: 1;
  transform: scale(1.25);
}

.roast-node-label {
  font-family: 'Fira Mono', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Sections */
.section { padding: clamp(4rem, 10vw, 7rem) 0; }

.section-header { margin-bottom: 2.5rem; max-width: 40rem; }
.section-header.center { text-align: center; margin-inline: auto; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.prose p + p { margin-top: 1.25rem; }

/* Metric trio */
.metric-trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1.5rem;
  text-align: center;
  padding: 2rem 0;
}

.metric-value {
  font-family: 'Fira Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--olive);
  display: block;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--slate);
}

/* Stage cards */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
}

.stage-card {
  padding: 1.75rem;
  border: 1px solid rgba(23, 25, 26, 0.12);
  background: var(--chalk);
}

.stage-card .mono { margin-bottom: 0.75rem; display: block; }

/* Offerings rail */
.offerings-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--olive);
  border: 1px solid var(--olive);
}

.offering-card {
  background: var(--chalk);
  padding: 1.75rem;
}

.offering-card .serial {
  font-family: 'Fira Mono', monospace;
  font-size: 0.75rem;
  color: var(--olive);
  margin-bottom: 0.5rem;
  display: block;
}

/* Cards */
.card {
  padding: 1.75rem;
  border: 1px solid rgba(23, 25, 26, 0.1);
  background: var(--chalk);
}

.card h3 { margin-bottom: 0.75rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Epilogue', sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--olive);
  color: var(--chalk);
  border-color: var(--olive);
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: var(--chalk);
  box-shadow: 0 4px 16px rgba(110, 122, 59, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--charcoal);
}

.btn-secondary:hover {
  box-shadow: 0 4px 16px rgba(23, 25, 26, 0.1);
  color: var(--charcoal);
}

.surface-charcoal .btn-secondary {
  color: var(--chalk);
  border-color: var(--chalk);
}

.surface-charcoal .btn-secondary:hover { color: var(--chalk); }

/* Page hero */
.page-hero {
  padding: clamp(3rem, 8vw, 5rem) 0 2rem;
}

.page-hero h1 { margin: 0.75rem 0 1rem; }

/* Offering articles */
.offering {
  padding: 2rem 0;
  border-bottom: 1px solid rgba(23, 25, 26, 0.1);
}

.offering:last-child { border-bottom: none; }

.offering h3 { margin-bottom: 1rem; color: var(--olive-dark); }

/* Atlas moments */
.atlas-moment {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(23, 25, 26, 0.08);
}

@media (min-width: 768px) {
  .atlas-moment { grid-template-columns: 1fr 1fr; }
  .atlas-moment.reverse .photo-plate { order: 2; }
}

.tag {
  font-family: 'Fira Mono', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.disclaimer-box {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--olive);
  background: var(--fog);
  margin: 2rem 0;
  font-size: 0.9375rem;
}

/* FAQ */
.faq-list { max-width: 48rem; }

.faq-item {
  border-bottom: 1px solid rgba(23, 25, 26, 0.12);
  padding: 1.5rem 0;
}

.faq-item h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Contact */
.contact-block dt {
  font-family: 'Fira Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  margin-top: 1.25rem;
}

.contact-block dt:first-child { margin-top: 0; }

.contact-block dd { margin-top: 0.25rem; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(23, 25, 26, 0.2);
  border-radius: var(--radius);
  font-family: 'Epilogue', sans-serif;
  font-size: 1rem;
  background: var(--chalk);
  color: var(--charcoal);
}

.form-group textarea { min-height: 8rem; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

.form-check {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.form-check input {
  margin-top: 0.25rem;
  flex-shrink: 0;
  width: auto;
}

.form-check label {
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-success {
  padding: 1rem 1.25rem;
  background: var(--fog);
  border-left: 3px solid var(--olive);
  margin-bottom: 1.5rem;
}

.form-error {
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border-left: 3px solid #b91c1c;
  margin-bottom: 1.5rem;
  color: #7f1d1d;
}

/* Legal prose */
.legal-prose h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 1rem;
}

.legal-prose h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.75rem;
}

.legal-prose p,
.legal-prose li { margin-bottom: 0.75rem; }

.legal-prose ul { padding-left: 1.5rem; }

/* Footer */
.site-footer {
  padding: 3.5rem 0 2rem;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-family: 'Fira Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--olive);
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a { color: rgba(241, 242, 239, 0.85); }
.footer-col a:hover { color: var(--chalk); }

.footer-disclaimer {
  font-size: 0.8125rem;
  opacity: 0.75;
  margin-top: 1rem;
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(241, 242, 239, 0.12);
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: var(--charcoal);
  color: var(--chalk);
  padding: 1.25rem 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform var(--transition);
}

.cookie-banner.is-visible { transform: translateY(0); }

.cookie-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-inner p {
  flex: 1;
  min-width: 16rem;
  font-size: 0.875rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-cookie {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(241, 242, 239, 0.3);
  background: transparent;
  color: var(--chalk);
  cursor: pointer;
  font-family: 'Epilogue', sans-serif;
}

.btn-cookie-accept {
  background: var(--olive);
  border-color: var(--olive);
}

.btn-cookie:hover { filter: brightness(1.1); }

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(23, 25, 26, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal.is-open { display: flex; }

.cookie-modal-panel {
  background: var(--chalk);
  color: var(--charcoal);
  max-width: 28rem;
  width: 100%;
  padding: 2rem;
  border-radius: var(--radius);
}

.cookie-modal-panel h3 { margin-bottom: 1rem; }

.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(23, 25, 26, 0.1);
}

.cookie-option label { font-size: 0.9375rem; }

.cookie-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Reveal animation — JS only, with safety timeout */
.js .reveal {
  transform: translateY(16px);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.js .reveal.is-visible {
  transform: translateY(0);
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.error-page h1 { margin-bottom: 1rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .roast-curve-path { stroke-dashoffset: 0 !important; }
  .roast-node-dot { opacity: 1 !important; }
  .js .reveal { transform: none !important; }
  .photo-plate { transform: none !important; }
}
