/* WhatWoodIsThis.com — © SaunaShare, Inc. */

:root {
  --bg: #faf7f1;
  --panel: #ffffff;
  --ink: #29221b;
  --muted: #6f635a;
  --line: #e8ddcf;
  --accent: #a8562f;
  --accent-deep: #7c3d20;
  --accent-soft: #f3e4d8;
  --gold: #c8a26a;
  --green: #3e7d4f;
  --amber: #8a5f12;
  --red: #a04432;
  --radius: 16px;
  --shadow: 0 2px 6px rgba(60, 42, 24, 0.06), 0 14px 34px rgba(60, 42, 24, 0.08);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, canvas { max-width: 100%; }

a { color: var(--accent-deep); }
a:hover { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 12px;
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .tld { color: var(--accent); }
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--muted);
  font-size: 0.92rem; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--accent-soft); }
@media (max-width: 640px) {
  .site-nav a:nth-child(n+3) { display: none; }
  .brand { font-size: 0.95rem; }
  .brand svg { width: 24px; height: 24px; }
  .site-nav a { padding: 6px 9px; font-size: 0.86rem; }
}

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 500px at 70% -10%, #fdf3e4 0%, transparent 60%),
    linear-gradient(180deg, #fbf6ec 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1.08; letter-spacing: -0.03em;
  max-width: 720px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  margin-top: 18px; max-width: 640px;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: var(--muted);
}
.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.trust-row {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px 20px;
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
}
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row span::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 700; font-size: 1rem;
  padding: 13px 26px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(168, 86, 47, 0.32); }
.btn-primary:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent-deep); border-color: var(--gold); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { padding: 8px 16px; font-size: 0.88rem; }

/* ---------- sections ---------- */
section { padding: 64px 0; scroll-margin-top: 72px; }
section h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em; line-height: 1.15;
}
.section-intro { margin-top: 12px; max-width: 660px; color: var(--muted); }

/* ---------- identifier ---------- */
#identify { padding-top: 56px; }

.uploader {
  margin-top: 28px;
  background: var(--panel);
  border: 2px dashed var(--gold);
  border-radius: 22px;
  padding: 52px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.uploader:hover, .uploader.dragover { border-color: var(--accent); background: #fffdf9; }
.uploader.dragover { box-shadow: 0 0 0 6px var(--accent-soft); }
.uploader .up-icon { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--accent); }
.uploader h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.uploader p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.uploader .privacy-note {
  margin-top: 16px; font-size: 0.82rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.uploader .privacy-note svg { width: 14px; height: 14px; color: var(--green); }

.samples { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.samples .samples-label { font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.sample-chip {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.sample-chip:hover { border-color: var(--accent); }
.sample-chip .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }

.upload-error {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: #fbeae5; color: var(--red); font-size: 0.92rem; font-weight: 600;
}

/* ---------- analysis workspace ---------- */
.workspace { margin-top: 28px; display: none; }
.workspace.active { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .workspace.active { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

.preview-panel { padding: 16px; }
.preview-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.preview-toolbar .hint { font-size: 0.82rem; color: var(--muted); margin-right: auto; }
.chip {
  font-size: 0.78rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.preview-stage {
  position: relative; display: inline-block; max-width: 100%;
  line-height: 0; border-radius: 12px; overflow: hidden;
  touch-action: none; cursor: crosshair;
  background: #efe8dc;
}
.preview-stage img { display: block; max-width: 100%; max-height: 56vh; user-select: none; -webkit-user-drag: none; }
.sel-box {
  position: absolute; border: 2px solid #fff;
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(30, 20, 10, 0.35);
  pointer-events: none; display: none;
}
.preview-caption { margin-top: 10px; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

.region-presets { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.region-presets .presets-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.region-btn {
  font: inherit; font-size: 0.8rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer;
}
.region-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- results ---------- */
.results-panel { padding: 26px; }
.analyzing { display: flex; align-items: center; gap: 14px; color: var(--muted); font-weight: 600; padding: 18px 0; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-kicker {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}
.result-name {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: -0.02em; line-height: 1.15; margin-top: 4px;
}
.result-sub { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }

.tier-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 800; padding: 5px 13px; border-radius: 999px;
  margin-top: 14px;
}
.tier-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tier-high { background: #e6f2e8; color: #2f6b40; }
.tier-moderate { background: #f7ecd8; color: var(--amber); }
.tier-low { background: #fbeae5; color: var(--red); }

.conf-meter { margin-top: 14px; }
.conf-meter .conf-label {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; font-weight: 700; margin-bottom: 6px;
}
.conf-track { height: 10px; border-radius: 999px; background: #f0e8db; overflow: hidden; }
.conf-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.result-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.result-block h4 {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}

.why-list { list-style: none; }
.why-list li {
  position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 0.94rem;
}
.why-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--accent-soft);
  border: 2px solid var(--gold);
}

.bar-row { display: grid; grid-template-columns: 170px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 9px; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 120px 1fr 44px; } }
.bar-row .bar-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { height: 8px; border-radius: 999px; background: #f0e8db; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; background: var(--gold); transition: width 0.6s ease; }
.bar-row:first-of-type .bar-fill { background: var(--accent); }
.bar-row .bar-val { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-align: right; }

.split-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 560px) { .split-cols { grid-template-columns: 1fr; } }

.tips-list { list-style: none; counter-reset: tip; }
.tips-list li {
  position: relative; padding-left: 34px; margin-bottom: 11px; font-size: 0.93rem;
  counter-increment: tip;
}
.tips-list li::before {
  content: counter(tip);
  position: absolute; left: 0; top: 1px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.result-about {
  margin-top: 10px; padding: 15px 17px; border-radius: 12px;
  background: var(--accent-soft); font-size: 0.93rem;
}
.result-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }

.feedback-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.feedback-box h4 {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.feedback-choice-row { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-choice {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 104px; min-height: 42px;
  font: inherit; font-size: 0.9rem; font-weight: 800;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.feedback-choice svg { width: 18px; height: 18px; flex: none; }
.feedback-choice:hover,
.feedback-choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.feedback-choice:disabled { cursor: default; opacity: 0.64; }
.feedback-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.feedback-form[hidden],
.feedback-status[hidden] { display: none; }
.feedback-field {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--muted);
}
.feedback-field select,
.feedback-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
}
.feedback-field select { min-height: 42px; padding: 8px 12px; }
.feedback-field textarea { min-height: 82px; padding: 10px 12px; resize: vertical; }
.feedback-status {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}
.feedback-status-success { color: var(--green); font-weight: 700; }
.feedback-status-error { color: var(--red); font-weight: 700; }
.feedback-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- wood guide ---------- */
#woods { background: #fff; border-block: 1px solid var(--line); }
.wood-grid {
  margin-top: 32px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px;
}
.wood-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}
.wood-card .swatch { height: 88px; position: relative; }
.wood-card .swatch .knot {
  position: absolute; width: 16px; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(35, 20, 8, 0.85) 0%, rgba(52, 30, 12, 0.7) 55%, transparent 75%);
}
.wood-card .card-body { padding: 18px 18px 20px; }
.wood-card h3 { font-size: 1.08rem; letter-spacing: -0.01em; }
.wood-card .latin { font-size: 0.8rem; color: var(--muted); font-style: italic; margin-top: 2px; }
.wood-card .card-tell { margin-top: 10px; font-size: 0.9rem; }
.wood-card .card-blurb { margin-top: 8px; font-size: 0.86rem; color: var(--muted); }
.wood-card .traits { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.wood-card .traits span {
  font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}

/* grain swatch backgrounds (CSS-painted so no image requests needed) */
.sw-grain {
  background-image:
    repeating-linear-gradient(94deg,
      rgba(58, 34, 14, var(--ga, 0.10)) 0 2px,
      transparent 2px 11px,
      rgba(58, 34, 14, calc(var(--ga, 0.10) * 0.5)) 11px 13px,
      transparent 13px 26px);
}
.sw-aspen            { background-color: #e9decad0; background-color: #e9deca; --ga: 0.04; }
.sw-thermo-aspen     { background-color: #a07148; --ga: 0.07; }
.sw-spruce           { background-color: #e4c999; --ga: 0.14; }
.sw-thermo-spruce    { background-color: #99693c; --ga: 0.18; }
.sw-alder            { background-color: #dbac7f; --ga: 0.08; }
.sw-thermo-alder     { background-color: #7f5331; --ga: 0.10; }
.sw-dark-thermo-alder{ background-color: #5a371f; --ga: 0.12; }
.sw-hemlock          { background-color: #d7bb95; --ga: 0.11; }
.sw-western-red-cedar{
  background-color: #ae6c44; --ga: 0.22;
  background-image:
    linear-gradient(94deg, rgba(122, 62, 30, 0.35) 0 18%, transparent 18% 40%, rgba(150, 84, 46, 0.3) 40% 55%, transparent 55% 78%, rgba(96, 46, 20, 0.3) 78% 100%),
    repeating-linear-gradient(94deg, rgba(58, 30, 12, 0.22) 0 2px, transparent 2px 9px);
}
.sw-thermo-magnolia { background-color: #5b4030; --ga: 0.07; }
.sw-thermo-ash      { background-color: #62473d; --ga: 0.18; }
.sw-kodiak-spruce   { background-color: #ab7248; --ga: 0.20; }
.sw-thermo-pine     { background-color: #ae754b; --ga: 0.18; }
.sw-radiata-pine {
  background-color: #96603e; --ga: 0.26;
  background-image:
    linear-gradient(94deg, rgba(76, 42, 22, 0.22) 0 10%, transparent 10% 38%, rgba(226, 165, 104, 0.14) 38% 50%, transparent 50% 100%),
    repeating-linear-gradient(94deg, rgba(58, 30, 12, 0.24) 0 2px, transparent 2px 8px);
}
.sw-red-oak         { background-color: #6d4e3c; --ga: 0.14; }
.sw-ignite-spruce {
  background-color: #181818; --ga: 0.16;
  background-image:
    linear-gradient(94deg, rgba(255, 255, 255, 0.05) 0 12%, transparent 12% 42%, rgba(255, 255, 255, 0.04) 42% 55%, transparent 55% 100%),
    repeating-linear-gradient(94deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 11px);
}
.sw-drift-spruce {
  background-color: #7e8085; --ga: 0.18;
  background-image:
    linear-gradient(94deg, rgba(255, 255, 255, 0.12) 0 16%, transparent 16% 44%, rgba(20, 22, 24, 0.12) 44% 58%, transparent 58% 100%),
    repeating-linear-gradient(94deg, rgba(35, 38, 42, 0.16) 0 2px, transparent 2px 10px);
}

/* ---------- comparison table ---------- */
.table-scroll { margin-top: 28px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table.compare { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 0.9rem; }
table.compare th, table.compare td { padding: 12px 16px; text-align: left; vertical-align: top; }
table.compare thead th {
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase;
  position: sticky; top: 0;
}
table.compare tbody tr:nth-child(even) { background: #fbf8f2; }
table.compare tbody th { font-weight: 700; white-space: nowrap; }
table.compare td.swcell { width: 46px; }
table.compare td.swcell span { display: block; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.08); }

.lookalikes { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lookalike {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; font-size: 0.92rem;
}
.lookalike strong { display: block; margin-bottom: 6px; color: var(--accent-deep); }

/* ---------- how it works ---------- */
.steps { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.step .step-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; }
.step p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

.tech-note {
  margin-top: 28px; padding: 26px 28px; border-radius: var(--radius);
  background: #2e2117; color: #f2e8da;
}
.tech-note h3 { font-size: 1.1rem; }
.tech-note p { margin-top: 10px; font-size: 0.94rem; color: #d9c9b4; }
.tech-note strong { color: #f2e8da; }

/* ---------- FAQ ---------- */
#faq { background: #fff; border-top: 1px solid var(--line); }
.faq-list { margin-top: 28px; max-width: 800px; }
.faq-list details {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 12px; overflow: hidden;
}
.faq-list summary {
  cursor: pointer; padding: 17px 48px 17px 20px; font-weight: 700; font-size: 0.98rem;
  list-style: none; position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--accent);
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { padding: 0 20px 18px; color: var(--muted); font-size: 0.94rem; }

/* ---------- footer ---------- */
.site-footer {
  background: #2e2117; color: #cbb99f; padding: 44px 0 36px; margin-top: 24px;
  font-size: 0.88rem;
}
.site-footer .foot-brand { display: flex; align-items: center; gap: 10px; color: #f2e8da; font-weight: 700; font-size: 1rem; }
.site-footer .foot-brand svg { width: 24px; height: 24px; }
.site-footer p { margin-top: 12px; max-width: 620px; }
.site-footer .legal { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(242, 232, 218, 0.14); color: #9d8b72; font-size: 0.8rem; }
