/*
 * GardenHorizonsCodes.com — v2
 * Aesthetic: "The Garden Grimoire" — Botanical Encyclopedia × Gaming Guide
 * Fonts: Abril Fatface (H1 display) + Playfair Display (H2/H3) + System UI (body)
 * Mobile-first | Breakpoints: 640px, 1024px
 */

/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */
:root {
  /* — Palette — */
  --forest:         #1A3D2B;
  --forest-mid:     #2D6A4F;
  --forest-bright:  #40916C;
  --sage:           #74C69D;
  --mint:           #D1EDDA;
  --mint-pale:      #EBF8F0;

  --parchment:      #F2EDE0;
  --parchment-dark: #E4D9C5;
  --parchment-deep: #D5C9B0;
  --cream:          #FFFDF6;

  --earth:          #52300F;
  --earth-mid:      #7A4820;
  --earth-light:    #A8713A;

  --ink:            #1E110A;
  --body-text:      #2E1E10;
  --muted:          #6A5540;
  --muted-light:    #9A8070;

  --gold:           #C07B20;
  --gold-bright:    #E09A30;
  --gold-pale:      #FEF0D0;
  --gold-shine:     #F5C842;

  --active:         #155C2E;
  --active-pale:    #E2F5EA;
  --active-mid:     #52A870;
  --expired:        #7A1818;
  --expired-pale:   #FAEBEB;

  --border:         #CDBFA8;
  --border-dark:    #B5A38A;
  --border-light:   #E2D8C8;
  --surface:        #FFFFFF;

  /* — Typography — */
  --font-h1:      'Cinzel', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'SFMono-Regular', 'Consolas', 'Liberation Mono', Courier, monospace;

  /* — Spacing — */
  --s1:  0.25rem;
  --s2:  0.5rem;
  --s3:  0.75rem;
  --s4:  1rem;
  --s5:  1.25rem;
  --s6:  1.5rem;
  --s8:  2rem;
  --s10: 2.5rem;
  --s12: 3rem;
  --s16: 4rem;
  --s20: 5rem;

  /* — Radii — */
  --r1: 2px;
  --r2: 5px;
  --r3: 10px;
  --r4: 16px;
  --r5: 28px;

  /* — Shadows — */
  --e0: 0 1px 2px rgba(26,61,43,0.04);
  --e1: 0 2px 8px rgba(26,61,43,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --e2: 0 6px 20px rgba(26,61,43,0.11), 0 2px 6px rgba(0,0,0,0.06);
  --e3: 0 12px 40px rgba(26,61,43,0.14), 0 4px 12px rgba(0,0,0,0.08);
  --e4: 0 24px 60px rgba(26,61,43,0.18), 0 8px 20px rgba(0,0,0,0.10);

  /* — Motion — */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-xs:  100ms;
  --dur-sm:  160ms;
  --dur-md:  260ms;
  --dur-lg:  400ms;

  /* — Layout — */
  --max-w:   1140px;
  --sidebar: 300px;
  --nav-h:   60px;
}

/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--parchment);
  color: var(--body-text);
  line-height: 1.75;
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.018'/%3E%3C/svg%3E");
}

img, svg  { max-width: 100%; height: auto; display: block; }
picture   { display: block; }

a {
  color: var(--forest-mid);
  text-decoration: underline;
  text-decoration-color: rgba(116,198,157,0.5);
  text-underline-offset: 3px;
  transition: color var(--dur-sm) ease, text-decoration-color var(--dur-sm) ease;
}
a:hover { color: var(--forest); text-decoration-color: var(--sage); }

ul, ol   { padding-left: 1.4em; }
li       { margin-bottom: 0.35em; }
p        { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--parchment-dark);
  border: 1px solid var(--border-dark);
  border-bottom-width: 2px;
  border-radius: var(--r2);
  padding: 1px 7px;
  color: var(--earth);
}

/* ================================================================
   3. TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--forest);
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-h1);
  font-size: clamp(1.9rem, 4.8vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.02em; /* Cinzel reads best with slight positive tracking */
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.45rem, 3.8vw, 1.9rem);
  font-weight: 900;
  margin-top: var(--s12);
  margin-bottom: var(--s5);
  padding-left: var(--s5);
  border-left: 4px solid var(--gold);
  line-height: 1.25;
  position: relative;
}

/* Category label above h2 */
h2::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s1);
  opacity: 0.9;
}

/* h2 without data-label — fallback dot */
h2:not([data-label])::before { content: none; }

h3 {
  font-size: clamp(1.1rem, 2.8vw, 1.3rem);
  color: var(--earth);
  margin-top: var(--s8);
  margin-bottom: var(--s3);
  font-weight: 700;
}

h4 {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--earth-mid);
  margin-top: var(--s5);
  margin-bottom: var(--s2);
}

.lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 64ch;
}

.text-muted    { color: var(--muted); font-size: 0.9rem; }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.78rem;  }
.text-center   { text-align: center;  }
.text-mono     { font-family: var(--font-mono); }

/* ================================================================
   4. LAYOUT
   ================================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s4);
}

@media (min-width: 640px)  { .container { padding-inline: var(--s6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--s8); } }

.page-wrapper { display: block; }

@media (min-width: 1024px) {
  .page-wrapper {
    display: grid;
    grid-template-columns: 1fr var(--sidebar);
    gap: var(--s12);
    align-items: start;
  }
  .main-content { min-width: 0; }
  .sidebar {
    position: sticky;
    top: calc(var(--nav-h) + var(--s6));
    max-height: calc(100vh - var(--nav-h) - var(--s12));
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.main-content { padding-block: var(--s8); }
.section      { margin-bottom: var(--s12); }

/* ================================================================
   5. HEADER & NAVIGATION
   ================================================================ */
.site-header {
  background: var(--forest);
  position: sticky;
  top: 0;
  z-index: 300;
  box-shadow: 0 2px 24px rgba(0,0,0,0.28);
  border-top: 3px solid var(--gold);
  height: var(--nav-h);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 100%;
}

/* Logo */
.site-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  transition: opacity var(--dur-sm) ease;
}

.site-logo:hover { opacity: 0.85; color: #fff; text-decoration: none; }
.site-logo-icon  { color: var(--gold-bright); font-size: 1.25em; }
.site-logo span  { color: var(--gold-bright); }

/* Hamburger toggle */
.nav-toggle { display: none; }

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: var(--r3);
  transition: background var(--dur-sm) ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-toggle-label:hover { background: rgba(255,255,255,0.1); }

.nav-toggle-label em,
.nav-toggle-label em::before,
.nav-toggle-label em::after {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.88);
  border-radius: 2px;
  transition: transform var(--dur-md) var(--ease-out), opacity var(--dur-sm) ease;
  font-style: normal;
}

.nav-toggle-label em { position: relative; }
.nav-toggle-label em::before,
.nav-toggle-label em::after  { content: ''; position: absolute; left: 0; }
.nav-toggle-label em::before { top: -7px; }
.nav-toggle-label em::after  { top:  7px; }

.nav-toggle:checked ~ .site-header .nav-toggle-label em           { background: transparent; }
.nav-toggle:checked ~ .site-header .nav-toggle-label em::before   { transform: rotate(45deg)  translateY(7px);  }
.nav-toggle:checked ~ .site-header .nav-toggle-label em::after    { transform: rotate(-45deg) translateY(-7px); }

/* Nav drawer */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1A3D2B 0%, #152E20 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: var(--s3) var(--s4) var(--s5);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.nav-toggle:checked ~ .site-header .site-nav { display: block; }

.site-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: var(--s3) var(--s4);
  border-radius: var(--r3);
  font-family: var(--font-ui);
  font-size: 0.925rem;
  font-weight: 500;
  min-height: 48px; /* accessible touch target */
  transition: background var(--dur-sm) ease, color var(--dur-sm) ease;
}

.site-nav a:hover  { background: rgba(255,255,255,0.09); color: #fff; }
.site-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }

.site-nav a.nav-highlight {
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}
.site-nav a.nav-highlight:hover { background: var(--gold-bright); color: var(--ink); }

/* Nav SVG icons */
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--dur-sm) ease;
}
.site-nav a:hover .nav-icon,
.site-nav a.active .nav-icon { opacity: 1; }
.site-nav a.nav-highlight .nav-icon { opacity: 0.9; }

@media (min-width: 1024px) {
  .nav-toggle-label { display: none; }

  .site-nav {
    display: flex !important;
    position: static;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    align-items: center;
  }

  .site-nav ul {
    flex-direction: row;
    gap: 4px;
    align-items: center;
  }

  .site-nav a {
    padding: var(--s2) var(--s3);
    min-height: auto;
    font-size: 0.85rem;
    border-radius: var(--r2);
  }

  .nav-icon { width: 15px; height: 15px; }
}

/* ================================================================
   6. PAGE HERO
   ================================================================ */
.page-hero {
  background:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(64,145,108,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 50% 80% at 85% 10%, rgba(192,123,32,0.12) 0%, transparent 50%),
    linear-gradient(158deg, #111F17 0%, #1C4A2E 40%, #2D6A4F 80%, #204D37 100%);
  color: #fff;
  padding-top: calc(var(--s12) + var(--s4));
  padding-bottom: calc(var(--s10) + var(--s4));
  position: relative;
  overflow: hidden;
  /* NO animation on the section itself — translateY on the whole hero
     shifts it 20px down at t=0, causing main content to visually
     overlap the hero text on mobile. Children animate instead. */
}

/* Content always above decorative ::before / ::after pseudo-elements */
.page-hero .container {
  position: relative;
  z-index: 1;
  animation: heroFadeIn 0.5s var(--ease-out) both;
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Decorative botanical ornament */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' opacity='0.04'%3E%3Cpath fill='%23fff' d='M100 10 C60 10, 20 50, 20 100 C20 150, 60 190, 100 190 C140 190, 180 150, 180 100 C180 50, 140 10, 100 10 Z M100 30 C130 30, 160 60, 160 100 C160 140, 130 170, 100 170 C70 170, 40 140, 40 100 C40 60, 70 30, 100 30 Z'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1' d='M100 20 Q140 60 100 100 Q60 60 100 20 Z M100 180 Q140 140 100 100 Q60 140 100 180 Z M20 100 Q60 60 100 100 Q60 140 20 100 Z M180 100 Q140 60 100 100 Q140 140 180 100 Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right -20px center;
  background-size: 320px 320px;
  pointer-events: none;
}

/* Wave bottom */
.page-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--parchment);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 65% 0%, 35% 0%, 0 40%);
}

.page-hero h1 {
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.4);
  margin-bottom: var(--s3);
}

.page-hero .freshness-badge { }
.page-hero .text-muted      { }

.page-hero .text-muted {
  color: rgba(255,255,255,0.6);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  max-width: 56ch;
  line-height: 1.65;
}

.page-hero a { color: var(--sage); text-decoration-color: rgba(116,198,157,0.35); }
.page-hero a:hover { color: #fff; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   7. BREADCRUMB
   ================================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s5);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.38);
}

.breadcrumb a { color: rgba(255,255,255,0.48); text-decoration: none; transition: color var(--dur-sm) ease; }
.breadcrumb a:hover { color: rgba(255,255,255,0.85); }
.breadcrumb [aria-hidden] { opacity: 0.3; }

/* ================================================================
   8. FRESHNESS BADGE
   ================================================================ */
.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s5);
  margin-top: var(--s2);
}

.freshness-badge-live {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px var(--s3);
  border-radius: 999px;
  animation: livePulse 2.8s ease-in-out infinite;
}

.freshness-badge-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  animation: dotPulse 2.8s ease-in-out infinite;
}

.freshness-badge-date {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.52);
  letter-spacing: 0.02em;
}

@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.78; } }
@keyframes dotPulse  { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); opacity: 1; } }

/* ================================================================
   9. AD SLOTS
   ================================================================ */
.ad-slot {
  border-radius: var(--r3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--parchment-dark) 25%, var(--parchment-deep) 100%);
  border: 1px dashed var(--border-dark);
  position: relative;
}

.ad-slot::after {
  content: 'Advertisement';
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.ad-slot--leaderboard { min-height: 56px;  width: 100%; margin-block: var(--s6); }
.ad-slot--rectangle   { min-height: 250px; width: 100%; max-width: 336px; margin-block: var(--s6); margin-inline: auto; }
.ad-slot--sidebar     { display: none; min-height: 250px; width: 100%; }

@media (min-width: 1024px) {
  .ad-slot--leaderboard { min-height: 90px; }
  .ad-slot--sidebar     { display: flex; }
}

/* ================================================================
   10. SECTION BADGES
   ================================================================ */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 5px var(--s3);
  border-radius: 999px;
  margin-bottom: var(--s3);
}

.section-badge--active  { background: var(--active-pale);  color: var(--active);  border: 1px solid rgba(21,92,46,0.2); }
.section-badge--expired { background: var(--expired-pale); color: var(--expired); border: 1px solid rgba(122,24,24,0.2); }

.section-badge--active::before,
.section-badge--expired::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.section-badge--active::before  { background: var(--active);  box-shadow: 0 0 0 3px rgba(21,92,46,0.18); animation: pulse-badge 2s ease-in-out infinite; }
.section-badge--expired::before { background: var(--expired); }

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 3px rgba(21,92,46,0.18); }
  50%       { box-shadow: 0 0 0 5px rgba(21,92,46,0.06); }
}

/* ================================================================
   11. CODES TABLE — with mobile card layout
   ================================================================ */
.codes-table-wrapper {
  border-radius: var(--r4);
  overflow: hidden;
  box-shadow: var(--e2);
  border: 1px solid var(--border);
}

.codes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cream);
}

.codes-table thead { background: var(--forest); color: #fff; }

.codes-table th {
  padding: var(--s3) var(--s5);
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

.codes-table td {
  padding: var(--s3) var(--s5);
  vertical-align: middle;
  border-bottom: 1px solid var(--parchment-dark);
  font-size: 0.9rem;
}

.codes-table tbody tr:last-child td { border-bottom: none; }

.codes-table .row-active {
  background: linear-gradient(90deg, rgba(210, 242, 220, 0.65) 0%, var(--cream) 100%);
  border-left: 4px solid var(--active-mid);
}

.codes-table .row-expired {
  opacity: 0.5;
  background: var(--expired-pale);
  border-left: 4px solid rgba(122,24,24,0.35);
}

/* Code tag */
.codes-table .code-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--mint);
  border: 1px solid rgba(116,198,157,0.55);
  border-radius: var(--r2);
  padding: 4px var(--s3);
  letter-spacing: 0.07em;
  white-space: nowrap;
  display: inline-block;
}

.row-expired .code-text {
  text-decoration: line-through;
  color: var(--expired);
  background: var(--expired-pale);
  border-color: rgba(122,24,24,0.2);
}

.reward-text { color: var(--muted); font-size: 0.875rem; font-family: var(--font-ui); }

.reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-pale);
  color: var(--earth);
  border: 1px solid rgba(192,123,32,0.3);
  border-radius: 999px;
  padding: 3px var(--s3);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.reward-badge::before { content: '✦'; font-size: 0.5em; color: var(--gold-bright); }

/* ── Mobile: table → card layout ── */
@media (max-width: 639px) {
  .codes-table thead { display: none; }

  .codes-table tbody tr {
    display: block;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--r3);
    margin-bottom: var(--s3);
    overflow: hidden;
    box-shadow: var(--e1);
  }

  .codes-table tbody tr.row-active {
    border-left: 4px solid var(--active-mid);
    background: var(--active-pale);
  }

  .codes-table tbody tr.row-expired {
    border-left: 4px solid var(--expired);
    opacity: 0.6;
  }

  .codes-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--border-light);
    gap: var(--s3);
  }

  .codes-table td:last-child { border-bottom: none; }

  .codes-table td::before {
    content: attr(data-label);
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted-light);
    flex-shrink: 0;
    min-width: 60px;
  }
}

/* ================================================================
   12. COPY BUTTON
   ================================================================ */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--forest-mid);
  color: #fff;
  border: none;
  border-radius: var(--r3);
  padding: 7px var(--s4);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition:
    background  var(--dur-sm) ease,
    transform   var(--dur-md) var(--ease-bounce),
    box-shadow  var(--dur-sm) ease;
}

.btn-copy::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 130%, rgba(255,255,255,0.28), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-sm) ease;
}

.btn-copy:hover { background: var(--forest-bright); transform: translateY(-2px); box-shadow: 0 5px 16px rgba(45,106,79,0.45); }
.btn-copy:hover::after { opacity: 1; }
.btn-copy:active { transform: scale(0.94); box-shadow: none; }

.btn-copy.copied {
  background: var(--active);
  animation: copyPop var(--dur-lg) var(--ease-bounce);
}

@keyframes copyPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); }
  65%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.btn-copy:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ================================================================
   13. NO-CODES ALERT
   ================================================================ */
.no-codes-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-left: 5px solid var(--forest-mid);
  border-radius: var(--r4);
  padding: var(--s5) var(--s6);
  margin-bottom: var(--s8);
  box-shadow: var(--e2);
  position: relative;
}

.no-codes-alert::before {
  content: '📌';
  position: absolute;
  top: -13px;
  left: var(--s6);
  font-size: 1.3rem;
}

.no-codes-alert__icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }

.no-codes-alert__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--forest);
  margin-bottom: var(--s2);
  font-size: 1.05rem;
}

.no-codes-alert__text {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.68;
  margin: 0;
  font-family: var(--font-ui);
}

.no-codes-alert__text a { color: var(--forest-mid); font-weight: 700; }

/* ================================================================
   14. STEPS LIST
   ================================================================ */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: step-c;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-block: var(--s6);
}

.steps-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s5);
  align-items: start;
  counter-increment: step-c;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: var(--s5) var(--s6);
  box-shadow: var(--e1);
  transition:
    box-shadow  var(--dur-md) ease,
    transform   var(--dur-md) var(--ease-out),
    border-color var(--dur-sm) ease;
}

.steps-list li:hover {
  box-shadow: var(--e2);
  transform: translateX(5px);
  border-color: var(--sage);
}

.steps-list li::before {
  content: counter(step-c);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(26,61,43,0.4);
}

.step-content strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--forest);
  margin-bottom: var(--s2);
  font-size: 1.05rem;
}

.step-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.68;
  font-family: var(--font-ui);
}

/* ================================================================
   15. FAQ ACCORDION
   ================================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-block: var(--s6);
}

.faq-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  overflow: hidden;
  box-shadow: var(--e0);
  transition: box-shadow var(--dur-md) ease, border-color var(--dur-sm) ease;
}

.faq-item[open] { box-shadow: var(--e2); border-color: var(--border-dark); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  list-style: none;
  min-height: 60px;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-sm) ease, color var(--dur-sm) ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

/* Chevron */
.faq-item summary::after {
  content: '';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D6A4F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    center/16px no-repeat,
    rgba(209, 237, 218, 0.5);
  transition: transform var(--dur-md) var(--ease-out), background-color var(--dur-sm) ease;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
  background-color: rgba(45, 106, 79, 0.12);
}

.faq-item summary:hover    { background: var(--parchment); color: var(--forest); }
.faq-item[open] summary    { background: var(--mint-pale); color: var(--forest); border-bottom: 1px solid var(--border-light); }

.faq-answer {
  padding: var(--s5) var(--s5);
  font-size: 0.9rem;
  line-height: 1.78;
  color: var(--muted);
  animation: faqIn var(--dur-md) var(--ease-out) both;
  font-family: var(--font-ui);
}

.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a { color: var(--forest-mid); font-weight: 700; }

@keyframes faqIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ================================================================
   16. GUIDE CARDS
   ================================================================ */
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-block: var(--s6);
}

@media (min-width: 480px) {
  .guide-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s5); }
}

@media (min-width: 1024px) {
  .guide-grid { grid-template-columns: repeat(4, 1fr); }
}

.guide-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s3);
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--forest-mid);
  border-radius: var(--r4);
  padding: var(--s6) var(--s4) var(--s5);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--e1);
  position: relative;
  overflow: hidden;
  transition:
    box-shadow    var(--dur-md) var(--ease-out),
    transform     var(--dur-md) var(--ease-bounce),
    border-color  var(--dur-sm) ease,
    border-top-color var(--dur-sm) ease;
}

/* Corner fold */
.guide-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, transparent 50%, var(--parchment-dark) 50%);
}

.guide-card:hover {
  box-shadow: var(--e3);
  transform: translateY(-6px) rotate(0.5deg);
  border-color: var(--sage);
  border-top-color: var(--gold-bright);
  text-decoration: none;
  color: var(--ink);
}

/* Card icon area */
.guide-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--mint-pale) 0%, var(--mint) 100%);
  border: 1.5px solid rgba(116,198,157,0.4);
  border-radius: 50%;
  color: var(--forest-mid);
  flex-shrink: 0;
  transition: transform var(--dur-md) var(--ease-bounce), background var(--dur-sm) ease;
}

.guide-card__icon svg,
.guide-card__svg { width: 26px; height: 26px; }

.guide-card:hover .guide-card__icon {
  transform: scale(1.15) rotate(-5deg);
  background: linear-gradient(135deg, var(--mint) 0%, var(--sage) 100%);
}

.guide-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest);
  line-height: 1.2;
}

.guide-card__desc {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ================================================================
   17. TROUBLESHOOT CARDS
   ================================================================ */
.troubleshoot-grid {
  display: grid;
  gap: var(--s4);
  margin-block: var(--s6);
}

@media (min-width: 600px)  { .troubleshoot-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px)  { .troubleshoot-grid { grid-template-columns: repeat(3, 1fr); } }

.troubleshoot-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: var(--s5) var(--s5);
  box-shadow: var(--e1);
  position: relative;
  overflow: hidden;
}

.troubleshoot-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
}

.troubleshoot-card h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--earth);
  margin: 0 0 var(--s3) 0;
  background: var(--parchment-dark);
  padding: 4px var(--s3);
  border-radius: var(--r2);
  display: inline-block;
}

.troubleshoot-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.68;
  font-family: var(--font-ui);
}

/* ================================================================
   18. DATA TABLES (Seeds / Mutations)
   ================================================================ */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--r4);
  border: 1px solid var(--border);
  box-shadow: var(--e1);
  margin-block: var(--s6);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cream);
  font-size: 0.875rem;
  min-width: 500px; /* forces scroll on mobile */
}

.data-table thead { background: linear-gradient(135deg, var(--parchment-dark), var(--parchment-deep)); }

.data-table th {
  padding: var(--s3) var(--s5);
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--earth);
  border-bottom: 2px solid var(--border-dark);
  white-space: nowrap;
}

.data-table td {
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--parchment-dark);
  vertical-align: top;
  line-height: 1.55;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--parchment); }
.data-table tbody tr:hover { background: var(--gold-pale); }

/* Rarity badges */
.badge-rarity {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--s2);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.badge-rarity--common    { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-rarity--uncommon  { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.badge-rarity--rare      { background: #ede7f6; color: #6a1b9a; border: 1px solid #ce93d8; }
.badge-rarity--epic      { background: #fff3e0; color: #bf360c; border: 1px solid #ffcc80; }
.badge-rarity--legendary {
  background: var(--gold-pale);
  color: var(--earth);
  border: 1px solid var(--gold-bright);
  box-shadow: 0 0 8px rgba(224,154,48,0.25);
}

/* ================================================================
   19. INFO BOX
   ================================================================ */
.info-box {
  display: flex;
  gap: var(--s4);
  background: var(--mint-pale);
  border: 1.5px solid rgba(116,198,157,0.4);
  border-left: 4px solid var(--forest-mid);
  border-radius: var(--r3);
  padding: var(--s4) var(--s5);
  margin-block: var(--s6);
  font-size: 0.9rem;
  font-family: var(--font-ui);
  line-height: 1.68;
}

.info-box::before { content: '💡'; font-size: 1.2rem; flex-shrink: 0; }
.info-box strong  { color: var(--forest); font-weight: 800; }

/* ================================================================
   20. SIDEBAR WIDGETS
   ================================================================ */
.sidebar-widget {
  background: var(--cream);
  border: 1px solid var(--border);
  border-top: 4px solid var(--forest);
  border-radius: var(--r4);
  padding: var(--s5);
  margin-bottom: var(--s4);
  box-shadow: var(--e1);
}

.sidebar-widget h3 {
  font-size: 1rem;
  color: var(--forest);
  margin: 0 0 var(--s4) 0;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--parchment-dark);
}

.sidebar-widget p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  font-family: var(--font-ui);
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0;
}

.sidebar-widget ul li { margin-bottom: 0; }

.sidebar-widget ul li a {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 0.875rem;
  font-family: var(--font-ui);
  color: var(--forest-mid);
  padding: var(--s2) var(--s2);
  border-radius: var(--r2);
  text-decoration: none;
  min-height: 40px;
  transition: background var(--dur-sm) ease, color var(--dur-sm) ease;
}

.sidebar-widget ul li a::before { content: '→'; font-size: 0.7rem; color: var(--gold-bright); font-weight: 700; }
.sidebar-widget ul li a:hover   { background: var(--mint-pale); color: var(--forest); }

/* ================================================================
   21. CTA BLOCK
   ================================================================ */
.cta-block {
  background: linear-gradient(140deg, var(--forest) 0%, var(--forest-mid) 60%, #204D37 100%);
  border-radius: var(--r4);
  padding: var(--s12) var(--s8);
  text-align: center;
  color: #fff;
  margin-block: var(--s12);
  box-shadow: var(--e3);
  position: relative;
  overflow: hidden;
}

.cta-block::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192,123,32,0.12) 0%, transparent 70%);
  bottom: -80px;
  right: -60px;
  pointer-events: none;
}

.cta-block h2 {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  color: #fff;
  margin: 0 0 var(--s3) 0;
  border: none;
  padding: 0;
}

.cta-block h2::before { display: none; }

.cta-block p {
  color: rgba(255,255,255,0.68);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  margin-bottom: var(--s6);
  max-width: 46ch;
  margin-inline: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--gold-bright);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: var(--s3) var(--s10);
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(192,123,32,0.5);
  transition:
    background  var(--dur-sm) ease,
    transform   var(--dur-md) var(--ease-bounce),
    box-shadow  var(--dur-sm) ease;
}

.btn-primary:hover {
  background: var(--gold-shine);
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(192,123,32,0.6);
  text-decoration: none;
}

.btn-primary:active { transform: scale(0.97) translateY(0); }

/* ================================================================
   22. EXTERNAL BUTTONS
   ================================================================ */
.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-block: var(--s5);
}

.btn-external {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border: 2px solid currentColor;
  border-radius: var(--r3);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 40px;
  transition: background var(--dur-sm) ease, color var(--dur-sm) ease, transform var(--dur-sm) ease;
}

.btn-external:hover { transform: translateY(-2px); text-decoration: none; }
.btn-external--roblox  { color: #cc2929; }
.btn-external--roblox:hover  { background: #cc2929;  color: #fff; }
.btn-external--discord { color: #5865f2; }
.btn-external--discord:hover { background: #5865f2; color: #fff; }
.btn-external--twitter { color: #1d9bf0; }
.btn-external--twitter:hover { background: #1d9bf0; color: #fff; }

/* ================================================================
   23. ABOUT — Timeline
   ================================================================ */
.team-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: var(--s6);
  box-shadow: var(--e1);
  margin-bottom: var(--s5);
}

.update-timeline {
  position: relative;
  padding-left: var(--s8);
  margin-block: var(--s6);
}

.update-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--forest-mid), var(--sage));
  border-radius: 2px;
}

.timeline-item { position: relative; padding-bottom: var(--s6); }

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--s8) + 2px);
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--forest-mid);
  border: 3px solid var(--parchment);
  box-shadow: 0 0 0 2.5px var(--forest-mid);
}

.timeline-date {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--forest-mid);
  margin-bottom: var(--s1);
}

.timeline-desc { font-size: 0.9rem; color: var(--muted); margin: 0; line-height: 1.65; font-family: var(--font-ui); }

/* ================================================================
   24. FOOTER
   ================================================================ */
.site-footer {
  background: linear-gradient(180deg, #162B1E 0%, #0C1C13 100%);
  color: rgba(255,255,255,0.55);
  padding-block: var(--s16) var(--s10);
  margin-top: var(--s20);
  position: relative;
}

/* Top wave */
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--parchment);
  clip-path: polygon(0 0, 100% 0, 100% 0, 65% 100%, 35% 100%, 0 0);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  gap: var(--s8);
  margin-bottom: var(--s12);
}

@media (min-width: 600px)  { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px)  { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 0 0 var(--s4) 0;
  text-transform: none;
  letter-spacing: normal;
}

.footer-col p { color: rgba(255,255,255,0.4); line-height: 1.7; font-family: var(--font-ui); font-size: 0.875rem; }

.footer-col ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-bottom: 0;
}

.footer-col ul li { margin-bottom: 0; }

.footer-col ul a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 0.875rem;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 36px;
  transition: color var(--dur-sm) ease;
}

.footer-col ul a::before { content: '·'; opacity: 0.35; }
.footer-col ul a:hover   { color: rgba(255,255,255,0.88); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: var(--s6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p { margin: 0; color: rgba(255,255,255,0.25); font-size: 0.75rem; font-family: var(--font-ui); }

.footer-disclaimer {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--r3);
  padding: var(--s4) var(--s6);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  margin-top: var(--s8);
  line-height: 1.72;
}

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

.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--s2); }
.mb-md { margin-bottom: var(--s4); }
.mb-lg { margin-bottom: var(--s6); }
.mb-xl { margin-bottom: var(--s8); }

:focus-visible {
  outline: 2.5px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: var(--r2);
}

::selection { background: var(--mint); color: var(--forest); }

/* ================================================================
   25.5 MOBILE RESPONSIVENESS — comprehensive fixes
   ================================================================ */

/* ── ≤ 639px (phones) ──────────────────────────────────────── */
@media (max-width: 639px) {

  /* Hero: tighter vertical rhythm — padding-bottom min 64px to clear the 48px ::after wave */
  .page-hero {
    padding-top: var(--s10);
    padding-bottom: calc(var(--s8) + 48px);
  }

  /* H1: Cinzel positive letter-spacing can overflow on narrow screens */
  h1 { letter-spacing: 0; }

  /* H2: reduce top margin on mobile */
  h2 { margin-top: var(--s8); }

  /* Section spacing */
  .section      { margin-bottom: var(--s8); }
  .main-content { padding-block: var(--s6); }

  /* Freshness badge: allow wrapping on narrow screens */
  .freshness-badge {
    flex-wrap: wrap;
    gap: var(--s2);
  }

  /* Steps list: more compact */
  .steps-list li {
    padding: var(--s4) var(--s4);
    gap: var(--s3);
  }
  /* Disable translateX hover on touch (no hover intent) */
  .steps-list li:hover { transform: none; }

  /* Footer: reduce top margin and wave-padding */
  .site-footer {
    padding-block: var(--s10) var(--s8);
    margin-top: var(--s12);
  }

  /* CTA block: reduce padding */
  .cta-block { padding: var(--s8) var(--s4); }

  /* Guide card: reduce padding, disable lift hover on touch */
  .guide-card {
    padding: var(--s4) var(--s3) var(--s4);
    gap: var(--s2);
  }
  .guide-card:hover { transform: none; }

  /* FAQ: compact padding */
  .faq-item summary { padding: var(--s4); }
  .faq-answer       { padding: 0 var(--s4) var(--s4); }

  /* Troubleshoot cards: compact */
  .troubleshoot-card { padding: var(--s4); }

  /* Sidebar: on mobile appears below content — remove sticky, add border */
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    border-top: 2px solid var(--border);
    padding-top: var(--s6);
    margin-top: var(--s4);
  }

  /* Sidebar widgets: horizontal scroll row on mobile */
  .sidebar { display: flex; flex-direction: column; gap: var(--s4); }
  .sidebar-widget { padding: var(--s4); }

  /* Code text in cards: ensure mono doesn't overflow */
  .code-text {
    font-size: 0.85rem;
    word-break: break-all;
  }

  /* Codes table mobile card: copy button full width */
  .codes-table td:last-child {
    justify-content: flex-end;
    border-bottom: none;
    padding-top: var(--s2);
  }
  .btn-copy { width: 100%; justify-content: center; }

  /* Nav highlight (Codes link) on mobile */
  .site-nav a.nav-highlight { border-radius: var(--r2); }

  /* Page hero description */
  .page-hero .text-muted { max-width: 100%; font-size: 0.875rem; }
}

/* ── ≤ 479px (small phones) ───────────────────────────────── */
@media (max-width: 479px) {

  /* Guide grid: single column on very small screens */
  .guide-grid { grid-template-columns: 1fr !important; }

  /* Logo: smaller on tiny screens */
  .site-logo { font-size: 0.95rem; }

  /* H2 data-label: reduce font-size */
  h2::before { font-size: 0.52rem; letter-spacing: 0.14em; }

  /* Steps list: even tighter */
  .steps-list li {
    padding: var(--s3) var(--s3);
    gap: var(--s2);
  }
  .steps-list li::before {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.8rem;
  }

  /* Reduce h1 size floor */
  h1 { font-size: clamp(1.6rem, 7.5vw, 2.5rem); }

  /* Reduce h2 size floor */
  h2 { font-size: clamp(1.25rem, 5.5vw, 1.9rem); }

  /* Section badge: smaller */
  .section-badge { font-size: 0.58rem; padding: 4px var(--s2); }

  /* Breadcrumb: smaller */
  .breadcrumb { font-size: 0.78rem; }
}

/* ── ≤ 360px (compact phones: Galaxy S8, iPhone SE) ──────── */
@media (max-width: 360px) {

  /* Logo: abbreviate visual */
  .site-logo { font-size: 0.87rem; }
  .site-logo svg { width: 17px; height: 17px; }

  /* Container: tighter horizontal padding */
  .container { padding-inline: var(--s3); }

  /* Hero: min breathing room — keep bottom clear of wave */
  .page-hero {
    padding-top: var(--s8);
    padding-bottom: calc(var(--s6) + 48px);
  }

  /* Steps: minimal */
  .steps-list { gap: var(--s2); }
  .steps-list li { padding: var(--s3); gap: var(--s2); }

  /* Cards: even tighter */
  .guide-card { padding: var(--s3) var(--s2); }

  /* Reduce code card font */
  .code-text { font-size: 0.78rem; }
}

/* ================================================================
   26. PRINT
   ================================================================ */
@media print {
  .site-header, .site-footer, .ad-slot, .nav-toggle-label, .sidebar { display: none !important; }
  body          { background: #fff; color: #000; }
  .page-hero    { background: none !important; color: #000; padding: var(--s4) 0; }
  .page-hero h1 { color: #000; text-shadow: none; }
}
