:root {
  color-scheme: light;
  --ink: #211f1a;
  --muted: #706b61;
  --paper: #f1eadc;
  --paper-light: #fbf7ed;
  --paper-deep: #e4d8c5;
  --coffee: #6e3f27;
  --coffee-dark: #3c2519;
  --coffee-soft: #c79a72;
  --teal: #176f6a;
  --teal-dark: #0c5551;
  --line: rgba(33, 31, 26, 0.16);
  --shadow: 0 22px 54px rgba(60, 37, 25, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 2%, rgba(199, 154, 114, 0.24), transparent 27rem),
    linear-gradient(180deg, var(--paper-light) 0, var(--paper) 39rem, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.65;
}

button, input, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 111, 106, 0.28);
  outline-offset: 3px;
}

.topbar,
main,
.footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 720;
  text-decoration: none;
}

.brand-mark {
  width: 19px;
  height: 19px;
  border: 2px solid var(--ink);
  border-right-color: var(--teal);
  border-bottom-color: var(--coffee-soft);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.topnav { display: flex; align-items: center; gap: 22px; }

.topnav a,
.footer a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.topnav a:hover,
.footer a:hover { color: var(--teal-dark); }

.hero {
  display: grid;
  min-height: 650px;
  align-items: center;
  gap: clamp(48px, 8vw, 108px);
  padding: 72px 0 88px;
  grid-template-columns: minmax(0, 0.95fr) minmax(390px, 0.8fr);
}

.eyebrow,
.section-kicker,
.timer-label {
  margin: 0 0 13px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(3.45rem, 6.7vw, 6.6rem);
  font-weight: 540;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-intro {
  max-width: 620px;
  margin: 30px 0 28px;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions,
.timer-actions,
.footer,
.brew-visual-topline,
.timer-topline,
.section-heading,
.ratio-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-actions { justify-content: flex-start; flex-wrap: wrap; }

.button,
.text-button,
.preset-row button {
  min-height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 720;
}

.button { padding: 10px 18px; border: 1px solid transparent; }
.hero-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.button-primary { color: #fff; background: var(--teal); }
.button-primary:hover { background: var(--teal-dark); }
.button-primary:disabled { color: rgba(255, 255, 255, 0.75); background: #859c99; cursor: not-allowed; }
.button-quiet { border-color: var(--line); color: var(--ink); background: rgba(251, 247, 237, 0.64); }
.button-quiet:hover { border-color: var(--coffee-soft); color: var(--coffee-dark); }
.text-button { padding: 7px 2px; border: 0; color: var(--muted); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.copy-status { min-height: 1.7em; margin: 10px 0 0; color: var(--teal-dark); font-size: 0.88rem; }

.brew-visual {
  position: relative;
  overflow: hidden;
  min-height: 475px;
  padding: 34px;
  border: 1px solid rgba(33, 31, 26, 0.14);
  border-radius: 34px 34px 108px 34px;
  background: rgba(251, 247, 237, 0.86);
  box-shadow: var(--shadow);
}

.brew-visual::before {
  position: absolute;
  right: -70px;
  bottom: -80px;
  width: 240px;
  height: 240px;
  border: 35px solid rgba(110, 63, 39, 0.08);
  border-radius: 50%;
  content: "";
}

.brew-visual-topline span,
.brew-visual-topline strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brew-visual-topline strong { color: var(--coffee); font-size: 1rem; }

.brew-vessel {
  position: relative;
  width: 150px;
  height: 205px;
  margin: 34px auto 22px;
  overflow: hidden;
  border: 4px solid var(--coffee-dark);
  border-top-width: 9px;
  border-radius: 14px 14px 38px 38px;
  background: rgba(255, 255, 255, 0.33);
  box-shadow: inset 10px 0 rgba(255, 255, 255, 0.22);
}

.brew-vessel::after {
  position: absolute;
  top: 37px;
  right: -48px;
  width: 62px;
  height: 92px;
  border: 4px solid var(--coffee-dark);
  border-left: 0;
  border-radius: 0 28px 28px 0;
  content: "";
}

.brew-liquid { position: absolute; inset: 37px 0 0; background: linear-gradient(180deg, #75452c, #352118); }
.brew-liquid::before { position: absolute; inset: -5px 0 auto; height: 10px; border-radius: 50%; background: #986847; content: ""; }
.brew-grains { position: absolute; inset: 55px 18px auto; height: 24px; opacity: 0.45; background: radial-gradient(circle, #1e1510 0 2px, transparent 3px); background-size: 13px 11px; }

.brew-visual-metrics { position: relative; z-index: 1; display: grid; align-items: center; grid-template-columns: 1fr auto 1fr; gap: 17px; }
.brew-visual-metrics div { text-align: center; }
.brew-visual-metrics strong { display: block; font-family: Georgia, serif; font-size: 2.3rem; font-weight: 560; line-height: 1; }
.brew-visual-metrics span:not(.metric-plus) { display: block; margin-top: 8px; color: var(--muted); font-size: 0.78rem; }
.metric-plus { color: var(--coffee-soft); font-size: 1.5rem; }
.brew-time-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-top: 28px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.brew-time-line i { flex: 1; height: 1px; background: var(--line); }

.brew-station,
.steps-section,
.clarify-section,
.serve-section {
  padding: 86px 0;
  border-top: 1px solid var(--line);
}

.section-heading { align-items: end; margin-bottom: 34px; }
.section-heading h2,
.clarify-heading h2,
.serve-copy h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 560; letter-spacing: -0.045em; line-height: 1.08; }
.section-heading > p { max-width: 400px; margin: 0; color: var(--muted); text-align: right; }

.brew-layout { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(430px, 1.12fr); gap: 24px; }
.recipe-panel,
.timer-panel { padding: clamp(26px, 4vw, 42px); border: 1px solid var(--line); border-radius: 28px; background: rgba(251, 247, 237, 0.72); }
.timer-panel { color: #f8f1e7; border-color: transparent; background: var(--coffee-dark); box-shadow: var(--shadow); }

.recipe-input-block > label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; font-weight: 760; }
.number-input { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); }
.number-input input { width: 100%; padding: 6px 0 12px; border: 0; color: var(--ink); background: transparent; font-family: Georgia, serif; font-size: 3.7rem; font-weight: 560; }
.number-input input:focus-visible { outline-offset: -2px; }
.number-input span { color: var(--muted); font-weight: 700; white-space: nowrap; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.preset-row button { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); color: var(--muted); background: transparent; }
.preset-row button:hover,
.preset-row button.is-active { border-color: var(--coffee); color: #fff; background: var(--coffee); }

.recipe-result { margin: 34px 0 26px; padding: 25px; border-radius: 20px; background: var(--paper-deep); }
.recipe-result > span { color: var(--muted); font-size: 0.8rem; font-weight: 750; }
.recipe-result > p { margin: 7px 0 17px; line-height: 1; }
.recipe-result > p strong { font-family: Georgia, serif; font-size: 3.2rem; font-weight: 560; }
.recipe-result > p small { margin-left: 8px; color: var(--muted); font-size: 0.88rem; }
.ratio-rule { padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.ratio-rule b { color: var(--ink); }

.brew-notes { display: grid; gap: 14px; }
.grind-note,
.bean-note { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.grind-note p,
.bean-note p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.grind-note strong,
.bean-note strong { display: block; color: var(--ink); }
.grind-dots { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle, var(--coffee) 0 2px, transparent 3px); background-size: 9px 9px; }
.bean-note > span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(110, 63, 39, 0.22); border-radius: 50%; color: var(--coffee); background: rgba(199, 154, 114, 0.1); font-family: Georgia, "Songti SC", serif; font-weight: 700; }

.timer-label { color: #d7a982; }
.timer-topline h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 2rem; font-weight: 560; }
.phase-badge { padding: 6px 11px; border: 1px solid rgba(255,255,255,0.19); border-radius: 999px; color: #e9d8c9; font-size: 0.76rem; font-weight: 760; }
.timer-display { display: flex; min-height: 175px; flex-direction: column; justify-content: center; padding: 25px 0; }
.timer-display strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(2.8rem, 6vw, 4.8rem); font-weight: 540; letter-spacing: -0.06em; line-height: 1; }
.timer-display span { margin-top: 13px; color: #c9bbb0; font-size: 0.82rem; }
.phase-instruction { min-height: 3.5em; margin: 0 0 29px; color: #d8ccc2; }
.phase-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 30px; }
.phase-track div { padding-top: 12px; border-top: 2px solid rgba(255,255,255,0.14); color: #8f8379; }
.phase-track div.is-current { border-top-color: #d7a982; color: #fff; }
.phase-track div.is-done { border-top-color: var(--teal); color: #bcd4d1; }
.phase-track span { display: block; font-size: 0.68rem; }
.phase-track strong { font-size: 0.8rem; }
.timer-actions { justify-content: flex-start; flex-wrap: wrap; }
.timer-panel .button-quiet { border-color: rgba(255,255,255,0.17); color: #eee3da; background: transparent; }
.local-note { margin: 17px 0 0; color: #9f938a; font-size: 0.75rem; }

.step-list { display: grid; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.step-list li { border-bottom: 1px solid var(--line); }
.step-list li:nth-child(odd) { border-right: 1px solid var(--line); }
.step-list label { display: grid; min-height: 126px; padding: 24px; align-items: start; grid-template-columns: auto auto 1fr; gap: 15px; cursor: pointer; }
.step-list input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); }
.step-number { color: var(--coffee-soft); font-family: Georgia, serif; font-size: 1.12rem; }
.step-list strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.step-list small { display: block; color: var(--muted); font-size: 0.86rem; }
.step-list li:has(input:checked) { background: rgba(23,111,106,0.06); }
.step-list li:has(input:checked) strong { color: var(--teal-dark); text-decoration: line-through; text-decoration-color: rgba(23,111,106,0.35); }
.steps-section > .text-button { margin-top: 18px; }

.clarify-section { display: grid; gap: 38px; }
.clarify-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.clarify-heading > span { padding: 7px 12px; border: 1px solid rgba(110, 63, 39, 0.22); border-radius: 999px; color: var(--coffee); background: rgba(199, 154, 114, 0.1); font-size: 0.76rem; font-weight: 760; white-space: nowrap; }
.clarify-layout { display: grid; padding: clamp(26px, 4vw, 44px); border: 1px solid var(--line); border-radius: 28px; background: rgba(251, 247, 237, 0.58); grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr); gap: clamp(30px, 7vw, 90px); }
.clarify-intro { margin: 0; color: var(--muted); font-size: 1.03rem; }
.clarify-flow { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.clarify-flow li { display: grid; padding: 18px 0; border-top: 1px solid var(--line); grid-template-columns: 42px 1fr; gap: 14px; }
.clarify-flow li:first-child { padding-top: 0; border-top: 0; }
.clarify-flow li:last-child { padding-bottom: 0; }
.clarify-flow span { color: var(--coffee-soft); font-family: Georgia, serif; font-size: 1.05rem; }
.clarify-flow p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.clarify-flow strong { display: block; margin-bottom: 3px; color: var(--ink); }

.serve-section { display: grid; grid-template-columns: minmax(260px, 0.74fr) 1.26fr; gap: clamp(40px, 8vw, 100px); }
.serve-copy p:last-child { max-width: 450px; margin-top: 20px; color: var(--muted); }
.serve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.serve-grid article { min-height: 220px; padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: rgba(251,247,237,0.58); }
.serve-grid span { color: var(--coffee-soft); font-family: Georgia, serif; font-size: 1.25rem; }
.serve-grid strong { display: block; margin: 42px 0 8px; font-size: 1rem; }
.serve-grid p { margin: 0; color: var(--muted); font-size: 0.84rem; }

.copy-fallback { margin: 0 0 70px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper-light); }
.copy-fallback label { display: block; margin-bottom: 10px; font-weight: 720; }
.copy-fallback textarea { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; resize: vertical; }

.footer { min-height: 105px; border-top: 1px solid var(--line); }
.footer p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.footer div { display: flex; gap: 18px; }

@media (max-width: 900px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 64px 0 76px; }
  .brew-visual { width: min(100%, 560px); }
  .brew-layout { grid-template-columns: 1fr; }
  .clarify-layout { grid-template-columns: 1fr; }
  .serve-section { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar, main, .footer { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 70px; }
  .topnav { gap: 12px; }
  .topnav a:not(:last-child) { display: none; }
  .hero { gap: 42px; padding: 48px 0 64px; }
  h1 { font-size: clamp(3.05rem, 15vw, 4.8rem); }
  .brew-visual { min-height: 430px; padding: 26px 22px; border-radius: 26px 26px 76px 26px; }
  .brew-station, .steps-section, .clarify-section, .serve-section { padding: 64px 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .clarify-heading { align-items: start; flex-direction: column; }
  .clarify-layout { padding: 24px 20px; border-radius: 22px; }
  .recipe-panel, .timer-panel { padding: 24px 20px; border-radius: 22px; }
  .timer-display { min-height: 150px; }
  .timer-display strong { font-size: clamp(2.35rem, 14vw, 3.7rem); }
  .phase-track { overflow-x: auto; }
  .phase-track div { min-width: 58px; }
  .timer-actions .button { width: 100%; }
  .step-list { grid-template-columns: 1fr; }
  .step-list li:nth-child(odd) { border-right: 0; }
  .step-list label { min-height: 112px; padding: 21px 8px; grid-template-columns: auto auto 1fr; gap: 11px; }
  .serve-grid { grid-template-columns: 1fr; }
  .serve-grid article { min-height: 160px; }
  .serve-grid strong { margin-top: 24px; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

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