/* App look (owner, Nov 17 2026: "make the website look like the app").
   Loaded last, after brand-refresh.css. Mirrors the Code 3 TCG app's calm
   futuristic theme (app: src/styles/app/19-holo-tech.css + 20-panel-fixes.css):
   - Near-black page with a faint 32 px grid in dark; warm cream in light.
     Follows the device setting, like the app (no switcher).
   - Chakra Petch headings and buttons, DM Sans body, normal-case labels.
   - Thin-edged panels (14 px), 12 px controls, clipped-corner feature panels.
   - Champagne-gold main action and fine gold line in dark; maroon in light.
   - No blue or teal.
   Remove this file's <link> from the pages to return to the maroon/purple
   brand-refresh look. The shared code3-tokens.css is not changed. */

:root {
  color-scheme: light dark;

  /* Light ("daylight") */
  --app-page: #F6F1EA;
  --app-surface: #FFFFFF;
  --app-surface-2: #F0E9E0;
  --app-text: #2A1418;
  --app-muted: #4F4340;
  --app-action: #7A0F1E;
  --app-action-hover: #8E1626;
  --app-on-action: #FFF8EC;
  --app-link: #7A0F1E;
  --app-border: #DFD3C6;
  --app-control: #927B65;
  --app-selected: #F3E4D3;
  --app-selected-ink: #7A0F1E;
  --app-edge: rgb(42 20 24 / 10%);
  --app-grid: rgb(42 20 24 / 2%);
  --app-panel: linear-gradient(180deg, #FFFFFF, #FBF7F1);
  --app-line: linear-gradient(90deg, #7A0F1E 0%, #A8822A 60%, rgb(168 130 42 / 0%) 100%);
  --app-button: #7A0F1E;
  --app-button-hover: #8E1626;
  --app-ghost: rgb(42 20 24 / 22%);
  --app-shadow: inset 0 1px 0 rgb(255 255 255 / 60%), 0 6px 18px rgb(42 20 24 / 7%);
  --app-danger: #9F1D2A;
  --app-scrim: rgb(28 23 27 / 55%);

  /* Brand-refresh variables, pointed at the app palette. */
  --web-page: var(--app-page);
  --web-surface: var(--app-surface);
  --web-surface-secondary: var(--app-surface-2);
  --web-header: var(--app-page);
  --web-footer: var(--app-page);
  --web-text: var(--app-text);
  --web-muted: var(--app-muted);
  --web-action: var(--app-action);
  --web-action-hover: var(--app-action-hover);
  --web-on-action: var(--app-on-action);
  --web-border: var(--app-border);
  --web-control-border: var(--app-control);
  --web-danger: var(--app-danger);
  --web-paper: var(--app-surface);
  --web-focus: var(--app-action);
  --web-on-brand: var(--app-text);
  --web-brand-muted: var(--app-muted);
  --web-brand-border: var(--app-edge);
  --web-hero-muted: var(--app-muted);
  --web-scrim: var(--app-scrim);
  --web-shadow: var(--app-shadow);
  --color-accent: var(--app-action);
  --color-display: var(--app-surface-2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --app-page: #0E0C10;
    --app-surface: #17141A;
    --app-surface-2: #1E1A22;
    --app-text: #F4EFE6;
    --app-muted: #CFC8CC;
    --app-action: #E8C86B;
    --app-action-hover: #F3D987;
    --app-on-action: #1A0F12;
    --app-link: #E3B07A;
    --app-border: #2F2A33;
    --app-control: #7A6788;
    --app-selected: #2B2530;
    --app-selected-ink: #F3D987;
    --app-edge: rgb(255 255 255 / 9%);
    --app-grid: rgb(255 255 255 / 1.6%);
    --app-panel: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 1.5%));
    --app-line: linear-gradient(90deg, #F3D987 0%, #C9A85A 60%, rgb(201 168 90 / 0%) 100%);
    --app-button: linear-gradient(135deg, #F3D987, #E7B657);
    --app-button-hover: linear-gradient(135deg, #FFE9A6, #F0C46A);
    --app-ghost: rgb(255 255 255 / 22%);
    --app-shadow: inset 0 1px 0 rgb(255 255 255 / 5%), 0 10px 28px rgb(0 0 0 / 38%);
    --app-danger: #F2A3A3;
    --app-scrim: rgb(0 0 0 / 62%);

    /* The shared tokens' own dark values, for anything that reads them directly. */
    --c3-page: #0E0C10; --c3-surface: #17141A; --c3-surface-secondary: #1E1A22;
    --c3-surface-inset: #121014; --c3-surface-elevated: #221E26;
    --c3-text: #F4EFE6; --c3-muted: #CFC8CC; --c3-action: #E8C86B; --c3-action-hover: #F3D987;
    --c3-on-action: #1A0F12; --c3-border: #2F2A33; --c3-control-border: #7A6788; --c3-focus: #E8C86B;
    --c3-purple: #D9B8F0; --c3-maroon: #F3D987;
  }
}

/* Page backdrop: faint grid, like the app. */
html { background: var(--app-page); }
body {
  color: var(--app-text);
  background:
    linear-gradient(var(--app-grid) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, var(--app-grid) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--app-page);
  background-attachment: fixed;
}
a { color: var(--app-link); }
body :is(button, a, input, select, summary, [tabindex]):focus-visible,
body :is(.site-header, .site-menu, .hero, footer) :focus-visible { outline-color: var(--app-action); }

/* Type */
h1, h2, h3 { color: var(--app-text); letter-spacing: -.01em; }
.hero h1::after, .page-intro h1::after, .page-heading::after {
  content: ""; display: block; width: 72px; height: 2px; margin-top: 16px; background: var(--app-line);
}
.eyebrow, .tool-number, .product-category, .step-number, .card-kicker, .category-icon,
.contact-card span, .sample-count, .sample-caption, .sample-status, .featured-tag,
.sample-badge, .membership-status, .membership-benefit-label {
  font-family: var(--c3-font-body); letter-spacing: 0; text-transform: none;
}
.eyebrow { color: var(--app-muted); font-size: 13.5px; font-weight: 600; }
.eyebrow::before, .hero .eyebrow::before { width: 22px; background: var(--app-line); }
.shelf-heading .eyebrow, .membership-intro .eyebrow, .membership-teaser .eyebrow { color: var(--app-muted); }

/* Header and footer: page-coloured glass with a thin edge, like the app bar. */
.site-header {
  background: color-mix(in srgb, var(--app-page) 76%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-top: 0; border-bottom: 1px solid var(--app-edge);
}
.nav-wrap { min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.site-header .brand, footer .brand { color: var(--app-text); }
.brand-mark { display: block; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; }
.brand-name { font: 600 20px/1.1 var(--c3-font-heading); letter-spacing: 0; color: var(--app-text); white-space: nowrap; }
.footer-brand .brand-mark { width: 40px; height: 40px; }
.nav { gap: 4px; padding: 4px; border: 1px solid var(--app-edge); border-radius: 14px; background: var(--app-surface); }
.nav a {
  position: relative; padding: 9px 14px; border-radius: 10px; color: var(--app-muted);
  font: 600 13.5px/1.4 var(--c3-font-heading); letter-spacing: .01em; text-decoration: none;
}
.nav a:hover { color: var(--app-text); background: var(--app-surface-2); text-decoration: none; }
.nav a[aria-current="page"] {
  color: var(--app-selected-ink); background: var(--app-selected);
  box-shadow: inset 0 0 0 1px var(--app-edge); text-decoration: none;
}
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 3px; height: 2px; border-radius: 2px; background: var(--app-line);
}
.nav-toggle, .menu-close { color: var(--app-text); background: var(--app-surface); border-color: var(--app-edge); border-radius: 12px; }
.site-menu { color: var(--app-text); background: var(--app-surface); border-color: var(--app-edge); color-scheme: light dark; }
.site-menu::backdrop { background: var(--app-scrim); }
.menu-heading { border-color: var(--app-edge); }
.menu-heading :is(h2, strong) { color: var(--app-text); }
.drawer-nav a { color: var(--app-text); font-family: var(--c3-font-heading); font-weight: 600; text-decoration: none; }
.drawer-nav a:hover { color: var(--app-text); background: var(--app-surface-2); }
.drawer-nav a[aria-current="page"], .drawer-nav a[aria-current="true"] {
  color: var(--app-selected-ink); background: var(--app-selected); box-shadow: inset 3px 0 0 var(--app-action); text-decoration: none;
}
footer { color: var(--app-text); background: transparent; border-top: 1px solid var(--app-edge); }
footer :is(a, p, small, strong) { color: var(--app-text); }
footer .footer-grid p { color: var(--app-muted); }
.footer-links a:hover { color: var(--app-action); }

/* Buttons: tech face, 12 px, gold (dark) / maroon (light) main action. */
.button, .filter-button, .text-button { font-family: var(--c3-font-heading); font-weight: 600; letter-spacing: .02em; }
.button, .hero .button {
  color: var(--app-on-action); background: var(--app-button); border: 1px solid transparent; border-radius: 12px;
}
.button:hover, .hero .button:hover { color: var(--app-on-action); background: var(--app-button-hover); border-color: transparent; text-decoration: none; }
.button-ghost, .button.button-ghost, .hero .button-ghost {
  color: var(--app-text); background: transparent; border-color: var(--app-ghost);
}
.button-ghost:hover, .button.button-ghost:hover, .hero .button-ghost:hover {
  color: var(--app-text); background: var(--app-surface-2); border-color: var(--app-action);
}
.filter-button { color: var(--app-muted); background: var(--app-surface); border-color: var(--app-edge); border-radius: 12px; }
.filter-button:hover { color: var(--app-text); border-color: var(--app-action); }
.filter-button[aria-pressed="true"] { color: var(--app-selected-ink); background: var(--app-selected); border-color: var(--app-action); font-weight: 700; }
.inline-link, .text-button, .featured-copy .inline-link, .product-details summary, .membership-compare > summary { color: var(--app-link); }

/* Hero: sits on the page like the app's Home header, no maroon/purple wash. */
.hero { color: var(--app-text); background: transparent; border-bottom: 1px solid var(--app-edge); }
.hero::after { display: none; }
.hero h1 { color: var(--app-text); }
.hero h1 span { color: var(--app-action); }
.hero .lead, .hero .eyebrow, .hero .trust-row, .hero-photo-note { color: var(--app-muted); }
.hero .trust-row { border-color: var(--app-edge); }
.trust-row span::before { color: var(--app-action); }

/* Featured displays: clipped corner and a fine gold top line, like the app's featured card. */
.hero-art, .shop-head .shop-notice, .origin-belief, .location-badge, .membership-panel, .visit-hours {
  position: relative;
  border: 1px solid var(--app-edge);
  border-radius: 14px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.hero-art { background: #1C171B; box-shadow: 0 10px 26px rgb(0 0 0 / 28%); }
.shop-head .shop-notice::before, .origin-belief::before, .membership-panel::before, .visit-hours::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--app-line);
}
.membership-panel { border-top: 1px solid var(--app-edge); }

/* Panels: thin edge, soft depth, 14 px. */
.collection-link, .category, .tool-card, .info-card, .origin-belief, .contact-card, .sample-product,
.featured-grid .featured-product, .home-entry-grid > a, .sample-browser, .shop-head .shop-notice,
.visit-location, .visit-hours, .location-badge, .shop-note, .release-controls, .membership-panel,
.membership-teaser, .membership-compare, .preview-notice, .product-preview-image, #bot-setup {
  color: var(--app-text);
  background: var(--app-panel), var(--app-surface);
  border-color: var(--app-edge);
  border-radius: 14px;
  box-shadow: var(--app-shadow);
}
.home-highlights, .featured-examples { background: transparent; border-color: var(--app-edge); }
.home-highlights .collection-link { background: var(--app-panel), var(--app-surface); }
.collection-link:hover, .sample-product:hover, .featured-product:hover, .home-entry-grid > a:hover {
  border-color: color-mix(in srgb, var(--app-action) 55%, transparent);
}
.home-entry-grid strong, .featured-copy h3, .sample-body h3 { color: var(--app-text); }
.entry-icon, .step-number { color: var(--app-action); }
.category-icon { color: var(--app-action); background: var(--app-surface-2); border-color: var(--app-edge); border-radius: 10px; }
.membership-teaser { border-left: 1px solid var(--app-edge); }
.featured-tag, .sample-badge { color: var(--app-text); background: var(--app-selected); border: 1px solid var(--app-edge); border-radius: 999px; }
.featured-photo, .sample-photo-wrap, .sample-media-photo { background: var(--app-surface-2); border-color: var(--app-edge); }
.origin-symbol span { color: var(--app-text); background: var(--app-surface-2); border-color: var(--app-edge); }
.origin-symbol span + span { color: var(--app-on-action); background: var(--app-action); border-color: var(--app-action); }
.tool-number, .page-intro, .trust-row, .sample-catalog, .sample-status, .faq-item, .product-facts,
.membership-benefit-list li, .membership-footnote, .membership-table :is(th, td) { border-color: var(--app-edge); }
.membership-intro :is(h1, h2), .membership-price strong { color: var(--app-action); }
.membership-table thead th { color: var(--app-text); background: var(--app-surface-2); }
.tool-card:nth-child(2), .contact-card { position: relative; overflow: hidden; border-top: 1px solid var(--app-edge); }
.tool-card:nth-child(2)::before, .contact-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--app-line);
}

/* Inputs: lit gold edge when focused. */
input, select, textarea, .sample-search input, #bot-url, .release-field :is(input, select) {
  color: var(--app-text); background: var(--app-surface); border-color: var(--app-control); border-radius: 10px;
}
:is(input, select, textarea):focus-visible {
  outline: 3px solid var(--app-action) !important; outline-offset: 3px;
  border-color: var(--app-action); box-shadow: none;
}
::placeholder { color: var(--app-muted); opacity: 1; }
#bot-setup::backdrop { background: var(--app-scrim); }

@media (max-width: 600px) {
  .nav-wrap { min-height: 68px; }
  .brand-name { font-size: 18px; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--app-page); }
}

/* Keep the collector worksheet readable when the device uses dark mode. */
@media print {
  body[data-page="/collecting"] {
    --app-text: #000; --app-muted: #222; --app-page: #fff;
    --web-text: #000; --web-muted: #222; --c3-success: #000;
    background: #fff; color: #000;
  }
  body[data-page="/collecting"] .page-intro h1::after { display: none; }
}
