:root {
  --paper: #FAF9F6; --bg: #FAF9F6;
  --ink: #1C1B1A;
  --muted: #6E6B66;
  --line: #EAE7E0; --line-soft: #F1EEE8;
  --coral: #D6402C; --tone1: #D6402C;
  --green: #1E9E63; --tone3: #1E9E63;
  --amber: #E08A12; --tone2: #E08A12;
  --blue: #2C68D4;  --tone4: #2C68D4;
  --tone5: #9C9A95;
  --ok: #1E9E63; --warn: #E08A12; --bad: #D6402C;
  --card: #FFFFFF;
  --shadow: 0 6px 30px rgba(28,27,26,.05);
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --hz: "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.shell { width: min(920px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* header */
.site-header { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 40px; aspect-ratio: 1; border-radius: 10px; color: #fff; font: 700 24px/1 var(--hz); background: linear-gradient(150deg, var(--tone1), var(--tone4)); }
.brand-name { font: 700 21px/1 var(--display); letter-spacing: -.01em; }
.brand-name span { background: linear-gradient(90deg, var(--tone1), var(--tone2), var(--tone3), var(--tone4)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-line { margin: 9px 0 0; color: var(--muted); text-align: right; font-size: 12px; line-height: 1.35; max-width: 220px; }

/* hero */
.hero { padding: 40px 0 30px; text-align: center; }
.eyebrow, .section-kicker { color: var(--tone1); font-weight: 600; letter-spacing: .09em; font-size: 12px; text-transform: uppercase; }
.hero h1 { max-width: 640px; margin: 12px auto 12px; font: 700 clamp(30px, 4.2vw, 46px)/1.1 var(--display); letter-spacing: -.02em; }
.strike { position: relative; color: var(--muted); white-space: nowrap; }
.strike::after { content: ""; position: absolute; left: -2%; right: -3%; top: 56%; height: 4px; border-radius: 99px; background: #D8D4CC; transform: rotate(-1deg); }
.hero-copy { max-width: 480px; margin: 0 auto 18px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.lookup { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 600px; margin: 0 auto; padding: 7px 7px 7px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.lookup:focus-within { border-color: var(--ink); box-shadow: 0 4px 22px rgba(28,27,26,.06); }
.lookup input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 17px; }
.lookup input::placeholder { color: #B4B0A8; }
.lookup button { flex: 0 0 auto; padding: 0 20px; height: 42px; border: 0; border-radius: 9px; color: #fff; background: var(--ink); font: 500 15px var(--display); cursor: pointer; transition: opacity .15s, transform .1s; }
.lookup button:hover { opacity: .9; } .lookup button:active { transform: translateY(1px); }
.lookup button:disabled { cursor: wait; opacity: .5; }
.lookup-button { display: inline-block; margin-top: 14px; padding: 11px 18px; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 500; font-family: var(--display); }
.lookup-button:hover { opacity: .9; }
.lookup-note { min-height: 20px; margin: 9px 0 0; color: var(--muted); font-size: 12.5px; }
.lookup-note.is-message { color: var(--tone1); font-weight: 600; }

/* lookup result card */
.lookup-result { margin-top: 26px; padding: 24px 26px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-align: left; animation: reveal .4s cubic-bezier(.2,.7,.2,1); }
.result-heading { max-width: 640px; }
.result-heading h2 { margin: 10px 0 8px; font: 500 20px/1.3 var(--display); }
.result-heading p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.naturalness { display: inline-block; padding: 6px 12px; border-radius: 999px; color: #147A4A; background: #EAF6EF; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: capitalize; }
.naturalness.contextual { color: #9A5E0A; background: #FBF1DF; }
.naturalness.awkward, .naturalness.not_chinese { color: #A82E1E; background: #FBEAE7; }

/* dictionary vs real contrast (injected by app.js) */
.contrast { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin: 18px 0 4px; padding: 18px; background: #FCFBF8; border: 1px solid var(--line-soft); border-radius: 14px; }
.contrast .lbl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.contrast .dict .lbl { color: var(--bad); } .contrast .real .lbl { color: var(--ok); }
.contrast .dict .hz { font: 700 24px var(--hz); color: #A8A49C; text-decoration: line-through; text-decoration-color: #D8B4AE; }
.contrast .real .hz { font: 700 24px var(--hz); }
.contrast .py { font-size: 13px; color: var(--muted); margin-top: 3px; }
.contrast .arrow { font-size: 22px; color: #C9C5BD; }

.tone-1 { color: var(--tone1); } .tone-2 { color: var(--tone2); } .tone-3 { color: var(--tone3); } .tone-4 { color: var(--tone4); } .tone-5 { color: var(--tone5); }

.version-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 22px; }
.version-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.version-card h3 { margin: 0; font: 700 26px var(--hz); }
.version-card p { margin: 7px 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.version-card .pinyin { color: var(--tone1); font-size: 13px; }
.version-card small { display: block; margin-top: 12px; color: #8b877f; font-size: 12.5px; line-height: 1.4; }
.result-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.result-notes p { margin: 0; color: #3A3833; font-size: 14px; line-height: 1.55; }
.result-notes strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: var(--display); font-weight: 500; font-size: 13px; }

/* dish card (menu lookups, injected by app.js) */
.dish .dhead { text-align: center; }
.dish .dhz { font: 700 38px/1.1 var(--hz); }
.dish .dpy { color: var(--muted); font-size: 15px; margin-top: 5px; }
.dish .den { font: 500 18px var(--display); margin-top: 6px; }
.dish .dbadges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 4px; }
.dish .dbadge { background: #FCFBF8; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.dish .dbadge i { font-style: normal; color: var(--muted); font-size: 12px; }
.dish .dstars { color: #E0A82E; letter-spacing: 1px; }
.dish .dsec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.dish .dl { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.dish .dstd { font: 700 21px var(--hz); } .dish .dstd span { font: 400 13.5px var(--body); color: var(--muted); margin-left: 6px; }
.dish .dstory { font-size: 14.5px; line-height: 1.65; color: #3A3833; }
.dish .dchips { display: flex; flex-wrap: wrap; gap: 8px; }
.dish .dchip { background: #FCFBF8; border: 1px solid var(--line); border-radius: 99px; padding: 7px 13px; font-size: 14px; color: #4A4842; font-family: inherit; }
.dish button.dchip { cursor: pointer; transition: border-color .12s, transform .1s; }
.dish button.dchip:hover { border-color: var(--ink); transform: translateY(-1px); }

/* path cards (home) */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 18px 0 60px; }
.path-card { position: relative; display: block; padding: 16px 18px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: transform .12s, box-shadow .12s, border-color .12s; }
.path-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: 0 8px 24px rgba(28,27,26,.06); }
.path-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.path-title { display: flex; align-items: center; gap: 9px; font: 700 17px var(--display); letter-spacing: -.01em; color: var(--ink); }
.path-title i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.green .path-title i { background: var(--green); } .coral .path-title i { background: var(--coral); } .amber .path-title i { background: var(--amber); } .blue .path-title i { background: var(--blue); }
.path-tag { color: var(--muted); font-weight: 600; letter-spacing: .05em; font-size: 10.5px; text-transform: uppercase; white-space: nowrap; }
.path-tag.limited { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; }
.path-copy { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.path-arrow { position: absolute; right: 18px; bottom: 14px; opacity: 0; transform: translate(-6px,6px); font-size: 18px; transition: opacity .15s, transform .15s; }
.path-card:hover .path-arrow { opacity: .5; transform: translate(0,0); }

/* manifesto / launch / ad */
.signals { padding: 54px 0 34px; border-top: 1px solid var(--line); }
.signals-intro { display: grid; grid-template-columns: .95fr 1.05fr; gap: 34px; align-items: start; }
.signals h2 { margin: 10px 0 0; font: 700 clamp(26px, 3.5vw, 38px)/1.08 var(--display); letter-spacing: -.02em; }
.signals-intro p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.signals > .signal-grid { margin-top: 0; }
.signal-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, #fff, #FCFBF8); transition: transform .15s, box-shadow .15s, border-color .15s; }
.signal-card:hover { transform: translateY(-2px); border-color: #D9D5CD; box-shadow: var(--shadow); }
.signal-label { display: inline-block; color: var(--tone1); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.signal-card h3 { margin: 12px 0 8px; font: 700 21px/1.18 var(--display); letter-spacing: -.015em; }
.signal-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.service-shell { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 0 40px; }
.service-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.service-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.service-head h2 { margin: 10px 0 8px; font: 700 20px/1.2 var(--display); letter-spacing: -.01em; }
.service-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.service-head strong { white-space: nowrap; color: var(--tone1); font: 700 15px/1 var(--display); }
.service-list { margin: 18px 0 0; padding-left: 18px; color: #3A3833; font-size: 14px; line-height: 1.55; }
.service-list li + li { margin-top: 8px; }
.service-link { display: inline-flex; align-items: center; align-self: flex-start; margin-top: auto; padding: 10px 16px; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 500; font-family: var(--display); font-size: 14px; }
.service-link:hover { opacity: .9; }
.ad-slot { display: grid; place-items: center; min-height: 90px; margin-bottom: 40px; border: 1px dashed #D8D4CC; border-radius: 12px; color: #B4B0A8; background: repeating-linear-gradient(45deg, #FBFAF7 0 11px, #F6F4EE 11px 22px); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* footer */
.site-footer { display: grid; grid-template-columns: 1.3fr 1fr 1fr; align-items: end; gap: 24px; padding: 30px 0 28px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-brand { gap: 10px; }
.footer-brand .brand-mark { width: 34px; border-radius: 9px; font-size: 20px; }
.footer-brand .brand-name { font-size: 18px; }
.site-footer p { margin: 0; font-size: 13px; }
.site-footer nav { display: flex; justify-content: flex-end; gap: 16px; font-size: 13px; }
.site-footer nav a { border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--ink); }
.site-footer small { grid-column: 1 / -1; margin-top: 20px; color: #9c9890; font-size: 12px; }

/* interior pages */
.inner-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.inner-header .brand-line { display: none; }
.back-link { align-self: center; color: var(--muted); font-weight: 500; font-size: 13px; }
.back-link:hover { color: var(--ink); }
.inner-hero { display: grid; grid-template-columns: 1fr .8fr; gap: 44px; padding: 46px 0 36px; align-items: end; }
.inner-hero h1 { margin: 10px 0 0; max-width: 600px; font: 700 clamp(34px, 5vw, 52px)/1.0 var(--display); letter-spacing: -.02em; }
.inner-hero .lead { margin: 0 0 6px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.category-dot { display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 50%; background: currentColor; }
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 22px 0 60px; }
.content-card { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: transform .12s, box-shadow .12s; }
.content-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.content-card .label { color: var(--tone1); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.content-card h2 { margin: 14px 0 8px; font: 700 19px/1.2 var(--display); letter-spacing: -.01em; }
.content-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tool-card { display: flex; flex-direction: column; justify-content: space-between; }
.tool-card .tool-arrow { align-self: flex-end; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: var(--ink); font-size: 18px; margin-top: 14px; }
.daily-note { display: inline-block; margin-top: 13px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* tool form (names) */
.tool-workspace { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; align-items: start; padding: 16px 0 60px; }
.tool-form, .name-result { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.tool-form { display: grid; gap: 16px; }
.tool-form label { display: grid; gap: 7px; font-weight: 600; font-size: 14px; }
.tool-form input, .tool-form textarea, .tool-form select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: #fff; font: 400 15px/1.4 var(--body); transition: border-color .15s; }
.tool-form textarea { min-height: 100px; resize: vertical; }
.tool-form input:focus, .tool-form textarea:focus, .tool-form select:focus { border-color: var(--ink); }
.tool-form button { padding: 13px 18px; border: 0; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 500; font-family: var(--display); cursor: pointer; }
.tool-form button:hover { opacity: .9; } .tool-form button:disabled { cursor: wait; opacity: .5; }
.form-note { margin: -3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; } .form-note.is-error { color: var(--tone1); font-weight: 600; }
.name-result header h2 { margin: 10px 0 8px; font: 500 22px/1.2 var(--display); }
.name-result header p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.name-placeholder { min-height: 360px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, #FFFDF9, #FBF7EF); }
.name-placeholder h2 { max-width: 420px; margin: 12px 0 10px; font: 700 clamp(24px,3vw,34px)/1.1 var(--display); letter-spacing: -.02em; }
.name-placeholder > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.preview-characters { display: flex; gap: 10px; margin-top: 28px; }
.preview-characters span { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 13px; color: var(--amber); background: #fff; font: 700 26px/1 var(--hz); }
.name-options { display: grid; gap: 12px; margin-top: 22px; }
.name-option { display: grid; grid-template-columns: 140px 1fr; column-gap: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.name-option h3 { margin: 0; font: 700 34px/1.1 var(--hz); }
.name-option > .pinyin { grid-column: 1; margin: 7px 0 0; color: var(--tone1); }
.name-option dl { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.name-option dl div + div { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.name-option dt { font-weight: 600; font-size: 13px; } .name-option dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.choice-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:8px 0 64px; }
.choice-card { min-height:250px; padding:22px; border:1px solid var(--line); border-top:4px solid var(--amber); border-radius:16px; background:var(--card); transition:transform .15s,box-shadow .15s; }
.choice-card:hover { transform:translateY(-3px); box-shadow:var(--shadow); }
.choice-card.coral { border-top-color:var(--coral); } .choice-card.green { border-top-color:var(--green); }
.choice-card>span { color:var(--muted); font:600 11px var(--display); letter-spacing:.08em; }
.choice-card h2 { margin:30px 0 10px; font:700 22px/1.15 var(--display); letter-spacing:-.02em; }
.choice-card p { margin:0; color:var(--muted); font-size:14px; line-height:1.55; }
.choice-card strong { display:block; margin-top:28px; font:600 13px var(--display); }
.library-head { display:flex; align-items:end; justify-content:space-between; gap:20px; padding:17px 0; border-block:1px solid var(--line); color:var(--muted); font-size:12px; }
.library-head p { margin:0; text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.library-head strong { color:var(--ink); font-size:20px; }
.practical-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:26px 0 70px; }
.practical-card { display:flex; flex-direction:column; min-height:270px; padding:20px; border:1px solid var(--line); border-radius:16px; background:var(--card); transition:transform .12s,box-shadow .12s; }
.practical-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.practical-card h2 { margin:15px 0 10px; font:700 18px/1.2 var(--display); letter-spacing:-.01em; }
.practical-card>p:last-of-type { color:var(--muted); font-size:13.5px; line-height:1.5; }
.card-chinese { margin:0 0 12px; font:700 22px/1.25 var(--hz); }
.card-chinese small { display:block; margin-top:4px; color:var(--coral); font:500 12px/1.3 var(--body); }
.allergy-note { display:block; margin-top:auto; padding-top:14px; border-top:1px solid var(--line-soft); color:#8a857d; font-size:10.5px; line-height:1.45; }
.name-glyphs { margin:18px 0 2px; font:700 38px/1.1 var(--hz); }
.name-card h2 { margin-top:5px; color:var(--coral); font-size:14px; font-weight:500; }
.human-review { display:grid; grid-template-columns:1fr auto; gap:32px; align-items:center; margin-top:20px; margin-bottom:48px; padding:24px 26px; border:1px solid #e8c77f; border-radius:16px; background:#fff9eb; }
.human-review span { color:#9a6a13; font-size:10px; font-weight:700; letter-spacing:.08em; }
.human-review h2 { margin:7px 0 6px; font:700 20px/1.2 var(--display); }
.human-review p { max-width:590px; margin:0; color:var(--muted); font-size:13.5px; }
.review-action { display:grid; min-width:150px; gap:6px; text-align:right; }
.review-action strong { font:700 20px var(--display); }
.review-action a { font-size:13px; font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.review-action small { color:#8a6a2d; font-size:10px; }

.reveal { animation: reveal .5s both cubic-bezier(.2,.7,.2,1); }
.delay-1 { animation-delay: .06s; } .delay-2 { animation-delay: .12s; } .delay-3 { animation-delay: .18s; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 760px) {
  .shell { width: min(100% - 32px, 680px); }
  .brand-line { display: none; }
  .hero { padding: 30px 0 24px; text-align: center; }
  .hero h1 { font-size: clamp(26px, 8vw, 38px); }
  .lookup { flex-direction: column; align-items: stretch; padding: 12px; }
  .lookup input { min-height: 46px; padding: 0 6px; }
  .lookup button { width: 100%; height: 46px; }
  .version-grid, .result-notes, .contrast { grid-template-columns: 1fr; }
  .contrast .arrow { transform: rotate(90deg); justify-self: center; }
  .paths { grid-template-columns: 1fr; }
  .choice-grid, .practical-grid { grid-template-columns:1fr; }
  .choice-card, .practical-card { min-height:0; }
  .library-head { align-items:flex-start; flex-direction:column; gap:5px; }
  .human-review { grid-template-columns:1fr; gap:18px; }
  .review-action { text-align:left; }
  .signals-intro, .signal-grid, .service-shell { grid-template-columns: 1fr; }
  .service-head { grid-template-columns: 1fr; gap: 8px; }
  .site-footer { grid-template-columns: 1fr; align-items: start; } .site-footer nav { justify-content: flex-start; } .site-footer small { margin-top: 10px; }
  .inner-hero { grid-template-columns: 1fr; gap: 18px; padding: 34px 0 26px; }
  .content-grid { grid-template-columns: 1fr; }
  .tool-workspace { grid-template-columns: 1fr; } .name-option { grid-template-columns: 1fr; } .name-option dl { grid-column: 1; grid-row: auto; margin-top: 16px; }
}
