@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap');

@layer reset, base, layout, components, motion;

/* ═══════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Taverns & Tales
═══════════════════════════════════════════════════════════════════════ */
:root {
  /* Color — dungeon dark + arcane gold */
  --bg:             #0e0c14;
  --surface:        #16121f;
  --surface-2:      #1e1828;
  --border:         rgba(201 168 76 / 0.12);
  --border-strong:  rgba(201 168 76 / 0.24);

  --text:           #f0eee8;
  --text-muted:     #a09880;
  --text-faint:     #7a7060;

  --accent:         #c9a84c;
  --accent-dim:     rgba(201 168 76 / 0.12);
  --accent-glow:    rgba(201 168 76 / 0.30);
  --crimson:        #9b2335;
  --crimson-dim:    rgba(155 35 53 / 0.12);

  /* Typography */
  --font:         system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Cinzel', Georgia, serif;
  --font-mono:    ui-monospace, 'Cascadia Code', monospace;

  /* Scale — fluid, no breakpoints needed */
  --text-sm:   clamp(0.8rem,  0.5vw + 0.65rem, 0.9rem);
  --text-base: clamp(1rem,    0.5vw + 0.85rem, 1.1rem);
  --text-lg:   clamp(1.1rem,  1vw   + 0.75rem, 1.35rem);
  --text-xl:   clamp(1.4rem,  2vw   + 0.75rem, 2rem);
  --text-2xl:  clamp(2rem,    4vw   + 0.5rem,  3.5rem);
  --text-hero: clamp(2.75rem, 6vw   + 1rem,    6rem);

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.75rem;
  --space-lg:  3rem;
  --space-xl:  5rem;
  --space-2xl: 8rem;

  /* Misc */
  --radius:    10px;
  --radius-lg: 18px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h:     64px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESET
═══════════════════════════════════════════════════════════════════════ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { color-scheme: dark; scroll-behavior: smooth; }
  img, svg { display: block; max-width: 100%; }
  button, input, textarea, select { font: inherit; }
  ul, ol { list-style: none; }
  a { color: inherit; text-decoration: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════════════ */
@layer base {
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-wrap: balance;
  }

  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-lg); }

  p { max-width: 60ch; }

  ::selection { background: var(--accent); color: #000; }

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

  [id] { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
}

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════════ */
@layer layout {

  .container {
    width: min(100%, 1100px);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 3rem);
  }

  /* ── NAV ─────────────────────────────────────────────── */
  .nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: clamp(1.25rem, 5vw, 3rem);
    background: rgba(14 12 20 / 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 0.6em;
    color: var(--accent);
  }

  .logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }

  .logo-wordmark {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-muted);
  }

  .nav-links a:not(.btn):hover { color: var(--accent); }

  .nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.3s var(--ease), opacity 0.2s;
  }

  .nav--open .nav-toggle span:first-child {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav--open .nav-toggle span:last-child {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  /* ── SECTION SHELL ───────────────────────────────────── */
  .section {
    padding-block: var(--space-2xl);
  }

  .section--alt { background: var(--surface); }

  .section-sub {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-block-start: var(--space-sm);
  }

}

/* ═══════════════════════════════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════════════════════════════ */
@layer components {

  /* ── BUTTONS ─────────────────────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.6em 1.4em;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-base);
    letter-spacing: 0.04em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
  }

  .btn--primary {
    background: var(--accent);
    color: #0e0c14;
  }
  .btn--primary:hover {
    background: color-mix(in srgb, var(--accent) 85%, #fff);
    box-shadow: 0 0 28px var(--accent-glow);
  }

  .btn--ghost {
    border-color: var(--border-strong);
    color: var(--text-muted);
  }
  .btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .btn--sm  { font-size: var(--text-sm); padding: 0.45em 1em; }
  .btn--lg  { font-size: var(--text-lg); padding: 0.7em 1.75em; }
  .btn--full { width: 100%; justify-content: center; }

  /* ── EYEBROW ─────────────────────────────────────────── */
  .eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-block-end: var(--space-sm);
  }

  /* ── HERO ────────────────────────────────────────────── */
  .hero {
    position: relative;
    padding-block-start: calc(var(--nav-h) + var(--space-2xl));
    padding-block-end: 0;
    overflow: hidden;
  }

  .hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(ellipse 80% 55% at 50% -10%, rgba(110 50 200 / 0.22), transparent 70%),
      radial-gradient(ellipse 50% 40% at 80% 70%, rgba(201 168 76 / 0.10), transparent 70%);
  }

  .hero-inner {
    position: relative;
    text-align: center;
    padding-block-end: var(--space-xl);
  }

  .hero-headline {
    font-size: var(--text-hero);
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(160deg, var(--text) 40%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-block: var(--space-sm) var(--space-md);
  }

  .hero-sub {
    font-size: var(--text-lg);
    color: var(--text-muted);
    max-width: 52ch;
    margin-inline: auto;
    margin-block-end: var(--space-lg);
  }

  .hero-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Stats bar */
  .stats-bar {
    border-top: 1px solid var(--border);
    margin-block-start: var(--space-xl);
    background: var(--surface);
  }

  .stats-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-block: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .stat { text-align: center; }

  .stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.03em;
  }

  .stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .stat-rule {
    width: 1px;
    height: 40px;
    background: var(--border-strong);
  }

  /* ── CARDS ───────────────────────────────────────────── */
  .card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-block-start: var(--space-xl);
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 32px rgba(0 0 0 / 0.4), 0 0 0 1px rgba(201 168 76 / 0.08);
  }

  .card-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
    margin-block-end: var(--space-md);
  }

  .card h3 { margin-block-end: var(--space-xs); }
  .card p  { color: var(--text-muted); font-size: var(--text-sm); }

  /* ── FEATURES ────────────────────────────────────────── */
  .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-block-start: var(--space-xl);
  }

  .feature {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: border-color 0.2s, transform 0.2s;
  }

  .feature:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
  }

  .feature-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
    margin-block-end: var(--space-md);
  }

  .feature h3 { margin-block-end: var(--space-xs); }
  .feature p  { color: var(--text-muted); font-size: var(--text-sm); }

  /* ── CTA BANNER ──────────────────────────────────────── */
  .cta-banner {
    text-align: center;
    padding-block: var(--space-2xl);
    background:
      radial-gradient(ellipse 70% 60% at 50% 50%, rgba(110 50 200 / 0.10), transparent 80%),
      var(--surface);
  }

  .cta-banner h2 { margin-block: var(--space-xs) var(--space-md); }

  .cta-banner .section-sub {
    margin-inline: auto;
    max-width: 48ch;
  }

  .cta-banner .hero-actions {
    margin-block-start: var(--space-lg);
  }

  /* ── STEPS ───────────────────────────────────────────── */
  .steps {
    position: relative;
    display: grid;
    gap: 0;
    margin-block-start: var(--space-xl);
  }

  .steps::before {
    content: '';
    position: absolute;
    inset-inline-start: 19px;
    inset-block: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  }

  .step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--space-md);
    padding-block: var(--space-lg);
    padding-inline-start: var(--space-xs);
  }

  .step + .step { border-top: 1px solid var(--border); }

  .step-num {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent);
    background: var(--bg);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
  }

  .step-body h3 { margin-block-end: var(--space-xs); }
  .step-body p  { color: var(--text-muted); }

  /* ── CONTACT / SIGNUP FORM ───────────────────────────── */
  .form-page {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    place-items: start center;
    padding-block: calc(var(--nav-h) + var(--space-2xl)) var(--space-2xl);
  }

  .form-card {
    width: min(100%, 560px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
  }

  .form-card h1 {
    font-size: var(--text-2xl);
    margin-block-end: var(--space-xs);
  }

  .form-card .subtitle {
    color: var(--text-muted);
    margin-block-end: var(--space-lg);
    max-width: none;
  }

  .event-details {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md);
    margin-block-end: var(--space-lg);
  }

  .event-details p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: none;
    line-height: 1.8;
  }

  .event-details strong { color: var(--accent); }

  .signup-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
  }

  .form-group label {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
  }

  .label-optional {
    font-family: var(--font);
    font-weight: 400;
    color: var(--text-faint);
    letter-spacing: 0;
  }

  .form-group input,
  .form-group textarea {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.65em 0.9em;
    color: var(--text);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
  }

  .form-group input::placeholder,
  .form-group textarea::placeholder { color: var(--text-faint); }

  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }

  /* Radio group */
  .radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
  }

  .radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75em 1em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
  }

  .radio-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim);
  }

  .radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-block-start: 0.2em;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
  }

  .radio-content {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    min-width: 0;
  }

  .radio-content strong {
    font-size: var(--text-sm);
    color: var(--text);
    display: block;
  }

  .radio-content span {
    font-size: var(--text-sm);
    color: var(--text-muted);
    display: block;
    word-break: break-word;
  }

  /* Char count */
  .char-count {
    font-size: var(--text-sm);
    color: var(--text-faint);
    text-align: right;
    margin-block-start: 0.25em;
    max-width: none;
  }

  /* Form status */
  .form-status {
    font-size: var(--text-sm);
    min-height: 1.5em;
    max-width: none;
  }
  .form-status--success { color: #4ade80; }
  .form-status--error   { color: #f87171; }

  /* Success state */
  .form-success {
    display: none;
    text-align: center;
    padding-block: var(--space-lg);
  }

  .form-success.visible { display: block; }

  .form-success-icon {
    width: 56px;
    height: 56px;
    color: var(--accent);
    margin-inline: auto;
    margin-block-end: var(--space-md);
  }

  .form-success h2 {
    font-size: var(--text-xl);
    margin-block-end: var(--space-sm);
  }

  .form-success p {
    color: var(--text-muted);
    margin-inline: auto;
  }

  /* CoC page */
  .prose-page {
    padding-block: calc(var(--nav-h) + var(--space-2xl)) var(--space-2xl);
  }

  .prose-page h1 {
    font-size: var(--text-2xl);
    margin-block-end: var(--space-sm);
  }

  .prose-page .page-intro {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-block-end: var(--space-xl);
    padding-block-end: var(--space-lg);
    border-bottom: 1px solid var(--border);
  }

  .prose-page h2 {
    font-size: var(--text-xl);
    margin-block: var(--space-xl) var(--space-sm);
  }

  .prose-page p {
    color: var(--text-muted);
    margin-block-end: var(--space-md);
  }

  .prose-page ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-block-end: var(--space-md);
  }

  .prose-page ul li {
    display: flex;
    gap: 0.75em;
    color: var(--text-muted);
    font-size: var(--text-base);
  }

  .prose-page ul li::before {
    content: '—';
    color: var(--accent);
    flex-shrink: 0;
  }

  .prose-draft-note {
    margin-block-start: var(--space-2xl);
    padding: var(--space-md);
    background: var(--crimson-dim);
    border: 1px solid rgba(155 35 53 / 0.3);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: none;
  }

  /* ── FOOTER ──────────────────────────────────────────── */
  .footer {
    border-top: 1px solid var(--border);
    padding-block: var(--space-xl) var(--space-lg);
  }

  .footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-block-end: var(--space-lg);
    padding-block-end: var(--space-lg);
    border-bottom: 1px solid var(--border);
  }

  .footer-wordmark {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-block-end: 0.25em;
    color: var(--accent);
  }

  .footer-tagline {
    font-size: var(--text-sm);
    color: var(--text-muted);
  }

  .footer-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  .footer-links a {
    font-size: var(--text-sm);
    color: var(--text-muted);
    transition: color 0.2s;
  }
  .footer-links a:hover { color: var(--accent); }

  .footer-base p {
    font-size: var(--text-sm);
    color: var(--text-faint);
    max-width: none;
  }

  /* ── VIDEO EMBED ─────────────────────────────────────────
     Responsive 16:9 wrapper for YouTube and Vimeo iframes.

     AI INTEGRATION NOTE:
     - Rewrite watch URLs to embed format. Strip tracking params.
     - YouTube: https://www.youtube.com/embed/VIDEO_ID
     - Vimeo:   https://player.vimeo.com/video/VIDEO_ID
     - CSP already permits frame-src for youtube.com and vimeo.com.
     - See <!-- SNIPPET: video-embed --> in index.html for the HTML pattern.
  ── */
  .video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
  }

  .video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
  }

  .video-embed-caption {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
    margin-block-start: var(--space-xs);
    max-width: none;
  }

  /* ── ANNOUNCEMENT BAR ────────────────────────────────────
     Full-width strip — first child of <body>, before <header>.

     AI INTEGRATION NOTE:
     - Replace text and optional <a> link with the client's message.
     - See <!-- SNIPPET: announce-bar --> in index.html.
  ── */
  .announce-bar {
    background: var(--accent);
    color: #000;
    text-align: center;
    padding: 0.65em var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.4;
  }

  .announce-bar a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
  }

  /* ── FAQ ACCORDION ───────────────────────────────────────
     Pure <details>/<summary> accordion. No JavaScript required.

     AI INTEGRATION NOTE:
     - Add or remove <details> blocks for each question.
     - See <!-- SNIPPET: faq --> in index.html.
  ── */
  .faq {
    margin-block-start: var(--space-xl);
    border-top: 1px solid var(--border);
  }

  .faq details {
    border-bottom: 1px solid var(--border);
  }

  .faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding-block: var(--space-md);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--text-base);
    color: var(--text);
    list-style: none;
    user-select: none;
  }

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

  .faq summary::after {
    content: '+';
    font-size: var(--text-xl);
    font-weight: 300;
    color: var(--accent);
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.2s var(--ease);
  }

  .faq details[open] summary::after { transform: rotate(45deg); }

  .faq-body {
    padding-block-end: var(--space-md);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.7;
  }

  /* ── TESTIMONIAL GRID ────────────────────────────────────
     Grid of player/member testimonials.

     AI INTEGRATION NOTE:
     - Fix spelling/grammar before inserting.
     - Name required; org optional — omit <span class="testimonial-org"> if none.
     - Append new <figure class="testimonial"> to .testimonial-grid to add.
     - See <!-- SNIPPET: testimonial-grid --> in index.html.
  ── */
  .testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-block-start: var(--space-xl);
  }

  .testimonial {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-md);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .testimonial:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 32px rgba(0 0 0 / 0.3);
  }

  .testimonial-quote {
    font-size: var(--text-base);
    color: var(--text-muted);
    line-height: 1.7;
    font-style: italic;
  }

  .testimonial-quote p::before {
    content: '\201C';
    color: var(--accent);
    font-weight: 700;
    margin-inline-end: 0.1em;
  }

  .testimonial-quote p::after {
    content: '\201D';
    color: var(--accent);
    font-weight: 700;
    margin-inline-start: 0.1em;
  }

  .testimonial-source {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    padding-block-start: var(--space-sm);
    border-top: 1px solid var(--border);
  }

  .testimonial-name {
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .testimonial-org {
    color: var(--text-faint);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
  }

  /* ── CALENDAR SUBSCRIBE ──────────────────────────────────
     Card prompting visitors to subscribe via webcal://.

     ⚠ CONVERSION-TIME SETUP — webcal:// URL must be obtained manually:
       1. In Calendar app: right-click calendar → Share → Public Calendar
       2. Copy the webcal:// link → paste as the href below.

     AI INTEGRATION NOTE:
     - Do not guess or construct the webcal:// URL.
     - Flag any URL update requests as a manual step.
     - See <!-- SNIPPET: cal-subscribe --> in index.html.
  ── */
  .cal-subscribe {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-block-start: var(--space-xl);
    flex-wrap: wrap;
  }

  .cal-subscribe-title {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    margin-block-end: var(--space-xs);
  }

  .cal-subscribe-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 48ch;
  }

  @media (max-width: 768px) {
    .cal-subscribe .btn { width: 100%; justify-content: center; }
  }

  /* ── SOCIAL STRIP ────────────────────────────────────────
     Row of icon links — no embeds, no tracking.

     AI INTEGRATION NOTE:
     - Each link has data-platform="name" for reliable identification.
     - To add: append <a class="social-link" data-platform="X"> with SVG icon.
     - To remove: find by data-platform and remove the <a>.
     - See <!-- SNIPPET: social-strip --> in index.html.
  ── */
  .social-strip {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
    margin-block-start: var(--space-xl);
  }

  .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
  }

  .social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface-2);
  }

  .social-link svg { width: 18px; height: 18px; }

  /* ── DOWNLOAD CARD ───────────────────────────────────────
     Styled download link for files in /files/.
     Cloudflare Pages limit: 25MB/file. Rename on update to bust cache.

     AI INTEGRATION NOTE:
     - To add: commit file to /files/, append <a class="download-card">.
     - To update: change href and .download-card-name. Remind client to rename.
     - See <!-- SNIPPET: download-card --> in index.html.
  ── */
  .download-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-block-start: var(--space-xl);
  }

  .download-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .download-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 16px rgba(0 0 0 / 0.2);
  }

  .download-card-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
    flex-shrink: 0;
  }

  .download-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15em;
  }

  .download-card-name { font-weight: 600; font-size: var(--text-base); }
  .download-card-meta { font-size: var(--text-sm); color: var(--text-muted); font-family: var(--font-mono); }

  .download-card-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
  }

  .download-card:hover .download-card-arrow {
    color: var(--accent);
    transform: translateY(2px);
  }

  /* ── MAP EMBED ───────────────────────────────────────────
     Responsive OpenStreetMap iframe wrapper. No API key.

     ⚠ CONVERSION-TIME SETUP:
       1. Go to openstreetmap.org → find location → Share → HTML → copy src URL.
       2. Paste as the iframe src below.

     AI INTEGRATION NOTE:
     - Do not guess the embed URL. Flag URL updates as a manual step.
     - CSP already permits frame-src for openstreetmap.org.
     - See <!-- SNIPPET: map-embed --> in index.html.
  ── */
  .map-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-block-start: var(--space-xl);
  }

  .map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
  }

  /* ── PHOTO GALLERY ───────────────────────────────────────
     Responsive auto-fit grid; 4:3 crop.

     AI INTEGRATION NOTE:
     - Replace src with client image paths. Provide meaningful alt text.
     - Images should be under 300KB each.
     - See <!-- SNIPPET: photo-gallery --> in index.html.
  ── */
  .photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-sm);
    margin-block-start: var(--space-xl);
  }

  .photo-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  }

  .photo-gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0 0 0 / 0.4);
  }

}

/* ═══════════════════════════════════════════════════════════════════════
   MOTION
═══════════════════════════════════════════════════════════════════════ */
@layer motion {

  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  }

  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  .card-grid.visible    .card:nth-child(2),
  .feature-grid.visible .feature:nth-child(2) { transition-delay: 0.1s; }

  .card-grid.visible    .card:nth-child(3),
  .feature-grid.visible .feature:nth-child(3) { transition-delay: 0.2s; }

  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  .nav-links {
    display: none;
    position: absolute;
    inset-block-start: var(--nav-h);
    inset-inline: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .nav--open .nav-links { display: flex; }
  .nav-toggle { display: flex; }

  .stat-rule { display: none; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .steps::before { display: none; }
  .step { grid-template-columns: 1fr; }

  .form-card { padding: var(--space-lg); }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
}
