/* ==========================================================================
   Technice.id public site
   --------------------------------------------------------------------------
   Dials: ENERGY 1 (calm) / RHYTHM 2 (consistent, with breaks) / MOTION 1 (hover + focus only)
   Why calm: visitors are evaluating a vendor; they read, they do not need choreography.

   Palette (3 core + 1 accent):
     ink    #0F1B2D  text and the one dark band (contact), anchors the page
     paper  #F7F6F2  page background, warm off-white so case studies read like documents
     white  #FFFFFF  panels that hold interactive content (forms, screenshots)
     brand  #0B4DB0  logo blue; the only accent: links, primary action, focus ring
   Type: IBM Plex Sans (engineering heritage, sober, not the default AI Inter look)
         IBM Plex Mono at small sizes only, for spec-sheet labels and section numbers.
   Motif: the "spec sheet": hairline-ruled rows with mono labels. Used for project
          metadata, product facts and the stack table so the site feels like one system.
   Radius 4px / 6px: squared, document-like; nothing pill shaped.
   Shadow: none on content. Hierarchy comes from rules and spacing. Only the
          lightbox and the mobile menu (true overlays) get elevation.
   Theme: light only. The document motif and the mostly light app screenshots
          read best on paper; one theme done properly beats two done halfway.
   ========================================================================== */

:root {
    --ink: #0F1B2D;
    --ink-2: #2B3647;
    --muted: #4F5866;      /* 6.6:1 on paper */
    --paper: #F7F6F2;
    --white: #FFFFFF;
    --line: #DCD9D0;
    --line-strong: #B9B5AA;
    --field-border: #858175; /* 4.0:1 on white, meets 3:1 for input boundaries */
    --brand: #0B4DB0;      /* 7.8:1 on white, 7.2:1 on paper */
    --brand-dark: #083B88;
    --brand-tint: #E8EEF8;
    --on-ink: #F7F6F2;
    --on-ink-muted: #B7BFCC; /* 9.3:1 on ink */
    --danger: #A61B1B;
    --success: #1F6B3A;

    --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --r-sm: 4px;
    --r-md: 6px;
    --wrap: 1180px;
    --gutter: 16px;
    --header-h: 64px;
}

@media (min-width: 768px) {
    :root { --gutter: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
button { font: inherit; color: inherit; }

/* One visible focus style everywhere (R-32). */
:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 2px;
}
.on-ink :focus-visible { outline-color: #8FB4F0; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: var(--gutter); top: -100px; z-index: 200;
    background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; color: var(--on-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Labels: the spec-sheet voice ---------- */
.label {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.on-ink .label { color: var(--on-ink-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); color: var(--white); }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: var(--ink-2); color: var(--on-ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { width: 18px; height: 18px; flex: none; }

.text-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
    font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
    color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--brand);
    display: grid; place-items: center; color: var(--white); font-size: 0.8125rem; font-weight: 700;
}
.primary-nav { display: none; }
.primary-nav ul { display: flex; list-style: none; gap: 4px; }
.primary-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
    color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn { display: none; }

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.lang-switch a {
    display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px;
    font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.lang-switch a + a { border-left: 1px solid var(--line-strong); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }

.menu-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: transparent; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }

.mobile-nav {
    border-top: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 12px 24px -12px rgba(15, 27, 45, .25); /* overlay elevation */
}
.mobile-nav[hidden] { display: none; }
.mobile-nav ul { list-style: none; padding: 8px 0 16px; }
.mobile-nav li a {
    display: flex; align-items: center; min-height: 48px; padding: 0 var(--gutter);
    color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line);
}
.mobile-nav .btn { margin: 16px var(--gutter) 0; width: calc(100% - 2 * var(--gutter)); }

@media (min-width: 960px) {
    .primary-nav { display: block; }
    .header-actions .btn { display: inline-flex; }
    .menu-toggle, .mobile-nav { display: none !important; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .section { padding: 96px 0; } }
.section-head { display: grid; gap: 12px; margin-bottom: 40px; max-width: 760px; }
.section-head h2 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); }
.section-head p { color: var(--muted); font-size: 1.0625rem; }
.section-index { font-family: var(--mono); font-size: 0.8125rem; color: var(--brand); font-weight: 500; letter-spacing: .04em; }
.section-foot { margin-top: 32px; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 64px; }
@media (min-width: 768px) { .hero { padding: 80px 0 96px; } }
.hero-grid { display: grid; gap: 48px; align-items: start; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; } }
.hero h1 {
    font-size: clamp(2.125rem, 5.4vw, 3.5rem);
    line-height: 1.08; letter-spacing: -0.025em; font-weight: 600;
    margin: 16px 0 20px; max-width: 16ch;
}
.hero-lead { font-size: 1.125rem; color: var(--ink-2); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 480px) { .hero-actions .btn { flex: 0 0 auto; } }

/* Case-file panel: the hero's evidence, pulled from real data */
.case-file { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.case-file-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.case-file-cover { aspect-ratio: 16 / 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.case-file-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.case-file-body { padding: 20px 16px 16px; display: grid; gap: 12px; }
.case-file-body h2 { font-size: 1.25rem; }
.case-file-body p { color: var(--muted); font-size: 0.9375rem; }
.case-file-apps { list-style: none; }
.case-file-apps li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.case-file-apps li:last-child { border-bottom: 0; }
.case-file-apps .label { margin-top: 2px; }
.case-file-apps img { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line); }
.case-file-apps a { color: var(--ink); font-weight: 600; text-decoration: none; }
.case-file-apps a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Spec sheet (identity motif) ---------- */
.spec { display: grid; border-top: 1px solid var(--line); margin: 0; }
.spec-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.spec-row dt { margin: 0; }
.spec-row dd { margin: 0; font-size: 0.9375rem; color: var(--ink); }
.spec-row dd a { font-weight: 500; }
@media (min-width: 768px) { .spec-row { grid-template-columns: 140px minmax(0, 1fr); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.chip {
    display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font-size: 0.8125rem; color: var(--ink-2); background: var(--white); white-space: nowrap;
}

/* ---------- Projects ---------- */
.project-feature { display: grid; gap: 24px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
@media (min-width: 960px) { .project-feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; } }
.project-feature-media {
    display: block; aspect-ratio: 16 / 10; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.project-feature-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .3s ease; }
.project-feature-media:hover img { transform: scale(1.015); }
.project-feature-body { display: grid; gap: 16px; align-content: start; }
.project-feature-body h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
.project-feature-body h3 a { color: var(--ink); text-decoration: none; }
.project-feature-body h3 a:hover { color: var(--brand); text-decoration: underline; }
.project-feature-body > p { color: var(--ink-2); }

.media-placeholder {
    width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; text-align: center;
    background: var(--paper); color: var(--muted); font-family: var(--mono); font-size: 0.8125rem;
}

.project-list { list-style: none; }
.project-row {
    display: grid; gap: 8px 24px; padding: 24px 0; border-bottom: 1px solid var(--line);
    grid-template-columns: 40px minmax(0, 1fr);
}
.project-row-num { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); padding-top: 4px; }
.project-row-main { display: grid; gap: 8px; }
.project-row h3 { font-size: 1.1875rem; }
.project-row h3 a { color: var(--ink); text-decoration: none; }
.project-row h3 a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.project-row { position: relative; }
.project-row:hover h3 a { color: var(--brand); text-decoration: underline; }
.project-row p { color: var(--muted); font-size: 0.9375rem; max-width: 70ch; }
.project-row-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.project-row-thumb { display: none; }
@media (min-width: 768px) {
    .project-row { grid-template-columns: 56px minmax(0, 1fr) 220px; align-items: start; }
    .project-row-thumb {
        display: block; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--r-md);
        overflow: hidden; background: var(--white);
    }
    .project-row-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
}

/* Filter (projects index) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-btn {
    min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--white); cursor: pointer; font-size: 0.9375rem; color: var(--ink-2);
}
.filter-btn:hover { border-color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ---------- Products ---------- */
.product-list { list-style: none; border-top: 1px solid var(--line); }
.product-row {
    position: relative; display: grid; gap: 12px 20px; padding: 24px 0; border-bottom: 1px solid var(--line);
    grid-template-columns: 56px minmax(0, 1fr);
}
.product-icon {
    width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--white);
    display: grid; place-items: center; overflow: hidden; font-weight: 600; color: var(--brand);
}
.product-icon img { width: 100%; height: 100%; object-fit: cover; }
.product-row-main { display: grid; gap: 6px; min-width: 0; }
.product-row h3 { font-size: 1.125rem; }
.product-row h3 a { color: var(--ink); text-decoration: none; }
.product-row h3 a:hover { color: var(--brand); text-decoration: underline; }
.product-row p { color: var(--muted); font-size: 0.9375rem; max-width: 68ch; }
.product-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 768px) {
    .product-row { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; }
    .product-row-actions { grid-column: auto; justify-content: flex-end; }
}
.product-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* ---------- Stack table ---------- */
.stack-table { border-top: 1px solid var(--line); }
.stack-row { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .stack-row { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: baseline; } }
.stack-row ul { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; }
.stack-row li { font-size: 1rem; color: var(--ink); }

/* ---------- Contact (the one ink band) ---------- */
.contact { background: var(--ink); color: var(--on-ink); border-top: 0; }
.contact .section-head p { color: var(--on-ink-muted); }
.contact .section-index { color: #8FB4F0; }
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }
.channels { display: grid; border-top: 1px solid rgba(247, 246, 242, .18); }
.channel dd, .channel dt { margin: 0; }
.channel { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid rgba(247, 246, 242, .18); }
.channel a, .channel span.value { color: var(--on-ink); font-size: 1.0625rem; font-weight: 500; text-decoration-color: rgba(247, 246, 242, .4); }
.channel a:hover { color: var(--white); text-decoration-color: currentColor; }

.form-panel { background: var(--white); color: var(--ink); border-radius: var(--r-md); padding: 24px 16px; }
@media (min-width: 768px) { .form-panel { padding: 32px; } }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
    border: 1px solid var(--field-border); border-radius: var(--r-sm);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: 0.8125rem; color: var(--danger); }
.form-status { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 0.9375rem; }
.form-status:empty { display: none; }
.form-status.is-success { background: #E7F3EB; color: var(--success); border: 1px solid #B9DCC5; }
.form-status.is-error { background: #FBEAEA; color: var(--danger); border: 1px solid #EBC1C1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.form-actions .btn { width: 100%; }
@media (min-width: 640px) { .form-actions .btn { width: auto; } }
.form-note { font-size: 0.8125rem; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 40px 0 40px; }
@media (min-width: 768px) { .page-head { padding: 64px 0 56px; } }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; font-size: 0.875rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.page-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); letter-spacing: -0.02em; line-height: 1.1; max-width: 22ch; margin-top: 12px; }
.page-head .lead { margin-top: 16px; font-size: 1.125rem; color: var(--ink-2); max-width: 62ch; }

/* ---------- Case study document ---------- */
.doc-grid { display: grid; gap: 40px; padding-bottom: 80px; }
@media (min-width: 1024px) { .doc-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; } }
.toc { display: none; }
@media (min-width: 1024px) {
    .toc { display: block; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
    .toc ol { list-style: none; border-left: 1px solid var(--line); }
    .toc a {
        display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent;
        color: var(--muted); text-decoration: none; font-size: 0.9375rem;
    }
    .toc a:hover { color: var(--ink); }
    .toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--brand); }
}
.doc { min-width: 0; max-width: 760px; }
.doc-section { padding: 40px 0; border-top: 1px solid var(--line); }
.doc-section:first-child { border-top: 0; padding-top: 0; }
.doc-section h2 { display: flex; gap: 12px; align-items: baseline; font-size: 1.5rem; margin-bottom: 16px; }
.doc-section h2 .section-index { font-size: 0.8125rem; }
.prose p { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.75; }
.prose p + p { margin-top: 1em; }
.check-list { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.check-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.check-list li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; background: var(--brand); border-radius: 1px; }
.numbered-list { list-style: none; counter-reset: n; border-top: 1px solid var(--line); }
.numbered-list li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.numbered-list li::before { content: counter(n, decimal-leading-zero); font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); padding-top: 3px; }

.doc-hero-media { margin: 0 0 48px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.doc-hero-media button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.doc-hero-media img { width: 100%; max-height: 620px; object-fit: cover; object-position: top; }

.spec-panel { margin-top: 32px; }
@media (min-width: 1024px) { .page-head-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: end; } .spec-panel { margin-top: 0; } }

/* ---------- Gallery ---------- */
.gallery { position: relative; }
.gallery-track {
    display: grid; grid-auto-flow: column; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 12px; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.gallery-track.is-portrait { grid-auto-columns: min(46%, 220px); }
.gallery-track.is-landscape { grid-auto-columns: min(88%, 520px); }
.gallery-item { scroll-snap-align: start; margin: 0; }
.gallery-item button {
    display: block; width: 100%; padding: 0; background: var(--white); cursor: zoom-in;
    border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.gallery-item button:hover { border-color: var(--line-strong); }
.gallery-item img { width: 100%; height: auto; }
.gallery-controls { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* Lightbox (native <dialog>) */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(9, 15, 26, .92); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: var(--on-ink); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); gap: 12px; }
.lightbox-count { font-family: var(--mono); font-size: 0.8125rem; color: var(--on-ink-muted); }
.lightbox-stage { display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); box-shadow: 0 24px 64px rgba(0, 0, 0, .5); }
.lightbox-nav { display: flex; justify-content: center; gap: 12px; padding: 12px var(--gutter) 20px; }
.lightbox .icon-btn { background: rgba(247, 246, 242, .08); color: var(--on-ink); border-color: rgba(247, 246, 242, .3); }
.lightbox .icon-btn:hover { background: rgba(247, 246, 242, .16); border-color: var(--on-ink); }

/* ---------- Product detail ---------- */
.product-head { display: grid; gap: 20px; grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.product-head .product-icon { width: 72px; height: 72px; border-radius: 16px; }
.store-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.two-col { display: grid; gap: 40px; }
@media (min-width: 960px) { .two-col { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; } }

/* ---------- Next / related ---------- */
.next-card {
    position: relative; display: grid; gap: 8px; padding: 24px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--r-md);
}
.next-card:hover { border-color: var(--ink); }
.next-card h3 a { color: var(--ink); text-decoration: none; }
.next-card h3 a::after { content: ""; position: absolute; inset: 0; }
.next-card p { color: var(--muted); font-size: 0.9375rem; }

/* ---------- Empty states ---------- */
.empty {
    padding: 40px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-md);
    background: var(--white); display: grid; gap: 12px; justify-items: start;
}
.empty h3 { font-size: 1.125rem; }
.empty p { color: var(--muted); max-width: 60ch; }

/* ---------- CTA band (inner pages) ---------- */
.cta-band { border-top: 1px solid var(--line); padding: 56px 0; }
.cta-band-row { display: grid; gap: 20px; }
@media (min-width: 768px) { .cta-band-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; } }
.cta-band h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); max-width: 30ch; }
.cta-band p { color: var(--muted); margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 0.875rem; color: var(--muted); }
.footer-row { display: grid; gap: 20px; }
@media (min-width: 768px) { .footer-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; }
.footer-links a { color: var(--ink-2); display: inline-flex; min-height: 44px; align-items: center; }
.footer-legal { display: grid; gap: 4px; }

/* ---------- Error page ---------- */
.error-page { min-height: 60vh; display: grid; align-content: center; gap: 16px; padding: 64px 0; }
.error-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.error-page p { color: var(--muted); max-width: 52ch; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Writing (Medium posts) ---------- */
.post-list { list-style: none; border-top: 1px solid var(--line); }
.post-row { position: relative; display: grid; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-row-main { display: grid; gap: 8px; min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.post-row h3 { font-size: 1.1875rem; max-width: 60ch; }
.post-row h3 a { color: var(--ink); text-decoration: none; }
.post-row h3 a::after { content: ""; position: absolute; inset: 0; }
.post-row:hover h3 a { color: var(--brand); text-decoration: underline; }
.post-row p { color: var(--muted); font-size: 0.9375rem; max-width: 72ch; }
.post-thumb { display: none; }
@media (min-width: 768px) {
    .post-row:has(.post-thumb) { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; }
    .post-thumb { display: block; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
    .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
}
