/* Layout concept: a workshop catalogue sheet. Quiet paper, the product as the hero object,
   details set like a joinery spec sheet with mono labels. One accent: forest green. */
:root {
  --paper: #f0f1ec;        /* washi-grey paper, slight green bias */
  --sheet: #f8f8f4;        /* raised surfaces */
  --ink: #1d221d;          /* charcoal with a green cast */
  --muted: #5b6359;
  --rule: #d5d8cd;
  --forest: #2d5016;       /* accent */
  --forest-ink: #ffffff;
  --forest-soft: #e2e8d8;
  --char: #3b2416;         /* burnt engraving brown */
  --focus: #6b8f3a;

  --f-display: "Archivo", "Zen Kaku Gothic New", "Helvetica Neue", Arial, sans-serif;
  --f-display-ja: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --f-body: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --s-0: 0.8125rem; --s-1: 0.9375rem; --s-2: 1.0625rem; --s-3: 1.375rem;
  --s-4: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --s-5: clamp(2.2rem, 1.4rem + 3.4vw, 4rem);
  --radius: 6px;
  --maxw: 1120px;
  color-scheme: light;
  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: #141713; --sheet: #1b1f1a; --ink: #e7e9e1; --muted: #a2aa9e; --rule: #2e342c;
    --forest: #8fbb63; --forest-ink: #10150c; --forest-soft: #233019; --char: #3b2416; --focus: #a9d07a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141713; --sheet: #1b1f1a; --ink: #e7e9e1; --muted: #a2aa9e; --rule: #2e342c;
  --forest: #8fbb63; --forest-ink: #10150c; --forest-soft: #233019; --char: #3b2416; --focus: #a9d07a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: var(--s-2); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--forest); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--forest); color: var(--forest-ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Language pairs */
[data-lang="en"] [lang="ja"], [data-lang="ja"] [lang="en"] { display: none !important; }
[data-lang="ja"] body { line-height: 1.85; }
[data-lang="ja"] h1, [data-lang="ja"] h2, [data-lang="ja"] h3, [data-lang="ja"] .display { font-family: var(--f-display-ja); font-stretch: normal; letter-spacing: 0.02em; }

/* Layout */
.wrap {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(56px, 8vw, 104px); }
.section + .section { border-top: 1px solid var(--rule); }
.band { background: var(--sheet); border-block: 1px solid var(--rule); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1.05fr 1fr; } }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > * { margin: 0; min-width: 0; }

/* Type */
h1, h2, h3, .display {
  font-family: var(--f-display); font-stretch: 112%; font-weight: 700; line-height: 1.08;
  letter-spacing: -0.01em; text-wrap: balance; margin: 0;
}
h1 { font-size: var(--s-5); font-weight: 800; }
h2 { font-size: var(--s-4); }
h3 { font-size: var(--s-3); font-stretch: 105%; line-height: 1.25; }
p { margin: 0; max-width: 62ch; }
.lead { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); color: var(--muted); max-width: 52ch; }
.eyebrow {
  font-family: var(--f-mono); font-size: var(--s-0); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.mono { font-family: var(--f-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: var(--s-0); }

/* Hero banner: layered Northern Alps ridgelines, or your own photo via data-photo */
:root { --ridge-1: #e3e6dc; --ridge-2: #d3d9c8; --ridge-3: #c2ccb1; --ridge-line: #2d5016; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ridge-1: #191d18; --ridge-2: #1f261d; --ridge-3: #263022; --ridge-line: #8fbb63; } }
:root[data-theme="dark"] { --ridge-1: #191d18; --ridge-2: #1f261d; --ridge-3: #263022; --ridge-line: #8fbb63; }
.hero { position: relative; overflow: hidden; isolation: isolate; padding-bottom: clamp(110px, 17vw, 230px); background-size: cover; background-position: center; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-ridges { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(120px, 22vw, 300px); z-index: 0; display: block; max-width: none; }
.hero-ridges .r1 { fill: var(--ridge-1); }
.hero-ridges .r2 { fill: var(--ridge-2); }
.hero-ridges .r3 { fill: var(--paper); }
.hero-ridges .contour { fill: none; stroke: var(--ridge-line); stroke-width: 1.2; opacity: .35; vector-effect: non-scaling-stroke; }
.hero[data-photo] .hero-ridges { display: none; }
.hero[data-photo]::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--paper) 30%, color-mix(in srgb, var(--paper) 55%, transparent) 70%, transparent); z-index: 0; }
.hero + .section { border-top: 0; }

/* Brand lockup */
.brand { color: var(--ink); }
.brand .brand-mark { width: 30px; height: 30px; color: var(--forest); }
.brand .brand-wordmark { height: 18px; width: auto; }
.site-footer .brand .brand-wordmark { height: 16px; }
.stamp-pair { display: flex; gap: 28px; align-items: center; justify-content: center; color: var(--char); }
:root[data-theme="dark"] .stamp-pair { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp-pair { color: var(--ink); } }
.stamp-big { width: min(260px, 60vw); } .seal-small { width: min(110px, 26vw); color: #b0281c; }
.ws-canvas-wrap { background: #d9b588; padding: 14px; border-radius: 10px; }
.ws-canvas-wrap canvas { width: 100%; height: auto; display: block; border-radius: 5px; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font-family: "Archivo", sans-serif; font-stretch: 125%; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-place { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.brand-mark { width: 26px; height: 26px; align-self: center; flex: none; }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); flex-wrap: wrap; font-size: var(--s-1); }
.nav a { text-decoration: none; padding-block: 4px; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; color: var(--ink); }
.lang-toggle {
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.06em; background: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--ink); }
.lang-toggle b { font-weight: 600; }
.lang-toggle span { color: var(--muted); }

/* Buttons */
.btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font-family: var(--f-body); font-weight: 600; font-size: var(--s-1); line-height: 1.2;
  padding: 14px 22px; border-radius: var(--radius); border: 1px solid var(--forest);
  background: var(--forest); color: var(--forest-ink); transition: transform .15s ease, background .15s ease;
}
.btn:hover { color: var(--forest-ink); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { color: var(--ink); background: var(--sheet); }
.btn .arrow { font-family: var(--f-mono); }

/* Slab render */
.slab-figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.slab-figure svg { width: 100%; filter: drop-shadow(0 18px 24px rgba(30, 20, 10, 0.22)) drop-shadow(0 2px 3px rgba(30, 20, 10, 0.25)); }
.slab-figure figcaption { font-family: var(--f-mono); font-size: var(--s-0); color: var(--muted); }
.slab-text { font-family: "IBM Plex Mono", monospace; }
.slab-head { font-family: "Archivo", sans-serif; font-stretch: 112%; }

/* Product rail on home */
.cards { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: 1.4fr 1fr 1fr; } }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; text-decoration: none; }
a.card:hover { border-color: var(--ink); color: var(--ink); }
.card .tag { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.card .tag.live { color: var(--forest); }
.card .price { font-family: var(--f-mono); font-size: var(--s-1); margin-top: auto; }
.thumb { aspect-ratio: 4 / 3; max-width: 100%; border-radius: 4px; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.thumb svg { width: 86%; }

/* Two shapes */
.shapes { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 760px) { .shapes { grid-template-columns: 0.62fr 1fr; } }
.shape { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shape-art svg { width: 100%; filter: drop-shadow(0 14px 18px rgba(30, 20, 10, 0.2)); }
.shape:first-child .shape-art { max-width: 300px; margin-inline: auto; width: 100%; }
.shape figcaption { display: flex; flex-direction: column; gap: 4px; font-size: var(--s-1); }
.portrait-preview { max-width: 320px; margin-inline: auto; width: 100%; }
.portrait-preview svg { width: 100%; filter: drop-shadow(0 18px 24px rgba(30, 20, 10, 0.22)); }

/* Two versions */
.versions { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .versions { grid-template-columns: 1fr 1fr; } }
.version { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.version .thumb svg { width: 90%; }
.version-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px; }
.version-head .tag { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.version-head .tag.live { color: var(--forest); }
.version-head .price { font-family: var(--f-mono); font-size: var(--s-3); }
.version .btns { margin-top: auto; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--s-1); }
.ticks li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.ticks li::before { content: "✓"; color: var(--forest); font-family: var(--f-mono); }

/* Photo slots: replace with real photos */
.photo-slot {
  aspect-ratio: 4 / 3; max-width: 100%; border: 1px dashed var(--muted); border-radius: var(--radius);
  display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted);
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--rule) 45%, transparent) 14px 15px);
  font-family: var(--f-mono); font-size: var(--s-0);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* Lists of steps / features */
.feature-row { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .feature-row { grid-template-columns: repeat(3, 1fr); } }
.feature { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--ink); padding-top: 16px; min-width: 0; }
.feature .k { font-family: var(--f-mono); font-size: var(--s-0); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding-block: 18px; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--f-mono); color: var(--forest); font-size: var(--s-1); padding-top: 3px; }
.steps li > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.steps strong { font-weight: 600; }

/* Spec sheet */
.spec { display: grid; grid-template-columns: minmax(110px, 0.6fr) 1fr; border-top: 1px solid var(--ink); }
.spec dt, .spec dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.spec dt { font-family: var(--f-mono); font-size: var(--s-0); color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; padding-top: 15px; }
.code-line { font-family: var(--f-mono); font-size: var(--s-0); background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 10px 12px; overflow-x: auto; white-space: nowrap; }

/* Tables */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: var(--s-1); }
th, td { text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--f-mono); font-weight: 500; font-size: var(--s-0); color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.hl td { background: var(--forest-soft); }
tr.hl td:first-child { padding-left: 10px; }
.yes { color: var(--forest); font-weight: 600; }
.no { color: var(--muted); }

/* Builder */
.builder { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .builder { grid-template-columns: 0.85fr 1.15fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--f-mono); font-size: var(--s-0); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.note { border-left: 2px solid var(--forest); padding: 4px 0 4px 14px; color: var(--muted); font-size: var(--s-1); }
.status { font-family: var(--f-mono); font-size: var(--s-0); min-height: 1.5em; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); padding-block: 4px; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding-block: 16px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding-bottom: 18px; color: var(--muted); max-width: 64ch; }

/* Quote-free proof strip */
.strip { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--f-mono); font-size: var(--s-0); color: var(--muted); letter-spacing: 0.04em; }
.strip > span::before { content: "+ "; color: var(--forest); }

/* Legal */
.legal { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--ink); }
@media (min-width: 700px) { .legal { grid-template-columns: 240px 1fr; } }
.legal dt, .legal dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.legal dt { font-weight: 600; }
@media (min-width: 700px) { .legal dt { padding-right: 20px; } }
.placeholder { background: var(--forest-soft); padding: 0 4px; border-radius: 3px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 48px; font-size: var(--s-1); }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.fine { margin-top: 36px; font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Load-in: visible at rest, gentle rise */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .rise.d2 { animation-delay: .08s; } .rise.d3 { animation-delay: .16s; }
  @keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
}
