/* =====================================================================
   GODIMS Typing - global stylesheet
   Brand: pure black + logo teal (#35B7A8). Keycap motif = the one bold idea.
   1 Tokens  2 Base  3 Header  4 Buttons & keycaps  5 Layout  6 Home
   7 Cards & lists  8 Prose  9 FAQ  10 Footer  11 Responsive
   ===================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
    --teal: #35B7A8;
    --teal-deep: #167A6F;      /* text/links on light backgrounds (AA contrast) */
    --teal-soft: #E6F6F3;
    --ink: #000000;
    --ink-2: #3b4442;
    --ink-3: #66726f;
    --paper: #ffffff;
    --paper-2: #F4F8F7;
    --line: #dbe5e3;
    --bad: #D6334C;
    --good: #167A6F;
    --radius: 14px;
    --shadow: 0 1px 0 rgba(0,0,0,.04), 0 12px 30px -18px rgba(0,0,0,.35);
    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --header-h: 76px;
}
[data-theme="dark"] {
    --teal-deep: #4fd0c0;
    --teal-soft: #0f2623;
    --ink: #f2f7f6;
    --ink-2: #c3cfcc;
    --ink-3: #8fa09c;
    --paper: #0b0f0e;
    --paper-2: #121918;
    --line: #25312f;
    --bad: #ff6b80;
    --good: #4fd0c0;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 12px 30px -18px rgba(0,0,0,.9);
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0; padding-top: var(--header-h); overflow-x: hidden;
    background: var(--paper); color: var(--ink);
    font: 400 1.0625rem/1.65 var(--font-body);
    transition: background .25s, color .25s;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--teal-deep); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 .85em var(--font-mono); padding: .1em .5em; border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 6px; background: var(--paper); }

/* ---------- 3. HEADER ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 1000; height: var(--header-h);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; gap: 24px; }
.header-logo { display: block; line-height: 0; flex: none; }
.header-logo img { height: 36px; width: auto; }
[data-theme="dark"] .header-logo img { filter: invert(1) hue-rotate(180deg) saturate(1.3); }  /* black letters -> white, teal stays teal */
.nav-wrap { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 16px; }
.header-nav { display: flex; gap: 4px; margin-left: 12px; }
.header-nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .97rem; }
.header-nav a:hover { background: var(--teal-soft); }
.header-nav a.active { background: var(--ink); color: var(--paper); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { border-color: var(--teal); }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 4. BUTTONS & KEYCAPS ---------- */
.btn, .keycap {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
    padding: .7em 1.3em; border-radius: 12px;
    border: 2px solid var(--ink); border-bottom-width: 5px;
    background: var(--paper); color: var(--ink);
    transition: transform .08s ease, border-bottom-width .08s ease, background .15s;
}
.btn:hover, .keycap:hover { background: var(--teal-soft); }
.btn:active, .keycap:active { transform: translateY(3px); border-bottom-width: 2px; }
.btn-solid { background: var(--teal); color: #000; }
.btn-solid:hover { background: #4cc7b9; }
.btn-lg { font-size: 1.1rem; padding: .8em 1.6em; }
.keycap { padding: .45em .95em; font-size: .95rem; border-radius: 10px; border-bottom-width: 4px; }
.keycap[aria-pressed="true"], .keycap.is-on { background: var(--teal); color: #000; transform: translateY(2px); border-bottom-width: 2px; }
.keycap:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 5. LAYOUT ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head p { color: var(--ink-2); font-size: 1.15rem; }
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--teal-soft), transparent); }
.page-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); max-width: 18ch; }
.page-hero p.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 62ch; margin: 0; }
.crumbs { font-size: .9rem; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: inherit; }

/* ---------- 6. HOME ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 6vw, 88px); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -220px; border-radius: 50%; border: 56px solid var(--teal-soft); z-index: 0; }  /* echoes the logo's magnifier ring */
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero p.lead { font-size: 1.25rem; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 0; }
.hero-trust { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-3); font-size: .95rem; }
.hero-trust span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); margin-right: 8px; }

/* live demo card */
.demo { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--teal); overflow: hidden; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 2px solid var(--ink); background: var(--paper-2); font: 600 .9rem var(--font-body); }
.demo-stats { display: flex; gap: 16px; font-family: var(--font-mono); }
.demo-stats b { font-size: 1.05rem; }
.demo-body { padding: 22px; font: 500 1.3rem/1.9 var(--font-mono); min-height: 150px; cursor: text; position: relative; }
.demo-body .c { border-radius: 3px; }
.demo-body .ok { color: var(--teal-deep); }
.demo-body .err { color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }
.demo-body .cur { background: var(--teal); color: #000; }
.demo-body:not(.focus) .cur { background: transparent; box-shadow: inset 0 -3px 0 var(--teal); }
.demo-body .rest { color: var(--ink-3); }
.demo-hint { padding: 0 22px 18px; color: var(--ink-3); font-size: .9rem; }
.demo-input { position: absolute; opacity: 0; pointer-events: none; left: 0; top: 0; width: 1px; height: 1px; }

/* ---------- 7. CARDS & LISTS ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
a.card { transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--teal); }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--ink-2); margin-bottom: 1.1em; }
.card .more { margin-top: auto; font-weight: 700; color: var(--teal-deep); }
.card-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--teal); color: #000; display: grid; place-items: center; margin-bottom: 18px; border: 2px solid var(--ink); }
.card.soft { border-color: var(--line); background: var(--paper-2); }
.tag { display: inline-block; font: 600 .78rem var(--font-body); padding: .15em .7em; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink-2); }
.tag.easy { border-color: var(--teal); color: var(--teal-deep); }
.tag.hard { border-color: var(--bad); color: var(--bad); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

.text-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.text-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.text-list li:hover { border-color: var(--ink); }
.text-list h3 { font-size: 1.15rem; margin: 0 0 4px; }
.text-list .preview { color: var(--ink-3); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-list .row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tip-card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; }
.tip-card h3 { font-size: 1.15rem; }
.tip-card p { margin: 0; color: var(--ink-2); }
.tip-card .tip-key { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; margin-bottom: 14px; font: 700 1rem var(--font-mono); background: var(--teal); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 10px; color: #000; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.stat-strip > div { padding: 22px; border-right: 2px solid var(--ink); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip b { display: block; font: 800 2rem var(--font-display); letter-spacing: -0.03em; }
.stat-strip span { color: var(--ink-3); font-size: .95rem; }

.cta-band { background: var(--ink); color: var(--paper); border-radius: 24px; padding: clamp(32px, 6vw, 64px); display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; max-width: 18ch; }
.cta-band p { margin: 8px 0 0; color: color-mix(in srgb, var(--paper) 75%, transparent); }
.cta-band .btn { border-color: var(--paper); }

/* ---------- 8. PROSE ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.8em; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.callout { border-left: 6px solid var(--teal); background: var(--teal-soft); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.6em 0; }
.callout p:last-child { margin: 0; }

/* keyboard finger map */
.kb-map { background: var(--paper-2); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.kb-map svg { min-width: 560px; display: block; margin: 0 auto; }

/* forms */
.form { display: grid; gap: 16px; max-width: 620px; }
.form label { font-weight: 700; display: grid; gap: 6px; }
.form input, .form textarea, .form select { font: 500 1rem var(--font-body); padding: .8em 1em; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); width: 100%; }
.form textarea { min-height: 150px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 12px; border: 2px solid var(--teal); background: var(--teal-soft); font-weight: 600; margin-bottom: 20px; }
.notice.err { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ---------- 9. FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.faq details[open] { border-color: var(--ink); }
.faq summary { cursor: pointer; padding: 18px 22px; font: 700 1.1rem var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 700 1.5rem/1 var(--font-mono); color: var(--teal-deep); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--ink-2); }

/* ---------- 10. FOOTER ---------- */
.site-footer { background: #000; color: #e8f1ef; margin-top: 0; padding: 56px 24px 24px; }
[data-theme="dark"] .site-footer { background: #050807; border-top: 1px solid var(--line); }
.footer-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand p { color: #9fb2ae; max-width: 38ch; margin-top: 16px; }
.site-footer h4 { font-size: 1rem; margin-bottom: 14px; color: var(--teal); }
.site-footer a { display: block; color: #e8f1ef; text-decoration: none; padding: 4px 0; }
.site-footer a:hover { color: var(--teal); }
.footer-bottom { max-width: 1240px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid #1f2b29; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: #8fa09c; font-size: .9rem; }

/* ---------- 11. RESPONSIVE ---------- */
@media (max-width: 960px) {
    .hero-grid, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .grid-4, .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .stat-strip > div:nth-child(2) { border-right: 0; }
    .stat-strip > div:nth-child(-n+2) { border-bottom: 2px solid var(--ink); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .menu-toggle { display: flex; }
    .nav-wrap { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--paper); border-bottom: 2px solid var(--ink); padding: 16px 24px 24px; flex-direction: column; align-items: stretch; transform: translateY(-120%); visibility: hidden; transition: transform .3s ease, visibility .3s; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
    .nav-wrap.open { transform: none; visibility: visible; }
    .header-nav { flex-direction: column; margin: 0; }
    .header-nav a { padding: 14px 12px; font-size: 1.1rem; }
    .header-actions { justify-content: space-between; }
    .header-actions .btn { flex: 1; }
    .text-list li { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    body { font-size: 1rem; }
    .wrap, .wrap-narrow, .header-inner { padding: 0 18px; }
    .grid-4 { grid-template-columns: 1fr; }
    .demo { box-shadow: 5px 5px 0 var(--teal); margin-right: 5px; }
    .demo-body { font-size: 1.05rem; padding: 16px; }
    .footer-grid { grid-template-columns: 1fr; }
    .header-logo img { height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
