/* SERUBAK Coffee Co. holding page
   Brand colours and type follow the SERUBAK brand book v1.0 (November 2026). */

:root {
  --ivory: #F3EBDD;
  --green: #173D32;
  --brown: #4A2E24;
  --copper: #B87345;

  --ivory-soft: rgba(243, 235, 221, 0.72);
  --ivory-faint: rgba(243, 235, 221, 0.38);
  --copper-rule: rgba(184, 115, 69, 0.45);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--brown);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--green);
}

p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ivory);
  color: var(--green);
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Buttons */

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

.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ivory);
  border-radius: 2px;
  font: 600 0.95rem/1.2 var(--sans);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.btn-solid { background: var(--ivory); color: var(--green); }
.btn-solid:hover { background: transparent; color: var(--ivory); }

.btn-line { background: transparent; color: var(--ivory); }
.btn-line:hover { background: var(--ivory); color: var(--green); }

/* Hero */

.hero {
  overflow: hidden;
  background: var(--green);
  color: var(--ivory);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.25rem, 3vw, 2rem);
}

.brand img { width: clamp(6.5rem, 12vw, 8.5rem); }

.topbar-mail {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ivory-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--copper);
  padding-bottom: 2px;
}
.topbar-mail:hover { color: var(--ivory); }

.hero-body {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.hero h1 {
  max-width: 9.5em;
  color: var(--ivory);
  font-size: clamp(3.25rem, 8vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lede {
  max-width: 34em;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ivory-soft);
}

.hero .actions { margin-top: 2rem; }

/* Roast curve: the website's progress, shown as a coffee roast */

.roast {
  margin-block: clamp(2.5rem, 5vw, 3.5rem) 0;
}

.roast figcaption {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ivory);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ivory-faint);
}

.curve-box {
  position: relative;
  margin-top: 4rem;
}

.roast-curve {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The 3D bean is drawn on this canvas, which overhangs the chart so the bean can rise above it.
   The overhang must match PAD_X, PAD_TOP and PAD_BOTTOM in js/roast.js. */
.roast-canvas {
  position: absolute;
  z-index: 1;
  left: -50px;
  top: -110px;
  width: calc(100% + 100px);
  height: calc(100% + 140px);
  pointer-events: none;
}

.curve-done,
.curve-todo {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* No non-scaling stroke here: it breaks pathLength, which the draw animation relies on. */
.curve-done {
  stroke: var(--copper);
  stroke-width: 3;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.curve-todo {
  vector-effect: non-scaling-stroke;
  stroke: var(--ivory-faint);
  stroke-width: 2;
  stroke-dasharray: 2 7;
}

.dot { vector-effect: non-scaling-stroke; }
.dot-past { fill: var(--copper); }
.dot-now { fill: var(--copper); stroke: var(--ivory); stroke-width: 2; }
.dot-halo { fill: none; stroke: var(--copper); stroke-width: 1.5; opacity: 0.55; vector-effect: non-scaling-stroke; }
.dot-next { fill: var(--green); stroke: var(--ivory-faint); stroke-width: 2; }

.stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--ivory-faint);
}

.stages li { padding-inline: 0.25rem; }
.stages .done { color: var(--ivory-soft); }
.stages .now { color: var(--ivory); font-weight: 600; }
.stages .now span {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
  color: var(--ivory-soft);
}

/* One orchestrated moment on load: the roast line draws to first crack. */
@media (prefers-reduced-motion: no-preference) {
  .curve-done { animation: roast 2s cubic-bezier(0.35, 0, 0.2, 1) 0.3s both; }
  .dot-past.d1 { animation: appear 0.3s ease-out 0.6s both; }
  .dot-past.d2 { animation: appear 0.3s ease-out 1.25s both; }
  .dot-now { animation: appear 0.35s ease-out 2.15s both; }
  .dot-halo { animation: halo 0.9s ease-out 2.25s both; }
  .stages .now { animation: fade 0.5s ease-out 2.2s both; }
}

/* While the 3D bean drives the line, the script reveals each part as the bean reaches it. */
.bean-pending .curve-done { animation: none; stroke-dashoffset: 1; }
.bean-pending .dot-past,
.bean-pending .dot-now,
.bean-pending .dot-halo,
.bean-pending .stages .now {
  animation: none;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.bean-pending .dot-past.reached,
.bean-pending .arrived .dot-now,
.bean-pending .arrived .stages .now { opacity: 1; }
.bean-pending .arrived .dot-halo { opacity: 0.55; }

@keyframes roast { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes halo { from { opacity: 0; } to { opacity: 0.55; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Range */

.range {
  padding-block: clamp(4rem, 10vw, 7.5rem);
}

.range-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.range-intro h2 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
}

.range-intro p {
  margin-top: 1.25rem;
  max-width: 24em;
}

.range-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--copper-rule);
}

.range-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 1rem 2.5rem;
  align-items: baseline;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--copper-rule);
}

.range-list h3 {
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
}

.range-list p { max-width: 34em; }

/* Festive: the bean pattern as gift wrap, tied with a copper ribbon */

.festive {
  position: relative;
  overflow: hidden;
  background-color: var(--green);
  background-image: url("../img/pattern.png");
  background-size: 160px 160px;
  color: var(--ivory);
  padding-block: clamp(4.5rem, 11vw, 8rem);
}

.ribbon {
  position: absolute;
  pointer-events: none;
}

/* Each ribbon is two thin copper lines with a gap of green between them */
.ribbon-v {
  top: 0;
  bottom: 0;
  left: 74%;
  width: 14px;
  border-inline: 2px solid var(--copper);
  background: var(--green);
}

.ribbon-h {
  left: 0;
  right: 0;
  top: 58%;
  height: 14px;
  border-block: 2px solid var(--copper);
  background: var(--green);
}

.festive .wrap { position: relative; }

.festive-panel {
  max-width: 35rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--green);
  border: 1px solid var(--copper-rule);
}

.festive h2 {
  color: var(--ivory);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  line-height: 1.05;
}

.festive-panel > p {
  margin-top: 1.1rem;
  color: var(--ivory-soft);
}

.festive .actions { margin-top: 1.75rem; }

.call {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.call a {
  color: var(--ivory);
  font-weight: 600;
  text-decoration-color: var(--copper);
  text-underline-offset: 3px;
}

/* Footer */

.footer {
  padding-block: clamp(3rem, 7vw, 4.5rem) 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem 3rem;
}

.footer-logo { width: 7.5rem; }

.footer-line {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 500;
  color: var(--green);
}

.footer address {
  font-style: normal;
  text-align: right;
}

.footer address a {
  color: var(--green);
  font-weight: 500;
  text-decoration-color: var(--copper);
  text-underline-offset: 3px;
}

.footer-base {
  margin-top: 2.5rem;
}

.footer-base p {
  padding-top: 1.25rem;
  border-top: 1px solid var(--copper-rule);
  font-size: 0.85rem;
}

/* Small screens */

@media (max-width: 860px) {
  .range-grid { grid-template-columns: 1fr; }
  .range-list li { grid-template-columns: 1fr; gap: 0.5rem; }
  .ribbon-v { left: auto; right: 9%; }
}

@media (max-width: 640px) {
  .stages { font-size: 0.75rem; }
  .curve-done { stroke-width: 7; }
  /* The chart shrinks on phones, so enlarge the stage markers to stay visible. */
  .dot-past { r: 13px; }
  .dot-next { r: 12px; }
  .dot-now { r: 19px; }
  .dot-halo { r: 34px; }
  .stages li { padding-inline: 0.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer address { text-align: left; }
  .ribbon-h { top: auto; bottom: 18%; }
}

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