:root {
  --bg: oklch(0.985 0.004 85); --bg-soft: oklch(0.965 0.006 80); --bg-deep: oklch(0.93 0.008 78);
  --card: oklch(1 0 0); --line: oklch(0.9 0.006 80); --line-soft: oklch(0.94 0.005 80);
  --ink: oklch(0.255 0.012 60); --ink-2: oklch(0.42 0.01 55); --ink-3: oklch(0.58 0.008 55); --ink-faint: oklch(0.68 0.006 55);
  --accent: oklch(0.55 0.2 27); --accent-deep: oklch(0.47 0.17 27); --accent-soft: oklch(0.55 0.2 27 / 0.08);
  --ray: oklch(0.62 0.2 28 / 0.5); --maxw: 1240px; --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: 'Manrope', sans-serif; font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; position: relative; }
a { color: inherit; text-decoration: none; }
img, canvas { display: block; }

.eyebrow { font-family: 'Jost', sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--accent); }

.btn { font-family: 'Jost', sans-serif; font-weight: 500; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 26px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; border-radius: 2px; display: inline-flex; align-items: center; gap: 9px; transition: all 0.25s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); }
.btn--red { background: var(--accent); border-color: var(--accent); color: oklch(0.99 0.01 25); }
.btn--red:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn--sm { padding: 10px 18px; font-size: 12.5px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.topbar { background: var(--ink); color: oklch(0.86 0.006 80); font-family: 'Jost', sans-serif; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; }
.topbar .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; height: 36px; }
.topbar .sun-mini { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px oklch(0.55 0.2 27 / 0.25); }
.topbar b { color: #fff; font-weight: 500; }

header.site { position: sticky; top: 0; z-index: 50; background: oklch(0.985 0.004 85 / 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.brand { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.brand .bt { line-height: 1.05; }
.brand .mark { font-family: 'Jost', sans-serif; font-weight: 600; font-size: 19px; letter-spacing: 0.12em; display: block; white-space: nowrap; }
.brand .sub { font-family: 'Shippori Mincho', serif; font-size: 10px; letter-spacing: 0.2em; color: var(--ink-3); margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-family: 'Jost', sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); position: relative; padding: 6px 0; transition: color 0.2s; }
.nav-links a.cur { color: var(--accent); }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); transition: width 0.28s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.cur::after { width: 100%; }

/* hero */
.t-hero { position: relative; padding: 60px 0 50px; overflow: hidden; border-bottom: 1px solid var(--line); }
.t-hero .rays { position: absolute; top: -60%; left: 50%; width: 120vw; height: 120vw; transform: translateX(-50%); background: repeating-conic-gradient(from 0deg at 50% 50%, var(--ray) 0deg 2.6deg, transparent 2.6deg 9deg); opacity: 0.06; -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, black 12%, transparent 42%); mask-image: radial-gradient(circle at 50% 50%, black 0%, black 12%, transparent 42%); pointer-events: none; }
.t-hero h1 { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.16; margin: 18px 0 0; position: relative; }
.t-hero h1 em { font-style: normal; color: var(--accent); }
.t-hero p { font-size: 16px; color: var(--ink-2); max-width: 60ch; line-height: 1.8; margin-top: 18px; position: relative; }
.t-hero .back-link { font-family: 'Jost', sans-serif; font-size: 12px; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 14px; position: relative; display: inline-flex; align-items: center; gap: 5px; }
.t-hero .back-link:hover { color: var(--ink); }

/* tool hub grid */
.tool-hub { padding: 56px 0 70px; }
.tool-hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.tool-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 32px; display: flex; flex-direction: column; transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease); }
.tool-item:hover { box-shadow: 0 16px 42px -22px oklch(0.3 0.03 40 / 0.35); transform: translateY(-2px); }
.tool-item .ti-icon { font-size: 2rem; margin-bottom: 18px; }
.tool-item h3 { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 22px; margin-bottom: 10px; }
.tool-item p { color: var(--ink-2); font-size: 14px; line-height: 1.75; flex: 1; margin-bottom: 24px; }
.tool-item .keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tool-item .kw { font-family: 'Jost', sans-serif; font-size: 11px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 100px; color: var(--ink-faint); }

/* tab nav for individual tool pages */
.t-subnav { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.t-subnav .wrap { display: flex; gap: 6px; padding: 12px 0; flex-wrap: wrap; }
.t-subnav a { font-family: 'Jost', sans-serif; font-size: 12.5px; font-weight: 500; letter-spacing: 0.04em; padding: 9px 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 100px; transition: all 0.18s; }
.t-subnav a:hover { border-color: var(--ink-3); color: var(--ink); }
.t-subnav a.cur { background: var(--ink); color: #fff; border-color: var(--ink); }

.t-main { padding: 40px 0 20px; min-height: 60vh; }

.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 32px; box-shadow: 0 24px 60px -42px oklch(0.3 0.03 40 / 0.4); max-width: 860px; margin: 0 auto; }
.tool-card--wide { max-width: 100%; }
.tool-head { margin-bottom: 24px; }
.tool-head h3 { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 27px; }
.tool-head p { color: var(--ink-2); font-size: 14.5px; line-height: 1.75; margin-top: 8px; max-width: 70ch; }
.t-note { margin-top: 22px; padding: 14px 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.t-note b { color: var(--ink); }

/* shared field styles */
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-family: 'Jost', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.fld input, .fld select { font-family: 'Manrope', sans-serif; font-size: 14.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; transition: border-color 0.2s; width: 100%; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 100px; padding: 4px; gap: 4px; }
.seg button { font-family: 'Jost', sans-serif; font-size: 12.5px; font-weight: 500; padding: 8px 16px; border: none; background: transparent; color: var(--ink-2); border-radius: 100px; cursor: pointer; transition: all 0.18s; }
.seg button.on { background: var(--ink); color: #fff; }
.seg--2 { display: flex; }
.seg--2 button { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { font-family: 'Jost', sans-serif; font-size: 12.5px; font-weight: 500; padding: 8px 15px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 100px; cursor: pointer; transition: all 0.18s; }
.chips button:hover { border-color: var(--ink-3); color: var(--ink); }
.chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Plate Studio */
.ps-grid { display: grid; grid-template-columns: 340px 1fr; gap: 30px; }
.ps-controls { display: flex; flex-direction: column; gap: 16px; }
.ps-controls .seg { width: 100%; }
.ps-controls .seg button { flex: 1; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.div { height: 1px; background: var(--line); margin: 4px 0; }
.ps-preview { display: flex; flex-direction: column; gap: 18px; position: relative; }
.ps-stage { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 8px; padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 18px; min-height: 280px; justify-content: center; background-image: radial-gradient(oklch(0.7 0.01 60 / 0.18) 1px, transparent 1px); background-size: 14px 14px; }
.ps-canvas-wrap { filter: drop-shadow(0 14px 26px oklch(0.3 0.04 40 / 0.28)); }
.ps-canvas { max-width: 100%; border-radius: 6px; }
.ps-size { font-family: 'Jost', sans-serif; font-size: 13px; color: var(--ink-2); text-align: center; }
.ps-size b { color: var(--ink); }
.ps-size span { display: block; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; margin-top: 3px; }
.ps-actions { display: flex; gap: 12px; }
.ps-actions .btn { flex: 1; justify-content: center; }
.ps-toast { position: absolute; left: 50%; bottom: -8px; transform: translate(-50%, 100%); background: var(--ink); color: #fff; font-family: 'Jost', sans-serif; font-size: 12px; letter-spacing: 0.04em; padding: 9px 16px; border-radius: 100px; white-space: nowrap; z-index: 5; box-shadow: 0 10px 24px -10px oklch(0.3 0.04 40 / 0.5); }
.ps-sheet { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 26px; }
.ps-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ps-sheet-head h4 { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 19px; }
.ps-sheet-head p { font-size: 13px; color: var(--ink-2); max-width: 62ch; margin-top: 5px; line-height: 1.65; }
.ps-sheet-head b { color: var(--ink); }
.ps-sheet-act { display: flex; gap: 10px; }
.ps-tray { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.ps-thumb { position: relative; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.ps-thumb canvas { max-width: 160px; border-radius: 3px; }
.ps-thumb-tag { position: absolute; left: 8px; bottom: 8px; font-family: 'Jost', sans-serif; font-size: 10px; letter-spacing: 0.06em; background: var(--ink); color: #fff; padding: 3px 8px; border-radius: 100px; }
.ps-thumb-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: all 0.18s; }
.ps-thumb-x:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ps-empty { font-size: 13.5px; color: var(--ink-faint); padding: 16px 0; }
.ps-empty b { color: var(--ink-2); }

/* Scale Converter */
.sc-controls { display: flex; flex-direction: column; gap: 16px; }
.sc-row { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr; gap: 12px; }
.sc-out { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--ink); color: #fff; border-radius: 6px; padding: 18px 22px; flex-wrap: wrap; }
.sc-out-k { font-family: 'Jost', sans-serif; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.78 0.006 80); }
.sc-out-v { font-family: 'Shippori Mincho', serif; font-size: 26px; font-weight: 700; color: #fff; }
.sc-ref { margin-top: 24px; }
.sc-ref-head { font-family: 'Jost', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.sc-ref-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.sc-ref-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink-2); }
.sc-ref-item b { color: var(--ink); font-family: 'Jost', sans-serif; font-weight: 600; font-size: 13px; }

/* Paint Guide */
.pg-search { width: 100%; font-family: 'Manrope', sans-serif; font-size: 14.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 12px 15px; margin-bottom: 18px; }
.pg-search:focus { outline: none; border-color: var(--accent); }
.pg-table { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pg-row { display: grid; grid-template-columns: 1.6fr 1.2fr 1.2fr 0.8fr; gap: 12px; padding: 12px 16px; align-items: center; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.pg-row:last-child { border-bottom: none; }
.pg-row--h { background: var(--bg-soft); font-family: 'Jost', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.pg-name { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.pg-name i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid oklch(0.5 0.01 60 / 0.2); flex-shrink: 0; }
.pg-code { font-family: 'Jost', sans-serif; color: var(--ink-2); }
.pg-fin { color: var(--ink-faint); font-size: 12px; }
.pg-empty { padding: 22px 16px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }

/* Shop CTA */
.t-cta { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 60px 0; text-align: center; margin-top: 40px; }
.t-cta h2 { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: clamp(26px, 3.4vw, 38px); }
.t-cta p { color: var(--ink-2); font-size: 15px; margin-top: 12px; }
.t-cta-btns { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

footer.site { background: var(--ink); color: oklch(0.82 0.006 80); padding: 30px 0; }
.foot-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-bottom span { font-family: 'Jost', sans-serif; font-size: 11px; letter-spacing: 0.06em; color: oklch(0.62 0.006 80); }

@media (max-width: 880px) {
  .ps-grid { grid-template-columns: 1fr; }
  .tool-hub-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .tool-card { padding: 22px; }
  .sc-row { grid-template-columns: 1fr; }
  .sc-ref-grid { grid-template-columns: 1fr; }
  .pg-row { grid-template-columns: 1.4fr 1fr; }
  .pg-row span:nth-child(3), .pg-row span:nth-child(4) { display: none; }
  .topbar .wrap { font-size: 10px; }
}
