:root {
  --paper: #F3E6CF;
  --paper-2: #EADAB9;
  --ink: #2B1D27;
  --ink-soft: #5B4653;
  --marigold: #E9A61A;
  --pine: #1E4B3F;
  --line: rgba(43, 29, 39, 0.24);
  --focus: #1E4B3F;
  --on-accent: #2B1D27;
  --band: #1E4B3F;
  --on-band: #F3E6CF;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1F1720;
    --paper-2: #2A1F2B;
    --ink: #F1E4CC;
    --ink-soft: #C9B8A2;
    --marigold: #F0B429;
    --pine: #7CC2A9;
    --line: rgba(241, 228, 204, 0.24);
    --focus: #F0B429;
    --band: #17382F;
  }
}
:root[data-theme="dark"] {
  --paper: #1F1720;
  --paper-2: #2A1F2B;
  --ink: #F1E4CC;
  --ink-soft: #C9B8A2;
  --marigold: #F0B429;
  --pine: #7CC2A9;
  --line: rgba(241, 228, 204, 0.24);
  --focus: #F0B429;
  --band: #17382F;
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 72px); scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; font-family: var(--serif); font-size: 1.75rem; font-weight: 600; line-height: 1.2; text-decoration: none; color: var(--ink); background: transparent; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.btn {
  display: inline-block; background: var(--marigold); color: var(--on-accent);
  font-weight: 700; font-family: var(--sans); font-size: 1rem;
  padding: 0.8rem 1.4rem; border-radius: 999px; border: 2px solid var(--marigold);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.quiet:hover { background: var(--ink); color: var(--paper); }
.nav .btn { padding: 0.6rem 1.15rem; }

/* Language switch */
.lang { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang button {
  font: inherit; font-weight: 700; font-size: 0.88rem; letter-spacing: 0.04em;
  background: transparent; color: var(--ink); border: 0; padding: 0.4rem 0.8rem; cursor: pointer; min-width: 2.6rem;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang button:focus-visible { outline-offset: -3px; }



/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 0; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3rem; align-items: end; }
.hero h1 { font-size: clamp(3.2rem, 9vw, 7rem); font-weight: 450; line-height: 0.98; letter-spacing: -0.03em; }
.hero .lede { margin-top: 1.75rem; font-size: 1.25rem; max-width: 34rem; color: var(--ink-soft); }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.print { justify-self: center; width: min(100%, 360px); padding-bottom: 1.5rem; }
.print svg { width: 100%; height: auto; display: block; overflow: visible; }
.print figcaption { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.6rem; }
.link-btn { background: none; border: 0; padding: 0.25rem 0; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.vase-layer { fill: var(--marigold); stroke: var(--paper); stroke-width: 0.7; transform-box: fill-box; transform-origin: center; animation: lay 0.32s ease-out both; animation-delay: calc(var(--i) * 60ms); }
.vase-layer.alt { fill-opacity: 0.9; }
.plate { fill: var(--ink); }
.nozzle { fill: var(--pine); animation: rise 2.82s steps(47, end) forwards, unplug 0.5s 3.2s forwards; transform: translateY(-6px); }
.nozzle-tip { fill: var(--ink); }
@keyframes lay { from { opacity: 0; transform: scaleX(0.55); } to { opacity: 1; transform: none; } }
@keyframes rise { from { transform: translateY(-6px); } to { transform: translateY(-288px); } }
@keyframes unplug { to { opacity: 0; } }
.strata { height: 34px; background: repeating-linear-gradient(180deg, var(--marigold) 0 3px, transparent 3px 8px); opacity: 0.85; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .print { width: min(100%, 300px); }
}

/* Sections */
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 3rem; margin-bottom: 3rem; align-items: end; }
.section-head h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.section-head p { color: var(--ink-soft); max-width: 36rem; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; gap: 1rem; } }

/* What we print */
.work-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.work-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.6fr); gap: 2rem; padding: 1.75rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.work-row h3 { font-size: 1.9rem; }
.work-row .time { text-align: right; font-weight: 700; }
.work-row .time small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; }
@media (max-width: 860px) {
  .work-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .work-row .time { text-align: left; }
}

/* Materials */
.materials { background: var(--paper-2); }
.material-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 2.5rem 2rem; }
.material h3 { font-size: 1.6rem; margin: 1.1rem 0 0.4rem; }
.material p { color: var(--ink-soft); font-size: 1rem; }
.spool {
  --c: var(--marigold);
  width: 84px; height: 84px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--paper-2) 0 15%, var(--ink) 15% 18%, transparent 18.5%),
    repeating-radial-gradient(circle, var(--c) 0 3px, color-mix(in srgb, var(--c) 75%, #000) 3px 4px);
  box-shadow: 0 0 0 2px var(--ink);
}

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-size: 3.4rem; line-height: 1; font-weight: 400; margin-bottom: 0.8rem; }
.steps h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.steps p { color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Approach band */
.approach { background: var(--band); color: var(--on-band); }
.approach p { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.9rem); line-height: 1.22; font-weight: 400; max-width: 46rem; letter-spacing: -0.01em; }
.approach small { display: block; margin-top: 1.75rem; font-size: 1rem; opacity: 0.85; font-family: var(--sans); }

/* FAQ */
.faq { max-width: 46rem; }
.faq details { border-top: 1px solid var(--line); padding: 1.15rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--serif); font-size: 1.35rem; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq .faq-icon::after { content: "+"; font-family: var(--sans); font-weight: 400; font-size: 1.6rem; line-height: 1; }
.faq details[open] .faq-icon::after { content: "\2212"; }
.faq details p { margin-top: 0.8rem; color: var(--ink-soft); }

/* Quote */
.quote { background: var(--paper-2); }
.quote .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4rem; align-items: start; }
.quote h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.quote .intro p { margin-top: 1.25rem; color: var(--ink-soft); max-width: 28rem; }
.quote .intro ul { margin: 1.25rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); }
form { display: grid; gap: 1.4rem; }
label { display: grid; gap: 0.35rem; font-weight: 700; font-size: 0.98rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px;
  padding: 0.75rem 0.85rem; width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; }
.form-note { font-size: 0.95rem; color: var(--ink-soft); min-height: 1.5em; }
@media (max-width: 860px) { .quote .wrap { grid-template-columns: 1fr; gap: 2.5rem; } }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* Footer */
footer .strata { height: 30px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding: 2rem 0 2.5rem; }
footer p { color: var(--ink-soft); font-size: 0.98rem; }
footer .wordmark { display: inline-block; margin-bottom: 0.4rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vase-layer { animation: none; }
  .nozzle { animation: none; opacity: 0; }
}

/* Branding and navigation remain usable without JavaScript. */
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 20; padding: 0.75rem; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.nav { flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; }
.nav a, .lang button { min-height: 44px; display: inline-flex; align-items: center; }
html { scroll-padding-top: 130px; }
fieldset { min-width: 0; margin: 0; border: 0; padding: 0; display: grid; gap: 1.4rem; }
legend { margin-bottom: 1rem; font-weight: 700; }
:disabled { cursor: not-allowed; }
.btn:disabled { background: var(--paper); color: var(--ink-soft); border-color: var(--line); }
footer .brand { margin-bottom: 0.75rem; }
@media (max-width: 1100px) {
  .site-header { position: static; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding-block: 0.75rem; }
  .nav { justify-content: flex-start; gap: 0.25rem 1rem; }
  html { scroll-padding-top: 1rem; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 2rem); }
  .hero h1 { font-size: 2.8rem; }
  .print figcaption { flex-wrap: wrap; }
}

/* Accessible controls and reflow (#73, #74). */
body { overflow-wrap: anywhere; }
.brand, .link-btn, footer a, .faq summary { min-height: 44px; }
.brand, footer a { align-items: center; }
footer a { display: inline-flex; }
.faq summary { align-items: center; }
.faq .faq-icon { flex: 0 0 auto; }
.lang button { min-width: 44px; justify-content: center; }
.lang button[aria-pressed="true"]:focus-visible { outline-color: var(--paper); }
input, select, textarea { min-width: 0; font-size: 1rem; }
.hero .wrap { padding-bottom: 2rem; }
.print figcaption { flex-wrap: wrap; }
.print figcaption > span { flex: 1 1 10rem; }
.print .link-btn { flex: 0 1 auto; }
@media (max-width: 520px) {
  .hero .wrap { gap: 1.5rem; }
  .hero .lede { font-size: 1.125rem; }
  .print { width: min(100%, 240px); padding-bottom: 0; }
  section { padding-block: 3rem; }
  .section-head { margin-bottom: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  #replay { display: none; }
}
@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
  .lang button[aria-pressed="true"] { outline: 2px solid ButtonText; outline-offset: -4px; }
  .lang button[aria-pressed="true"]:focus-visible { outline: 3px solid Highlight; outline-offset: -3px; }
  .vase-layer, .plate { fill: CanvasText; }
}

/* Errors are identified by text and aria-invalid as well as their border. */
.field-error { display: block; margin-top: .4rem; font-size: .9rem; font-weight: 600; }
.field-error[hidden] { display: none; }
[aria-invalid="true"] { border-width: 2px; border-style: dashed; }
#quote-form[aria-busy="true"] button { cursor: progress; }
