/* ==========================================================================
   Austris Modern — base layer shared by every mode.
   Tokens live on :root as --am-*; a skin (assets/skins/*.css) or the shop
   mode (assets/css/shop.css) re-points them and adds its own character.
   Everything here is the "Terminal" direction's floor: near-black, mono,
   rainbow only in motion, prompts and ascii rules as the ornament.
   ========================================================================== */

/* ---- tokens ------------------------------------------------------------- */
:root {
  --am-bg:        #0a0a0b;
  --am-surface:   #121214;
  --am-text:      #e8e8ea;
  --am-text-dim:  #b4b4ba;
  --am-muted:     #8b8b91;
  --am-rule:      #1f1f23;
  --am-rule-hi:   #2a2a30;
  --am-accent:    #3bd1ff;
  --am-accent-2:  #ffe23b;

  --am-r1: #ff3b6b; --am-r2: #ff9b3b; --am-r3: #ffe23b;
  --am-r4: #3bff8e; --am-r5: #3bd1ff; --am-r6: #a23bff;
  --am-rainbow: linear-gradient(90deg, var(--am-r1) 0%, var(--am-r2) 18%, var(--am-r3) 36%, var(--am-r4) 54%, var(--am-r5) 72%, var(--am-r6) 90%, var(--am-r1) 100%);

  /* horn point cloud: base ink and highlight as r,g,b triplets */
  /* horn point cloud: bone with ultramarine under the cursor (the Stage direction's colours, kept for Terminal) */
  --am-horn-ink: 239, 233, 223;
  --am-horn-hi:  75, 99, 255;
  --am-horn-alpha: 1;

  --am-font-body:    var(--wp--preset--font-family--mono);
  --am-font-display: var(--wp--preset--font-family--mono);
  --am-font-label:   var(--wp--preset--font-family--mono);

  --am-content-w: 46rem;
  --am-mid-w:     64rem;
  --am-wide-w:    80rem;
  --am-radius:    2px;

  --am-dur:  var(--wp--custom--motion--base, 220ms);
  --am-ease: var(--wp--custom--motion--ease, cubic-bezier(0.2, 0.7, 0.2, 1));
}

/* Metric-matched fallbacks so the swap to the web font shifts nothing. */
@font-face { font-family: "JetBrains Mono Fallback"; src: local("DejaVu Sans Mono"), local("Menlo"), local("Consolas"), local("Liberation Mono"); size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: "Fraunces Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos"); size-adjust: 89.5%; ascent-override: 97.8%; descent-override: 25.5%; line-gap-override: 0%; }
@font-face { font-family: "DM Sans Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica"); size-adjust: 104.1%; ascent-override: 99.2%; descent-override: 31%; line-gap-override: 0%; }
@font-face { font-family: "Unbounded Fallback"; src: local("Arial Black"), local("Arial-BoldMT"), local("Liberation Sans Bold"); size-adjust: 128%; ascent-override: 95%; descent-override: 25%; line-gap-override: 0%; }

/* ---- base --------------------------------------------------------------- */
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--am-bg);
  color: var(--am-text);
  font-family: var(--am-font-body);
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}
.wp-site-blocks > * + * { margin-block-start: 0; }
h1, h2, h3, h4 { text-wrap: balance; font-family: var(--am-font-display); }
p, li, dd, figcaption { text-wrap: pretty; }
img { height: auto; max-width: 100%; }
::selection { background: var(--am-accent); color: #000; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--am-accent); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 600; color: var(--am-text); }

/* Very low-contrast scanlines: the terminal texture. Skins may remove it. */
body.am-skin-terminal::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}

.am-skiplink { position: absolute; left: -9999px; top: 0; }
.am-skiplink:focus { left: 1rem; top: 1rem; z-index: 200; padding: 0.5rem 0.75rem; background: var(--am-surface); border: 1px solid var(--am-rule-hi); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- layout ------------------------------------------------------------- */
.am-main { position: relative; z-index: 2; padding-block: 0 var(--wp--preset--spacing--8); }
.am-section { max-width: var(--am-content-w); margin-inline: auto; padding-block: 0; }
.am-section.am-lessons, .am-section.am-shop, .am-section.am-apps, .am-section.am-mission { max-width: var(--am-mid-w); }
.am-horn { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--am-horn-alpha); }

/* prompt glyphs — the symbols by the text */
.am-prompt { color: var(--am-accent-2); font-weight: 700; }
.am-eyebrow { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); margin: 0 0 0.75rem; letter-spacing: 0.02em; }
.am-eyebrow .am-prompt { margin-right: 0.35ch; }

/* ---- header ------------------------------------------------------------- */
.am-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--am-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--am-rule);
}
.am-header-inner {
  max-width: var(--am-wide-w); margin-inline: auto; width: 100%; box-sizing: border-box;
  display: flex; align-items: center; gap: 1.5rem; min-height: 3.75rem;
  padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
  position: relative;
}
.am-wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--am-font-label); font-weight: 500; font-size: 1rem; letter-spacing: -0.01em; margin-right: auto; min-height: 2.75rem; }
.am-mark { display: inline-flex; width: 1.6rem; height: 1.15rem; color: var(--am-text); }
.am-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.am-wordmark__sub { color: var(--am-muted); margin-left: 0.15ch; }
.am-caret-sm, .am-caret { display: inline-block; margin-left: 0.1ch; font-weight: 700; color: var(--am-r3); animation: am-rainbow-cycle 4s linear infinite, am-blink 1.1s steps(2) infinite; }
.am-caret { font-size: 0.9em; }

.am-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); }
.am-nav a { position: relative; color: var(--am-text-dim); padding-block: 0.6rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
.am-nav a:hover, .am-nav a[aria-current] { color: var(--am-text); }
.am-nav a::after { content: ""; position: absolute; inset: auto 0 0.35rem 0; height: 1px; background-image: var(--am-rainbow); background-size: 200% 100%; background-position: 100% 50%; transform: scaleX(0); transform-origin: left; transition: transform var(--am-dur) var(--am-ease), background-position 1.6s linear; }
.am-nav a:hover::after, .am-nav a:focus-visible::after, .am-nav a[aria-current]::after { transform: scaleX(1); background-position: 0% 50%; }
.am-nav__account { color: var(--am-muted); }
.am-nav-toggle { display: none; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.25rem; background: none; border: 0; color: inherit; font: inherit; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); cursor: pointer; }
.am-nav-toggle__bars { width: 1.1rem; height: 1px; background: currentColor; position: relative; box-shadow: 0 -0.35rem 0 currentColor, 0 0.35rem 0 currentColor; }

/* mini cart block → a text link with a count */
.am-cart { display: inline-flex; align-items: center; min-height: 2.75rem; }
.am-cart .wc-block-mini-cart { margin: 0; }
.am-cart .wc-block-mini-cart__button { background: transparent; border: 0; color: var(--am-text-dim); font: inherit; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); padding: 0; min-height: 2.75rem; display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.am-cart .wc-block-mini-cart__button:hover { color: var(--am-text); opacity: 1; }
.am-cart .wc-block-mini-cart__quantity-badge { position: static; display: inline-flex; align-items: center; gap: 0.35rem; }
.am-cart .wc-block-mini-cart__icon { width: 1.1rem; height: 1.1rem; }
.am-cart .wc-block-mini-cart__badge { position: static; transform: none; background: var(--am-accent); color: #000; border-radius: 999px; font-size: 0.7rem; min-width: 1.15rem; height: 1.15rem; line-height: 1.15rem; padding-inline: 0.3rem; font-family: var(--am-font-label); }
.am-cart .wc-block-mini-cart__badge:empty, .am-cart .wc-block-mini-cart__badge[aria-hidden="true"] { display: none; }

@media (max-width: 63.999rem) {
  .am-nav-toggle { display: inline-flex; }
  .js .am-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--wp--style--root--padding-left) 1rem; background: var(--am-bg); border-bottom: 1px solid var(--am-rule); }
  .js .am-nav.is-open { display: flex; }
  .am-nav a { min-height: 3rem; border-top: 1px solid var(--am-rule); }
  .am-nav a:first-child { border-top: 0; }
  .am-nav a::after { display: none; }
  .am-nav a::before { content: attr(data-n) "  "; color: var(--am-muted); font-size: 0.75rem; }
}

/* ---- hero --------------------------------------------------------------- */
.am-hero { padding-top: clamp(4rem, 10vh, 7rem); padding-bottom: 0; min-height: min(70svh, 40rem); display: flex; flex-direction: column; justify-content: center; }
.am-h1 { font-size: var(--wp--preset--font-size--xx-large); line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
.am-h1 .am-line { display: inline; }
.am-name { background-image: var(--am-rainbow); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: am-rainbow-pan 9s linear infinite; }
.am-lede { font-size: var(--wp--preset--font-size--large); line-height: 1.45; color: var(--am-text-dim); max-width: 34ch; margin: 0 0 1.5rem; }
.am-status { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1.75rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); color: var(--am-muted); }
.am-status-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--am-r4); box-shadow: 0 0 0 3px color-mix(in oklab, var(--am-r4) 25%, transparent); }
.am-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 0; align-items: center; }
.am-cta { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 0; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); color: var(--am-text); border-bottom: 1px solid var(--am-rule-hi); transition: border-color var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease); }
.am-cta:hover { border-color: var(--am-accent); color: var(--am-accent); }
.am-cta--primary { border: 1px solid var(--am-text); padding: 0.5rem 1.1rem; border-radius: var(--am-radius); }
.am-cta--primary:hover { background: var(--am-text); color: var(--am-bg); border-color: var(--am-text); }
.am-cta__meta { color: var(--am-muted); }
.am-cta--primary:hover .am-cta__meta { color: inherit; }

/* ---- section rule (ascii divider with a rainbow sweep) ------------------ */
.am-rule { position: relative; height: 1.5rem; margin: clamp(3rem, 8vw, 5.5rem) auto; padding: 0; border: 0; max-width: var(--am-mid-w); color: var(--am-muted); font-family: var(--am-font-label); overflow: hidden; }
.am-rule::before { content: "── " attr(data-label) " ──────────────────────────────────────────────────────────────────────────────────────────────────────"; display: block; white-space: nowrap; font-size: 0.8rem; letter-spacing: -0.02em; color: var(--am-rule-hi); }
.am-rule::after { content: ""; position: absolute; inset: auto 0 50% 0; height: 1px; background-image: var(--am-rainbow); background-size: 200% 100%; background-position: 100% 50%; transform: scaleX(0); transform-origin: left center; transition: transform 700ms var(--am-ease), background-position 4s linear; }
.am-rule.is-visible::after { transform: scaleX(0.6); background-position: 0% 50%; }
.am-rule-footer { margin-block: 3rem 1.25rem; max-width: var(--am-wide-w); }
.am-rule-footer::before { content: "──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"; }

/* ---- section titles ----------------------------------------------------- */
.am-section-title { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); text-transform: lowercase; color: var(--am-muted); margin: 0 0 1.25rem; font-weight: 500; letter-spacing: 0; }
.am-section-title::before { content: "# "; color: var(--am-r3); }
.am-section-lede { color: var(--am-text-dim); max-width: 60ch; margin: 0 0 1.75rem; }
.am-sub-title { display: flex; align-items: baseline; gap: 0.5rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--medium); font-weight: 500; margin: 0 0 1rem; text-transform: lowercase; }
.am-sub-title .am-prompt { color: var(--am-accent); }
.am-sub-more { margin-left: auto; font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); font-weight: 400; }
.am-sub-more:hover { color: var(--am-accent); }
.am-more { margin: 1.25rem 0 0; font-size: var(--wp--preset--font-size--small); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.am-more a { color: var(--am-text-dim); min-height: 2.5rem; display: inline-flex; align-items: center; }
.am-more a:hover { color: var(--am-accent); }

/* ---- panels (video, photos, media) -------------------------------------- */
.am-panel { border-radius: var(--am-radius); overflow: hidden; background: var(--am-surface); border: 1px solid var(--am-rule); }
.am-video-frame { margin: 0; }
.am-video-bezel { position: relative; aspect-ratio: 16 / 9; }
.am-video-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.am-video-caption { padding: 0.75rem 1rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); border-top: 1px solid var(--am-rule); }
.am-video-caption a { color: var(--am-text-dim); }
.am-video-caption a:hover { color: var(--am-accent); }

/* ---- tiles (lessons, apps) ---------------------------------------------- */
.am-tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--am-rule); border: 1px solid var(--am-rule); }
.am-tile-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 47.999rem) { .am-tile-grid, .am-tile-grid--3 { grid-template-columns: 1fr; } }
.am-tile { background: var(--am-bg); }
.am-tile-link { display: grid; grid-template-rows: auto auto 1fr auto; gap: 0.5rem; padding: 1.25rem; min-height: 12rem; position: relative; color: var(--am-text); isolation: isolate; height: 100%; }
.am-tile-link::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: hsl(var(--am-tile-hue, 0) 90% 60%); transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--am-ease); }
.am-tile-link:hover::before, .am-tile-link:focus-visible::before { transform: scaleX(1); }
.am-tile-link::after { content: ""; position: absolute; inset: 0; background: hsl(var(--am-tile-hue, 0) 80% 55% / 0); transition: background 320ms var(--am-ease); z-index: -1; }
.am-tile-link:hover::after, .am-tile-link:focus-visible::after { background: hsl(var(--am-tile-hue, 0) 80% 55% / 0.06); }
.am-tile-tag { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); letter-spacing: 0.04em; }
.am-tile-h { font-family: var(--am-font-display); font-weight: 500; font-size: 1.15rem; margin: 0; color: var(--am-text); }
.am-tile-p { font-size: var(--wp--preset--font-size--small); color: var(--am-text-dim); margin: 0; line-height: 1.55; }
.am-tile-arrow { align-self: end; color: var(--am-muted); transition: transform var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease); }
.am-tile-link:hover .am-tile-arrow, .am-tile-link:focus-visible .am-tile-arrow { transform: translateX(6px); color: hsl(var(--am-tile-hue, 0) 90% 65%); }

/* ---- products (the theme block) ----------------------------------------- */
.am-shop-group + .am-shop-group, .am-shop-row { margin-top: 2.5rem; }
.am-shop-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
@media (max-width: 47.999rem) { .am-shop-row { grid-template-columns: 1fr; } }
.am-products { list-style: none; margin: 0; padding: 0; }
.am-products--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--am-rule); border: 1px solid var(--am-rule); }
@media (max-width: 63.999rem) { .am-products--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .am-products--grid { grid-template-columns: 1fr; } }
.am-products--grid .am-product { background: var(--am-bg); }
.am-products--grid .am-product__link { display: grid; grid-template-rows: auto 1fr; height: 100%; color: var(--am-text); position: relative; isolation: isolate; }
.am-product__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--am-surface); }
.am-product__media img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.85); transition: transform 500ms var(--am-ease), filter 400ms ease; }
.am-product__link:hover .am-product__media img { transform: scale(1.03); filter: saturate(1); }
.am-product__body { display: grid; gap: 0.35rem; padding: 1rem 1.1rem 1.25rem; align-content: start; }
.am-product__tag { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); }
.am-product__title { font-size: var(--wp--preset--font-size--small); line-height: 1.4; color: var(--am-text); }
.am-product__price { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); color: var(--am-text-dim); font-variant-numeric: tabular-nums; }
.am-product__price del { color: var(--am-muted); margin-right: 0.4rem; }
.am-product__price ins { text-decoration: none; }
.am-products--grid .am-product__arrow { position: absolute; right: 1.1rem; bottom: 1.1rem; color: var(--am-muted); transition: transform var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease); }
.am-product__link:hover .am-product__arrow { transform: translateX(6px); color: var(--am-accent); }
.am-products--list .am-product { border-top: 1px dashed var(--am-rule); }
.am-products--list .am-product:last-child { border-bottom: 1px dashed var(--am-rule); }
.am-products--list .am-product__link { display: grid; grid-template-columns: 3rem 1fr auto; gap: 0.9rem; align-items: center; padding: 0.6rem 0; color: var(--am-text); }
.am-products--list .am-product__media { aspect-ratio: 1; width: 3rem; border-radius: var(--am-radius); }
.am-products--list .am-product__body { padding: 0; gap: 0.1rem; }
.am-products--list .am-product__tag { display: none; }
.am-products--list .am-product__arrow { color: var(--am-muted); transition: transform var(--am-dur) var(--am-ease), color var(--am-dur) var(--am-ease); }
.am-products--list .am-product__link:hover .am-product__title { color: var(--am-accent); }
.am-products-empty { color: var(--am-muted); font-size: var(--wp--preset--font-size--small); }

/* ---- research feed ------------------------------------------------------ */
.am-feed-query .am-feed-item { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: 0.65rem; border-bottom: 1px dashed var(--am-rule); margin: 0; }
.am-feed-query .am-feed-title { margin: 0; font-size: var(--wp--preset--font-size--medium); flex: 1; font-family: var(--am-font-body); font-weight: 400; }
.am-feed-query .am-feed-title a { color: var(--am-text); }
.am-feed-query .am-feed-title a:hover { background-image: var(--am-rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: am-rainbow-pan 6s linear infinite; }
.am-feed-date { color: var(--am-muted); font-size: var(--wp--preset--font-size--xs); white-space: nowrap; font-family: var(--am-font-label); }

/* ---- mission ------------------------------------------------------------ */
.am-mission-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2.5rem; align-items: start; }
@media (max-width: 47.999rem) { .am-mission-grid { grid-template-columns: 1fr; } }
.am-mission-photo { margin: 0; aspect-ratio: 3 / 4; }
.am-mission-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: saturate(0.85); }
.am-mission-text p { margin: 0 0 1rem; color: var(--am-text-dim); max-width: 60ch; }
.am-quote { font-family: var(--am-font-display); font-size: var(--wp--preset--font-size--large); line-height: 1.3; color: var(--am-text) !important; margin-bottom: 1.25rem !important; }
.am-quote::before { content: "> "; color: var(--am-r3); }

/* ---- contact ------------------------------------------------------------ */
.am-contact-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.4rem; font-size: var(--wp--preset--font-size--small); }
.am-contact-list li { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem; align-items: baseline; }
.am-contact-list .am-k { color: var(--am-muted); font-size: var(--wp--preset--font-size--xs); letter-spacing: 0.02em; font-family: var(--am-font-label); }
.am-contact-list a { color: var(--am-text); border-bottom: 1px solid var(--am-rule); }
.am-contact-list a:hover { border-bottom-color: var(--am-accent); color: var(--am-accent); }

/* ---- footer ------------------------------------------------------------- */
.am-footer { position: relative; z-index: 2; color: var(--am-muted); font-size: var(--wp--preset--font-size--xs); font-family: var(--am-font-label); }
.am-footer-inner { max-width: var(--am-wide-w); margin: 0 auto; padding: 0 var(--wp--style--root--padding-right) 3rem var(--wp--style--root--padding-left); display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 1.5rem; align-items: start; }
@media (max-width: 47.999rem) { .am-footer-inner { grid-template-columns: 1fr; } }
.am-footer-meta { margin: 0 0 0.5rem; color: var(--am-text-dim); }
.am-footer-meta .am-prompt { color: var(--am-r3); }
.am-footer-legal { margin: 0; line-height: 1.7; }
.am-footer-nav, .am-footer-social { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.am-footer a { min-height: 2.5rem; display: inline-flex; align-items: center; }
.am-footer a:hover { color: var(--am-text); }

/* ---- inner pages ------------------------------------------------------- */
.am-page { padding-top: clamp(2.5rem, 6vw, 4rem); }
.am-page__head { max-width: var(--am-content-w); margin: 0 auto 2rem; }
.am-page__title { font-size: var(--wp--preset--font-size--xx-large); line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.am-page__meta { color: var(--am-muted); font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); margin-bottom: 0.75rem; gap: 1rem; }
.am-page__meta a { color: var(--am-muted); }
.am-page__image { max-width: var(--am-content-w); margin: 0 auto 2rem; }
.am-page__image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; }
.am-prose { max-width: var(--am-content-w); margin-inline: auto; }
.am-prose > * { max-width: 65ch; }
.am-prose p, .am-prose li { color: var(--am-text-dim); overflow-wrap: anywhere; }
.am-prose h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.5rem; }
.am-prose h3 { font-size: var(--wp--preset--font-size--large); margin-top: 2rem; }
.am-prose h4 { margin-top: 1.5rem; }
.am-prose h2::before, .am-prose h3::before { content: "# "; color: var(--am-r3); font-family: var(--am-font-label); font-size: 0.6em; vertical-align: middle; }
.am-prose a { color: var(--am-text); border-bottom: 1px solid var(--am-rule-hi); }
.am-prose a:hover { color: var(--am-accent); border-color: var(--am-accent); }
.am-prose img { border-radius: var(--am-radius); margin-block: 1rem; }
.am-prose img[src$=".svg"] { width: 3.5rem; margin: 1.5rem 0 0; }
.am-prose ul { padding-left: 1.25rem; }
.am-prose li::marker { color: var(--am-accent); }
.am-prose blockquote { border-left: 2px solid var(--am-accent); padding-left: 1.25rem; margin: 1.5rem 0; font-style: italic; }
.am-prose table { border-collapse: collapse; width: 100%; font-size: var(--wp--preset--font-size--small); }
.am-prose th, .am-prose td { border-bottom: 1px solid var(--am-rule); padding: 0.5rem 0.75rem; text-align: left; font-variant-numeric: tabular-nums; }
.am-prose .am-cta-row { margin-block: 1.5rem; }
.am-prose .am-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1.5rem 0; border-top: 1px dashed var(--am-rule); max-width: none; }
.am-prose .am-app h2 { margin-top: 0; }
.am-prose .am-app-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); margin: 0; list-style: none; padding: 0; }
.am-prose .am-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--am-rule); border: 1px solid var(--am-rule); max-width: none; margin-block: 1.5rem; }
@media (max-width: 47.999rem) { .am-prose .am-levels { grid-template-columns: 1fr; } }
.am-prose .am-level { background: var(--am-bg); padding: 1.25rem; }
.am-prose .am-level h3 { margin: 0 0 0.5rem; font-size: var(--wp--preset--font-size--medium); }
.am-prose .am-level h3::before { content: none; }
.am-prose .am-level p { font-size: var(--wp--preset--font-size--small); margin: 0 0 0.75rem; }

.am-list-query .am-list { list-style: none; padding: 0; margin: 0; max-width: var(--am-content-w); margin-inline: auto; }
.am-list-item { padding: 1.25rem 0; border-top: 1px dashed var(--am-rule); }
.am-list-date { color: var(--am-muted); font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); margin-bottom: 0.35rem; }
.am-list-title { font-size: var(--wp--preset--font-size--large); margin: 0 0 0.5rem; }
.am-list-title a:hover { color: var(--am-accent); }
.am-list-excerpt p { color: var(--am-text-dim); margin: 0; }
.am-list-excerpt .wp-block-post-excerpt__more-text { margin-top: 0.5rem; font-size: var(--wp--preset--font-size--small); }
.am-pagination { max-width: var(--am-content-w); margin: 2rem auto 0; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); gap: 1rem; }
.am-post-nav { max-width: var(--am-content-w); margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px dashed var(--am-rule); font-size: var(--wp--preset--font-size--small); }
.am-post-nav a:hover { color: var(--am-accent); }
.am-search { max-width: var(--am-content-w); margin: 2rem auto 0; }
.am-search .wp-block-search__input { background: var(--am-surface); border: 1px solid var(--am-rule-hi); color: var(--am-text); font: inherit; padding: 0.6rem 0.8rem; border-radius: var(--am-radius); }
.am-search .wp-block-search__button { background: var(--am-text); color: var(--am-bg); border: 0; font: inherit; padding: 0.6rem 1rem; border-radius: var(--am-radius); cursor: pointer; }
.am-404 .am-hero { min-height: 50svh; }

/* ---- dev-only skin bar -------------------------------------------------- */
.am-skinbar { position: fixed; left: 50%; bottom: 0.75rem; transform: translateX(-50%); z-index: 300; display: flex; gap: 0.25rem; padding: 0.25rem; background: rgb(10 10 11 / 0.92); color: #e8e8ea; border: 1px solid rgb(232 232 234 / 0.18); border-radius: 999px; font: 500 0.75rem/1 'JetBrains Mono', ui-monospace, monospace; }
.am-skinbar a { color: inherit; padding: 0.625rem 0.75rem; min-height: 2rem; display: inline-flex; align-items: center; border-radius: 999px; }
.am-skinbar a[aria-current] { background: #e8e8ea; color: #0a0a0b; }
@media (max-width: 30rem) { .am-skinbar { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 1rem); border-radius: 1rem; } }

/* ---- reveal / stagger --------------------------------------------------- */
body .am-reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--am-ease), transform 500ms var(--am-ease); }
body .am-reveal.is-visible { opacity: 1; transform: none; }
.am-stagger .am-tile { opacity: 0; transform: translateY(10px); transition: opacity 500ms var(--am-ease), transform 500ms var(--am-ease); }
.am-stagger.is-visible .am-tile { opacity: 1; transform: none; }
.am-stagger.is-visible .am-tile:nth-child(1) { transition-delay: 60ms; }
.am-stagger.is-visible .am-tile:nth-child(2) { transition-delay: 140ms; }
.am-stagger.is-visible .am-tile:nth-child(3) { transition-delay: 220ms; }
.am-stagger.is-visible .am-tile:nth-child(4) { transition-delay: 300ms; }

/* ---- keyframes ---------------------------------------------------------- */
@keyframes am-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes am-rainbow-pan { to { background-position: -300% 50%; } }
@keyframes am-rainbow-cycle { 0% { color: var(--am-r1); } 16% { color: var(--am-r2); } 33% { color: var(--am-r3); } 50% { color: var(--am-r4); } 66% { color: var(--am-r5); } 83% { color: var(--am-r6); } 100% { color: var(--am-r1); } }

/* ---- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  body .am-reveal, .am-stagger .am-tile { opacity: 1; transform: none; }
  .am-rule::after { transform: scaleX(0.6); }
  .am-caret, .am-caret-sm { animation: none; color: var(--am-muted); }
  .am-name { animation: none; }
  body.am-skin-terminal::before { display: none; }
}

/* ---- editor sanity ------------------------------------------------------ */
.editor-styles-wrapper { background: var(--am-bg); color: var(--am-text); }

/* skin bar: compact on phones */
@media (max-width: 30rem) { .am-skinbar { left: 0.5rem; right: 0.5rem; transform: none; max-width: none; font-size: 0.6875rem; } .am-skinbar a { padding: 0.5rem 0.6rem; flex: 1; justify-content: center; } }

/* ---- video carousel (click-to-load facades, scroll-snap track) ---------- */
.am-video { max-width: var(--am-mid-w); }
.am-carousel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.am-carousel__controls { display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.am-carousel__btn { width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--am-text); border: 1px solid var(--am-rule-hi); border-radius: var(--am-radius); cursor: pointer; transition: border-color var(--am-dur) ease, color var(--am-dur) ease; }
.am-carousel__btn:hover { border-color: var(--am-accent); color: var(--am-accent); }
.am-carousel__btn[disabled] { opacity: 0.35; cursor: default; }
.am-carousel__count { font-family: var(--am-font-label); font-variant-numeric: tabular-nums; color: var(--am-muted); font-size: var(--wp--preset--font-size--small); min-width: 3.5rem; text-align: center; }
.am-carousel { margin-inline: calc(-1 * var(--wp--style--root--padding-left)) calc(-1 * var(--wp--style--root--padding-right)); }
.am-carousel__track { list-style: none; margin: 0; padding: 0 var(--wp--style--root--padding-left) 0.5rem; display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--wp--style--root--padding-left); scrollbar-width: none; }
.am-carousel__track::-webkit-scrollbar { display: none; }
.am-carousel__track:focus-visible { outline: 2px solid var(--am-accent); outline-offset: -2px; }
.am-carousel__slide { flex: 0 0 min(86vw, 36rem); scroll-snap-align: start; scroll-snap-stop: always; }
@media (prefers-reduced-motion: no-preference) { .am-carousel__track { scroll-behavior: smooth; } }
.am-facade { margin: 0; position: relative; }
.am-facade__frame { position: relative; aspect-ratio: 16 / 9; }
.am-facade__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.am-facade__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.75) brightness(0.9); transition: transform 400ms var(--am-ease), filter var(--am-dur) ease; }
.am-facade__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 3.75rem; height: 3.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--am-text); color: var(--am-bg); border: 0; cursor: pointer; box-shadow: 0 0 0 0.6rem color-mix(in oklab, var(--am-text) 14%, transparent); transition: background-color var(--am-dur) ease, box-shadow var(--am-dur) var(--am-ease); }
.am-facade__play svg { margin-left: 0.15rem; }
@media (hover: hover) and (pointer: fine) {
  .am-facade:hover .am-facade__play { background: var(--am-accent); box-shadow: 0 0 0 1rem color-mix(in oklab, var(--am-accent) 18%, transparent); }
  .am-facade:hover .am-facade__poster { transform: scale(1.02); filter: none; }
}
.am-facade__caption { display: grid; gap: 0.15rem; padding-top: 0.75rem; font-size: var(--wp--preset--font-size--small); color: var(--am-muted); }
.am-facade__caption strong { color: var(--am-text); font-weight: 500; }
.am-facade.is-loaded .am-facade__caption { color: var(--am-text-dim); }
.am-video-caption { margin: 1.25rem 0 0; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); }
.am-video-caption a { color: var(--am-text-dim); }
.am-video-caption a:hover { color: var(--am-accent); }
.am-carousel__slide.is-current .am-facade__poster { filter: none; }

/* ---- header cart: text + count instead of the WooCommerce icon ---------- */
.am-cart .wc-block-mini-cart__icon { display: none !important; }
.am-cart .wc-block-mini-cart__button::before { content: "cart"; }
.am-cart .wc-block-mini-cart__quantity-badge { position: static; display: inline; }
.am-cart .wc-block-mini-cart__badge { position: static !important; transform: none !important; display: inline !important; background: transparent !important; color: var(--am-accent) !important; border-radius: 0; font-size: inherit; min-width: 0; height: auto; line-height: inherit; padding: 0; margin-left: 0.15ch; }
.am-cart .wc-block-mini-cart__badge::before { content: "("; }
.am-cart .wc-block-mini-cart__badge::after { content: ")"; }
.am-cart .wc-block-mini-cart__badge[hidden] { display: none !important; }

/* ---- featured image on inner pages: the whole photo, never cropped ------ */
.am-page__image { background: transparent; border: 0; border-radius: 0; }
.am-page__image img { width: auto; max-width: 100%; max-height: 80vh; aspect-ratio: auto; object-fit: contain; margin-inline: auto; display: block; border-radius: var(--am-radius); border: 1px solid var(--am-rule); }

/* ---- contact form -------------------------------------------------------- */
.am-form { display: grid; gap: 1.25rem; max-width: var(--am-content-w); margin-block: 2rem; }
.am-form__hp { position: absolute !important; left: -200vw; top: 0; width: 1px; height: 1px; overflow: hidden; }
.am-form__grid { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .am-form__grid { grid-template-columns: 1fr 1fr; } .am-field--wide { grid-column: 1 / -1; } }
.am-field { display: grid; gap: 0.5rem; margin: 0; }
.am-field label { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); color: var(--am-muted); }
.am-field label::before { content: "$ "; color: var(--am-r3); }
.am-req { color: var(--am-accent); margin-left: 0.25em; }
.am-field input, .am-field select, .am-field textarea { width: 100%; box-sizing: border-box; font: inherit; color: var(--am-text); background: var(--am-surface); border: 1px solid var(--am-rule-hi); border-radius: var(--am-radius); padding: 0.75rem 1rem; min-height: 3rem; transition: border-color var(--am-dur) ease; }
.am-field select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
.am-field textarea { resize: vertical; min-height: 9rem; }
.am-field input:focus-visible, .am-field select:focus-visible, .am-field textarea:focus-visible { border-color: var(--am-accent); outline-offset: 2px; }
.am-field [aria-invalid="true"] { border-color: var(--am-r1); }
.am-field__error { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-r1); }
.am-field__error:empty { display: none; }
.am-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.am-form__actions .am-cta { cursor: pointer; font: inherit; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--small); background: transparent; }
.am-form__actions .am-cta[disabled] { opacity: 0.6; cursor: progress; }
.am-form__privacy { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); max-width: 32ch; }
.am-form__status p { margin: 0; padding: 0.875rem 1rem; border-left: 3px solid; font-size: var(--wp--preset--font-size--small); }
.am-form__status .is-success { border-color: var(--am-r4); background: color-mix(in oklab, var(--am-r4) 12%, transparent); }
.am-form__status .is-error { border-color: var(--am-r1); background: color-mix(in oklab, var(--am-r1) 12%, transparent); }

/* ---- language switcher (next to the cart) ------------------------------ */
.am-lang { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); letter-spacing: 0.06em; min-height: 2.75rem; }
.am-lang__item { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75rem; min-height: 2.75rem; color: var(--am-muted); }
.am-lang__item.is-current { color: var(--am-text); }
.am-lang a.am-lang__item:hover { color: var(--am-accent); }
.am-lang__sep { color: var(--am-rule-hi); }
/* the cart label follows the language (data-label is set by the nav block) */
.am-cart .wc-block-mini-cart__button[data-label]::before { content: attr(data-label); }

/* phones: short cart label, tighter header row */
@media (max-width: 47.999rem) {
  .am-header-inner { gap: 0.75rem; }
  .am-cart .wc-block-mini-cart__button[data-label-short]::before { content: attr(data-label-short); }
  .am-lang { gap: 0.15rem; }
  .am-lang__item { min-width: 1.5rem; }
  .am-wordmark { font-size: 0.9375rem; gap: 0.4rem; }
}
@media (max-width: 24rem) { .am-wordmark__sub { display: none; } }

/* WooCommerce hides the mini-cart on the cart and checkout pages: drop the empty cell */
.am-cart:not(:has(.wc-block-mini-cart)) { display: none; }

/* ---- phones: the home page's product groups swipe as a carousel (the home is a summary, not a shop) ---- */
@media (max-width: 47.999rem) {
  .am-page-home .am-shop-group { position: relative; }
  .am-page-home .am-products--grid { display: flex; grid-template-columns: none; gap: 0.75rem; border: 0; background: transparent; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--wp--style--root--padding-left); padding: 0 var(--wp--style--root--padding-left) 0.5rem; margin-inline: calc(-1 * var(--wp--style--root--padding-left)) calc(-1 * var(--wp--style--root--padding-right)); scrollbar-width: none; }
  .am-page-home .am-products--grid::-webkit-scrollbar { display: none; }
  .am-page-home .am-products--grid .am-product { flex: 0 0 72vw; scroll-snap-align: start; border: 1px solid var(--am-rule); }
  .am-page-home .am-shop-row { gap: 2rem; }
  .am-page-home .am-sub-title .am-sub-more { font-size: 0.75rem; }
}

/* ---- FAQ (details/summary) ---------------------------------------------- */
.am-faq { margin: 2rem 0 0; max-width: 65ch; }
.am-faq__item { border-top: 1px solid var(--am-rule); padding: 0.25rem 0; }
.am-faq__item:last-child { border-bottom: 1px solid var(--am-rule); }
.am-faq__item summary { cursor: pointer; padding: 0.75rem 0; font-weight: 500; list-style: none; display: flex; gap: 0.75rem; align-items: baseline; color: var(--am-text); }
.am-faq__item summary::-webkit-details-marker { display: none; }
.am-faq__item summary::before { content: "›"; color: var(--am-accent); transition: transform var(--am-dur) var(--am-ease); }
.am-faq__item[open] summary::before { transform: rotate(90deg); }
.am-faq__a { padding: 0 0 1rem 1.4rem; color: var(--am-text-dim); }
.am-faq__a p { margin: 0 0 0.75rem; }
/* local landing pages */
.am-prose .am-local-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1px; background: var(--am-rule); border: 1px solid var(--am-rule); max-width: none; margin: 1.5rem 0; }
.am-prose .am-local-facts > div { background: var(--am-bg); padding: 1rem 1.25rem; }
.am-prose .am-local-facts dt { font-family: var(--am-font-label); font-size: var(--wp--preset--font-size--xs); color: var(--am-muted); letter-spacing: 0.04em; margin: 0 0 0.25rem; }
.am-prose .am-local-facts dd { margin: 0; color: var(--am-text); }
.am-prose .am-map { aspect-ratio: 16 / 9; border: 1px solid var(--am-rule); max-width: none; margin: 1.5rem 0; background: var(--am-surface); }
.am-prose .am-map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(1) invert(0.92) contrast(0.9); }
