/* ==========================================================================
   GalaBlock — Design system
   Biblioteca de familias Revit (.rfa)
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Neutrals (light theme) */
  --bg:            #f5f6f8;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #eceef2;
  --surface-hover: #f9fafb;
  --border:        #dcdfe6;
  --border-strong: #c2c7d0;

  /* Text */
  --text:          #14171c;
  --text-muted:    #5b626e;
  --text-faint:    #868d99;
  --text-inverse:  #ffffff;

  /* Brand */
  --brand:         #0b0d11;
  --brand-contrast:#ffffff;
  --accent:        #0f6fff;
  --accent-hover:  #0a5ad6;
  --accent-soft:   rgba(15, 111, 255, 0.10);
  --accent-text:   #0a53c4;

  /* Utility */
  --success:       #12855a;
  --success-soft:  rgba(18, 133, 90, 0.10);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 20, 28, .06), 0 1px 3px rgba(16, 20, 28, .05);
  --shadow-md: 0 2px 4px rgba(16, 20, 28, .05), 0 8px 20px rgba(16, 20, 28, .08);
  --shadow-lg: 0 4px 8px rgba(16, 20, 28, .06), 0 18px 44px rgba(16, 20, 28, .12);

  /* Geometry */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --header-h:  64px;
  --maxw:      1180px;
  --gutter:    clamp(16px, 4vw, 40px);

  /* Type */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: light;
}

/* Dark theme — auto, unless the visitor forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0c0e12;
    --bg-elevated:   #14171d;
    --bg-sunken:     #090a0d;
    --surface-hover: #1b1f27;
    --border:        #262b35;
    --border-strong: #39404d;

    --text:          #eef0f4;
    --text-muted:    #a3abb9;
    --text-faint:    #7a828f;
    --text-inverse:  #0c0e12;

    --brand:         #14171d;
    --brand-contrast:#eef0f4;
    --accent:        #4d94ff;
    --accent-hover:  #6ba6ff;
    --accent-soft:   rgba(77, 148, 255, 0.14);
    --accent-text:   #8dbaff;

    --success:       #35c58c;
    --success-soft:  rgba(53, 197, 140, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* Dark theme — explicitly chosen */
:root[data-theme="dark"] {
  --bg:            #0c0e12;
  --bg-elevated:   #14171d;
  --bg-sunken:     #090a0d;
  --surface-hover: #1b1f27;
  --border:        #262b35;
  --border-strong: #39404d;

  --text:          #eef0f4;
  --text-muted:    #a3abb9;
  --text-faint:    #7a828f;
  --text-inverse:  #0c0e12;

  --brand:         #14171d;
  --brand-contrast:#eef0f4;
  --accent:        #4d94ff;
  --accent-hover:  #6ba6ff;
  --accent-soft:   rgba(77, 148, 255, 0.14);
  --accent-text:   #8dbaff;

  --success:       #35c58c;
  --success-soft:  rgba(53, 197, 140, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* --- Layout helpers ----------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }

.section { padding-block: clamp(48px, 7vw, 88px); }
.section--tight { padding-block: clamp(32px, 4vw, 52px); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.section-head p { color: var(--text-muted); margin-top: 6px; max-width: 58ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -110%);
  z-index: 2000;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--brand) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--brand-contrast);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--brand); }
}

.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--brand-contrast);
  text-decoration: none;
  margin-right: auto;
  transition: opacity .18s var(--ease);
}
.brand:hover { opacity: .82; }
.brand__mark { width: 26px; height: 26px; flex: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--brand-contrast);
  opacity: .78;
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .18s var(--ease), opacity .18s var(--ease);
}
.site-nav a:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.site-nav a[aria-current="page"] {
  opacity: 1;
  background: rgba(255, 255, 255, .12);
  font-weight: 600;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand-contrast);
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.theme-toggle:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 38px; height: 38px; flex: none;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-contrast);
    cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--brand);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding: 8px var(--gutter) 14px;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 12px 14px; font-size: 1rem; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }

.btn--dark {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}
:root[data-theme="dark"] .btn--dark,
.btn--dark { }
.btn--dark:hover { background: color-mix(in srgb, var(--brand) 82%, var(--accent)); }

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--text-faint); }

.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: 1rem; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--border-strong) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--border-strong) 55%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 78% 12%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 78% 12%, #000 10%, transparent 72%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 96px);
}
.hero h1 {
  font-size: clamp(2.2rem, 6.2vw, 3.9rem);
  text-transform: uppercase;
  letter-spacing: -0.015em;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  display: block;
}
.hero__lead {
  margin-top: 18px;
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  color: var(--text-muted);
  max-width: 48ch;
}
.hero__actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__stats {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(22px, 5vw, 48px);
  list-style: none;
}
.hero__stats dt, .hero__stats .stat__label {
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero__stats .stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--text);
}
.hero__art {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-elevated);
  aspect-ratio: 16 / 10;
}
.hero__art picture { display: block; width: 100%; height: 100%; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; }
.hero__art figcaption {
  position: absolute;
  left: 12px; bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 12, 16, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; aspect-ratio: 16 / 9; }
}

/* --- Product grid ------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  overflow: hidden;
  text-decoration: none;
}
.card__media picture { display: block; width: 100%; height: 100%; }
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }

.card__badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(10, 12, 16, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.card__free {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 16px;
}
.card__title {
  font-size: 1.05rem;
  letter-spacing: 0;
}
.card__title a {
  color: var(--text);
  text-decoration: none;
}
.card__title a:hover { color: var(--accent-text); }
.card__desc {
  font-size: .88rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.card__actions {
  margin-top: auto;
  padding-top: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.card__actions .btn {
  min-width: 0;
  padding-inline: 12px;
  font-size: .88rem;
  overflow: hidden;
}
.card__actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Toolbar (search / filter / sort) ----------------------------------- */
.toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
@media (max-width: 680px) {
  .toolbar { grid-template-columns: 1fr; }
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 12px;
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .94rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search__clear {
  position: absolute;
  right: 8px;
  display: none;
  place-items: center;
  width: 24px; height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.search__clear:hover { background: var(--border); color: var(--text); }
.search[data-filled="true"] .search__clear { display: grid; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.field select {
  padding: 10px 32px 10px 12px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23868d99' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

.results-count {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.results-count strong { color: var(--text); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(40px, 8vw, 72px) 20px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-state h3 { font-size: 1.25rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 18px; }

/* --- Feature list ------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
  list-style: none;
}
.feature {
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.feature__icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature p { font-size: .9rem; color: var(--text-muted); }

/* --- Steps -------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(18px, 3vw, 32px);
  counter-reset: step;
  list-style: none;
}
.step { counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { font-size: .9rem; color: var(--text-muted); }

/* --- CTA band ----------------------------------------------------------- */
.cta {
  background: var(--brand);
  color: var(--brand-contrast);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
}
.cta h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.cta p {
  color: color-mix(in srgb, var(--brand-contrast) 74%, transparent);
  max-width: 54ch;
  margin: 0 auto 24px;
}

/* --- Product detail ----------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: .84rem;
  color: var(--text-faint);
  padding-block: 20px 0;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-text); text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.breadcrumb [aria-current="page"] { color: var(--text); }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  padding-block: clamp(24px, 4vw, 40px) clamp(40px, 6vw, 72px);
}
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
}

.detail__figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-md);
}
.detail__figure picture { display: block; }
.detail__figure img { width: 100%; height: auto; }

.detail__panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 860px) { .detail__panel { position: static; } }

.detail__panel h1 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin-bottom: 10px;
}
.detail__desc { color: var(--text-muted); margin-bottom: 20px; }

.spec-list {
  margin: 0 0 22px;
  border-top: 1px solid var(--border);
}
.spec-list > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.spec-list dt {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.spec-list dd { font-size: .92rem; font-weight: 500; text-align: right; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; list-style: none; }
.tag {
  display: inline-block;
  text-decoration: none;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-size: .76rem;
  color: var(--text-muted);
}

a.tag:hover { border-color: var(--accent); color: var(--accent-text); }

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  font-size: .84rem;
  color: var(--text-muted);
}
.notice svg { width: 17px; height: 17px; flex: none; color: var(--accent-text); margin-top: 3px; }

/* --- Ad slot ------------------------------------------------------------ */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-inline: auto;
  padding-block: 18px;
  min-height: 0;
}
.ad-slot > iframe, .ad-slot iframe { max-width: 100%; border: 0; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--brand);
  color: color-mix(in srgb, var(--brand-contrast) 76%, transparent);
  padding-block: clamp(36px, 5vw, 52px) 24px;
  border-top: 1px solid var(--border);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 32px;
  padding-bottom: 28px;
}
.site-footer h2 {
  font-size: 1.1rem;
  letter-spacing: .08em;
  color: var(--brand-contrast);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.site-footer h3 {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-contrast) 55%, transparent);
  margin-bottom: 12px;
}
.site-footer p { font-size: .9rem; max-width: 42ch; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a {
  color: color-mix(in srgb, var(--brand-contrast) 80%, transparent);
  font-size: .9rem;
  text-decoration: none;
}
.site-footer a:hover { color: var(--brand-contrast); text-decoration: underline; }
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: .82rem;
  color: color-mix(in srgb, var(--brand-contrast) 55%, transparent);
}

/* --- 404 ---------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(56px, 12vh, 120px) var(--gutter);
}
.error-page__code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.error-page h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-transform: uppercase;
  margin: 14px 0 10px;
}
.error-page p { color: var(--text-muted); max-width: 46ch; margin-bottom: 26px; }
.error-page__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* --- Reveal on scroll --------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  :root.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s var(--ease), transform .55s var(--ease);
  }
  :root.js .reveal.is-visible { opacity: 1; transform: none; }
}

/* --- Utilities / print -------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }

@media print {
  .site-header, .site-footer, .ad-slot, .toolbar, .chips, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .detail { grid-template-columns: 1fr; }
}
