/*
Theme Name: JahSing 3
Theme URI: https://jahsing.com/
Author: Eschateq Ltd.
Description: Launch site for the JahSing 3 cross-platform media player. Single-purpose theme skinned in the Kanata AI design system (stone palette, Inuksuk rounding, Sovereign Texture). Content lives in the page templates; pages are containers. Includes an optional WooCommerce storefront skin (active only when WooCommerce is) for the JahSing 3 Pro subscription.
Version: 1.5.2
Requires at least: 6.1
Tested up to: 6.7
Requires PHP: 7.4
License: © Eschateq Ltd. All rights reserved.
Text Domain: jahsing3
*/

/* =========================================================================
   Kanata AI design tokens  (source of truth: JahSing3 packages/design-tokens)
   ========================================================================= */
:root {
  --kanata-inuksuk-grey: #3d3d3d;
  --kanata-grey-700: #2a2a2a;
  --kanata-grey-500: #545454;
  --kanata-grey-300: #9a938a;
  --kanata-sovereign-red: #e23838;
  --kanata-red-pressed: #c92a2a;
  --kanata-tundra-cream: #f7f4ef;
  --kanata-cream-raised: #fffdf8;
  --kanata-border: #e4ddcc;

  --bg: var(--kanata-tundra-cream);
  --bg-raised: var(--kanata-cream-raised);
  --bg-sunken: #efe9dd;
  --bg-ink: #2a2a2a;
  --surface-border: var(--kanata-border);
  --text: var(--kanata-inuksuk-grey);
  --text-strong: var(--kanata-grey-700);
  --text-muted: #7c766c;
  --text-on-ink: #f2ede2;
  --text-on-ink-muted: #b3aa99;
  --accent: var(--kanata-sovereign-red);
  --accent-ink: #ffffff;
  --accent-hover: var(--kanata-red-pressed);
  --accent-soft: #fbeaea;
  --focus-ring: color-mix(in srgb, var(--accent) 55%, transparent);

  --state-thinking: #d9a441;
  --state-success: #3f9c5a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(42, 42, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(42, 42, 42, 0.12);
  --shadow-lg: 0 18px 48px rgba(42, 42, 42, 0.18);
  --shadow-xl: 0 40px 90px -20px rgba(42, 42, 42, 0.34);

  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1140px;
  --wrap-narrow: 820px;
  --header-h: 68px;

  /* Sovereign Texture — porous stone grain, generated, no asset. */
  --texture-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

:root:not([data-theme="light"]) {
  --scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #23211d;
    --bg-raised: #2c2a25;
    --bg-sunken: #1b1a16;
    --bg-ink: #1b1a16;
    --surface-border: #3c382f;
    --text: #ece7dc;
    --text-strong: #fdfaf2;
    --text-muted: #a49c8c;
    --text-on-ink: #f2ede2;
    --text-on-ink-muted: #a49c8c;
    --accent: #f0574f;
    --accent-hover: #ff6f66;
    --accent-soft: #3a2320;
    --kanata-tundra-cream: #23211d;
    --kanata-cream-raised: #2c2a25;
    --kanata-border: #3c382f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 40px 90px -20px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #23211d;
  --bg-raised: #2c2a25;
  --bg-sunken: #1b1a16;
  --bg-ink: #1b1a16;
  --surface-border: #3c382f;
  --text: #ece7dc;
  --text-strong: #fdfaf2;
  --text-muted: #a49c8c;
  --text-on-ink: #f2ede2;
  --text-on-ink-muted: #a49c8c;
  --accent: #f0574f;
  --accent-hover: #ff6f66;
  --accent-soft: #3a2320;
  --kanata-tundra-cream: #23211d;
  --kanata-cream-raised: #2c2a25;
  --kanata-border: #3c382f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 40px 90px -20px rgba(0, 0, 0, 0.7);
}

/* =========================================================================
   Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 3.9rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h3 { font-size: clamp(1.2rem, 2.1vw, 1.5rem); }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }
strong { color: var(--text-strong); font-weight: 650; }
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-sunken);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
kbd { box-shadow: inset 0 -2px 0 rgba(42, 42, 42, 0.12); }

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Layout helpers
   ========================================================================= */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap--narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(56px, 9vw, 104px); }
.section--tight { padding-block: clamp(40px, 6vw, 64px); }
.section--sunken { background: var(--bg-sunken); border-block: 1px solid var(--surface-border); }
.section--ink {
  background: var(--bg-ink);
  color: var(--text-on-ink);
  background-image: var(--texture-grain);
  background-blend-mode: overlay;
}
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }
.section--ink .eyebrow { color: #f7c9c6; }

.stone-surface {
  background-color: var(--bg-raised);
  background-image: var(--texture-grain);
  background-blend-mode: multiply;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}
.lede { font-size: clamp(1.05rem, 1.7vw, 1.28rem); color: var(--text-muted); max-width: 46ch; }
.section-head { max-width: 60ch; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --_bg: var(--bg-raised); --_fg: var(--text-strong); --_bd: var(--surface-border);
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 550; font-size: 1rem;
  padding: 13px 24px; border-radius: var(--radius-pill);
  background: var(--_bg); color: var(--_fg); border: 1.5px solid var(--_bd);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--_fg); }
.btn:active { transform: translateY(0); }
.btn--primary { --_bg: var(--accent); --_fg: var(--accent-ink); --_bd: var(--accent); }
.btn--primary:hover { --_bg: var(--accent-hover); --_bd: var(--accent-hover); }
.btn--ghost { --_bg: transparent; }
.btn--on-ink { --_bg: rgba(255,255,255,0.08); --_fg: #fff; --_bd: rgba(255,255,255,0.28); }
.btn--on-ink:hover { --_bg: rgba(255,255,255,0.16); }
.btn--lg { padding: 16px 30px; font-size: 1.08rem; }
.btn--sm { padding: 8px 16px; font-size: 0.9rem; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed; opacity: 0.6; transform: none; box-shadow: none;
  filter: grayscale(0.3);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em;
  text-transform: uppercase; font-weight: 600;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
.pill--muted { background: var(--bg-sunken); color: var(--text-muted); border-color: var(--surface-border); }
.pill--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.site-header.is-stuck { border-bottom-color: var(--surface-border); box-shadow: var(--shadow-sm); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-strong); }
.brand:hover { color: var(--text-strong); }
.brand svg, .brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav li { display: block; }
.nav a {
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem;
  color: var(--text); padding: 8px 12px; border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg-sunken); color: var(--text-strong); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

.header-tools { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: var(--bg-raised); border: 1.5px solid var(--surface-border); color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

.nav-toggle { display: none; }

/* The header row (brand + 6 links + Sign in + Register + Get JahSing 3 + toggles)
   needs ~1155px of .wrap; below ~1200px the links move into the ☰ drawer. */
@media (max-width: 1200px) {
  .nav-toggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border-radius: var(--radius-pill); background: var(--bg-raised);
    border: 1.5px solid var(--surface-border); color: var(--text); cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--surface-border);
    padding: 12px 24px 20px; box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 14px; font-size: 1.05rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero { position: relative; padding-block: clamp(52px, 8vw, 96px) clamp(40px, 6vw, 64px); overflow: hidden; }
/* Interior-page intros use `.section.hero` — a short centred lede, so drop the
   compounded top/bottom padding that stacks with the following section. */
.hero.section { padding-block: clamp(38px, 5vw, 58px) clamp(4px, 1.5vw, 12px); }
.hero.section + .section,
.hero.section + .section--sunken { padding-top: clamp(30px, 4vw, 48px); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 520px; z-index: -1;
  background:
    radial-gradient(60% 60% at 20% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(50% 50% at 90% 10%, color-mix(in srgb, var(--state-thinking) 12%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .lede { max-width: 40ch; margin-bottom: 28px; font-size: clamp(1.08rem, 1.9vw, 1.35rem); }
.hero-note { margin-top: 18px; font-size: 0.9rem; color: var(--text-muted); }
.hero-note kbd { font-size: 0.82em; }

.hero-shot { position: relative; }
.hero-shot .shot { transform: rotate(-1.1deg); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot { order: -1; max-width: 560px; }
}

/* =========================================================================
   Screenshot frame  ("stone window")
   ========================================================================= */
.shot {
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--bg-raised);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.shot__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: var(--bg-sunken); border-bottom: 1px solid var(--surface-border);
}
.shot__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--kanata-grey-300); opacity: 0.6; }
.shot__bar i:first-child { background: var(--accent); opacity: 0.85; }
.shot__bar span {
  margin-left: 8px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot img { width: 100%; display: block; }
.shot--plain { box-shadow: var(--shadow-lg); }
.shot--skin {
  display: grid; place-items: center;
  background: #14110f; border-color: #14110f;
  padding: clamp(16px, 3vw, 32px); box-shadow: var(--shadow-lg);
}
/* The skins are 574px sprites — let them fill the frame (crisp-blocky upscale
   is the right retro look) so they read at a usable size in the 2-up grids. */
.shot--skin img { width: 100%; max-width: 620px; margin-inline: auto; image-rendering: pixelated; border-radius: 4px; }
.shot--skin.shot--shade img { max-width: 460px; }

/* =========================================================================
   Feature rows
   ========================================================================= */
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.frow + .frow { margin-top: clamp(56px, 9vw, 112px); }
.frow:nth-child(even) .frow__media { order: -1; }
.frow__body h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 12px; }
.frow__body .formats {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; list-style: none; padding: 0;
}
.frow__body .formats li {
  font-family: var(--font-mono); font-size: 0.74rem; padding: 4px 10px;
  border: 1px solid var(--surface-border); border-radius: var(--radius-pill); color: var(--text-muted);
}
@media (max-width: 820px) {
  .frow { grid-template-columns: 1fr; gap: 22px; }
  .frow:nth-child(even) .frow__media { order: 0; }
}

/* =========================================================================
   Card grids
   ========================================================================= */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-raised); border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 24px;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s;
}
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border)); }
.card__icon {
  width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 14px;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.12rem; margin-bottom: 6px; }
.card p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* Inuksuk stat / marquee band */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.stat-band .n { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.4rem); color: #fff; }
.stat-band .k { font-size: 0.82rem; color: var(--text-on-ink-muted); letter-spacing: 0.03em; }
@media (max-width: 700px) { .stat-band { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; } }

.platform-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px;
  font-family: var(--font-display); font-weight: 500; color: var(--text-on-ink);
}
.platform-strip span { display: inline-flex; align-items: center; gap: 9px; }
.platform-strip svg { width: 22px; height: 22px; opacity: 0.9; }

/* =========================================================================
   Downloads
   ========================================================================= */
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .dl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dl-grid { grid-template-columns: 1fr; } }

.dl-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-raised); border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg); padding: 28px;
}
.dl-card.is-you { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dl-card__you {
  position: absolute; top: -11px; left: 24px; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--accent); color: #fff; padding: 3px 10px; border-radius: var(--radius-pill);
}
.dl-card__os { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dl-card__os svg { width: 30px; height: 30px; color: var(--text-strong); }
.dl-card__os h3 { margin: 0; font-size: 1.2rem; }
.dl-card__os small { display: block; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; }
.dl-card ul { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.dl-card li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--surface-border); font-size: 0.9rem;
}
.dl-card li:last-child { border-bottom: 0; }
.dl-card li span { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; }
.dl-card .btn { width: 100%; justify-content: center; }

.req-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.req-table th, .req-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--surface-border); vertical-align: top; }
.req-table th { font-family: var(--font-display); color: var(--text-strong); font-weight: 550; width: 160px; white-space: nowrap; }
.req-table td { color: var(--text-muted); }

.notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-md); padding: 18px 20px; color: var(--text-strong);
}
.notice svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 2px; }
.notice p { margin: 0; font-size: 0.95rem; }

/* stone-settling dots */
.dots { display: inline-flex; gap: 4px; align-items: flex-end; height: 12px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: settle 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes settle { 0%, 100% { transform: translateY(3px); opacity: 0.4; } 50% { transform: translateY(-3px); opacity: 1; } }

/* =========================================================================
   Prose (generic pages) + WP alignments
   ========================================================================= */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4em; }
.prose img { border-radius: var(--radius-md); border: 1px solid var(--surface-border); margin: 1.2rem 0; }
.prose blockquote {
  margin: 1.4rem 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--text-muted); font-style: italic;
}
.alignwide { width: min(1000px, 92vw); margin-inline: auto; }
.alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.aligncenter { margin-inline: auto; }

/* =========================================================================
   Auth — header links, sign-in modal, register form
   ========================================================================= */
.j3-auth-link {
  font-family: var(--font-display); font-weight: 550; font-size: 0.92rem;
  color: var(--text-muted); padding: 8px 6px; white-space: nowrap;
}
.j3-auth-link:hover { color: var(--text-strong); }

/* Signed-in name on the Account button — shrink + ellipsize so a long name
   can't re-break the header row. */
.j3-account-name {
  min-width: 0; max-width: 10ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

dialog.j3-auth:not([open]) { display: none; } /* pre-<dialog> browsers */
.j3-auth {
  width: min(420px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--surface-border); border-radius: var(--radius-md);
  background: var(--bg-raised); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.j3-auth::backdrop { background: rgba(20, 18, 15, 0.55); backdrop-filter: blur(3px); }
.j3-auth__panel { padding: 26px; }
.j3-auth__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.j3-auth__title { margin: 0; font-size: 1.28rem; }
.j3-auth__close {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1.5px solid var(--surface-border); border-radius: var(--radius-pill);
  background: var(--bg-raised); color: var(--text); cursor: pointer;
}
.j3-auth__close:hover { color: var(--accent); }
.j3-auth__close svg { width: 18px; height: 18px; }

.j3-auth__notices { margin-bottom: 16px; }
.j3-auth__alt { margin: 18px 0 0; font-size: 0.9rem; color: var(--text-muted); }

/* WooCommerce's own CSS is dequeued site-wide and the storefront sheet only
   loads on shop pages, so the login / register form fields are styled here. */
.j3-auth .woocommerce-form,
.j3-auth-form { margin: 0; }
.j3-auth .form-row,
.j3-auth-form .form-row { margin: 0 0 14px; display: block; }
.j3-auth label,
.j3-auth-form label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 550; font-size: 0.9rem; color: var(--text-strong);
}
.j3-auth input[type="text"],
.j3-auth input[type="email"],
.j3-auth input[type="password"],
.j3-auth-form input[type="text"],
.j3-auth-form input[type="email"],
.j3-auth-form input[type="password"] {
  width: 100%; box-sizing: border-box; padding: 11px 13px;
  font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--surface-border); border-radius: var(--radius-sm);
}
.j3-auth input:focus,
.j3-auth-form input:focus { outline: 3px solid var(--focus-ring); outline-offset: 1px; border-color: var(--accent); }
.j3-auth .woocommerce-form-login__rememberme,
.j3-auth-form .woocommerce-form-login__rememberme { font-family: var(--font-body); font-weight: 400; color: var(--text-muted); }
.j3-auth .woocommerce-form-login__rememberme input,
.j3-auth-form .woocommerce-form-login__rememberme input { width: auto; margin-right: 7px; accent-color: var(--accent); }
.j3-auth .required,
.j3-auth-form .required { color: var(--accent); border: 0; }

.j3-auth .woocommerce-button,
.j3-auth button[type="submit"],
.j3-auth-form button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  margin-top: 4px; padding: 12px 24px;
  font-family: var(--font-display); font-weight: 550; font-size: 1rem;
  color: var(--accent-ink); background: var(--accent);
  border: 1.5px solid var(--accent); border-radius: var(--radius-pill);
  cursor: pointer; transition: background 0.2s;
}
.j3-auth .woocommerce-button:hover,
.j3-auth button[type="submit"]:hover,
.j3-auth-form button[type="submit"]:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.j3-auth .woocommerce-button[disabled] { opacity: 0.6; cursor: not-allowed; }

.j3-auth .woocommerce-error,
.j3-auth-form ~ .woocommerce-error,
.woocommerce-message,
.j3-wc-notice {
  margin: 0 0 14px; padding: 12px 14px; list-style: none;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--surface-border));
  border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text-strong);
}
.j3-auth .woocommerce-error li { margin: 0; }

@media (max-width: 700px) {
  .j3-auth-link { padding: 8px 4px; }
}

/* =========================================================================
   Articles — byline, comment list, comment form (single.php / home.php)
   ========================================================================= */
.j3-article__byline { color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 20px; }

.j3-comments { margin-top: 48px; border-top: 1px solid var(--surface-border); padding-top: 32px; }
.j3-comments__list { list-style: none; margin: 0 0 32px; padding: 0; }
.j3-comments__list > li { margin-bottom: 20px; }
.j3-comments__list .comment-body {
  background: var(--bg-raised); border: 1px solid var(--surface-border);
  border-radius: var(--radius-md); padding: 18px 20px;
}
.j3-comments__list .comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.j3-comments__list .comment-author img { border-radius: 50%; }
.j3-comments__list .comment-author .fn { font-family: var(--font-display); font-weight: 550; font-style: normal; }
.j3-comments__list .comment-metadata { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.j3-comments__list .comment-metadata a { color: inherit; }
.j3-comments__list .comment-content p:last-child { margin-bottom: 0; }
.j3-comments__list .comment-awaiting-moderation { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

.j3-comment-form p { margin: 0 0 14px; }
.j3-comment-form label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 550; font-size: 0.9rem; color: var(--text-strong);
}
.j3-comment-form textarea,
.j3-comment-form input[type="text"],
.j3-comment-form input[type="email"],
.j3-comment-form input[type="url"] {
  width: 100%; box-sizing: border-box; padding: 11px 13px;
  font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--surface-border); border-radius: var(--radius-sm);
}
.j3-comment-form textarea:focus,
.j3-comment-form input:focus { outline: 3px solid var(--focus-ring); outline-offset: 1px; border-color: var(--accent); }
.j3-comment-form .logged-in-as { color: var(--text-muted); font-size: 0.9rem; }

.j3-comments__signin { margin-top: 4px; }
.j3-comments__signin .btn { margin-top: 10px; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--bg-ink); color: var(--text-on-ink);
  background-image: var(--texture-grain); background-blend-mode: overlay;
  padding-block: 56px 32px;
}
.site-footer a { color: var(--text-on-ink); }
.site-footer a:hover { color: #fff; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-brand { max-width: 30ch; }
.footer-brand .brand b { color: #fff; }
.footer-brand p { color: var(--text-on-ink-muted); font-size: 0.9rem; margin-top: 12px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.footer-cols h4 { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-on-ink-muted); margin-bottom: 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.94rem; }
.footer-legal {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 0.82rem; color: var(--text-on-ink-muted);
}

/* =========================================================================
   Utilities
   ========================================================================= */
.site-nav { display: contents; }
.frow__media:empty { display: none; }
@media (max-width: 700px) { .hide-sm { display: none !important; } }
@media (max-width: 1200px) {
  .site-header .wrap { gap: 12px; }
}

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================================
   Ads & consent
   ========================================================================= */
.ad-slot {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  margin: 40px auto 0; padding: 16px; max-width: 100%;
  border: 1px solid var(--surface-border); border-radius: var(--radius-md); background: var(--bg-sunken);
}
.ad-slot__label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.ad-slot .adsbygoogle { width: 100%; }

.j3-consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 640px; margin: 0 auto;
  background: var(--bg-raised); border: 1px solid var(--surface-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 16px 20px;
}
.j3-consent__inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.j3-consent p { margin: 0; font-size: 0.88rem; color: var(--text-strong); flex: 1 1 320px; }
.j3-consent__actions { display: flex; gap: 10px; flex: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
