/* Design tokens and components from The Matts workshop site (wmgmm.github.io/thematts). */
:root {
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --link: #0066cc; /* darker than --apple-blue so links pass 4.5:1 on grey and tinted cards */
    --apple-text-primary: #1d1d1f;
    --apple-text-secondary: #6e6e73;
    --apple-text-tertiary: #86868b;
    --apple-bg-page: #f5f5f7;
    --apple-bg-card: #ffffff;
    --apple-bg-subtle: #fbfbfd;
    --apple-border: #e5e5ea;
    --apple-border-light: rgba(0, 0, 0, 0.06);
    --accent-orange: #ff8a1f;
    --accent-purple: #5e5ce6;
    --accent-green: #34c759;
    --radius-card: 22px;
    --radius-medium: 14px;
    --radius-button: 980px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.08);
    --font-stack: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --hero-mesh-base: #0b1220;
    --border-soft: #e5e7eb;
    --transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-stack); background-color: var(--apple-bg-page); color: var(--apple-text-primary); margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.47; letter-spacing: -0.022em; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 22px 40px; }
h1 { font-size: 48px; line-height: 1.05; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 14px; }
.subtitle { font-size: 12px; line-height: 1.4; font-weight: 500; color: var(--apple-text-secondary); text-transform: uppercase; letter-spacing: 0.18em; margin: 0; }
h2 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
h3 { font-size: 22px; font-weight: 600; margin: 28px 0 12px; }
h4 { font-size: 15px; font-weight: 600; color: var(--apple-blue); margin: 20px 0 8px 0; }
p, li { font-size: 15px; }
a { color: var(--link); }
.muted { color: var(--apple-text-secondary); font-size: 13px; }

/* Nav */
.global-nav { position: sticky; top: 0; z-index: 9999; background-color: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--apple-border-light); height: 52px; display: flex; align-items: center; justify-content: center; }
.nav-content { display: flex; gap: 32px; align-items: center; overflow-x: auto; padding: 0 16px; }
.nav-brand { font-size: 13px; font-weight: 600; color: var(--apple-text-primary); letter-spacing: -0.01em; white-space: nowrap; }
.global-nav a { color: var(--apple-text-primary); text-decoration: none; font-size: 13px; font-weight: 400; opacity: 0.75; transition: opacity 0.2s ease, color 0.2s ease; white-space: nowrap; }
.global-nav a:hover { opacity: 1; color: var(--apple-blue); }

/* Hero */
header.hero { text-align: center; padding: 64px 0 40px; }
header.hero .lede { max-width: 640px; margin: 18px auto 0; color: var(--apple-text-secondary); font-size: 17px; }
.activity-hero { display: block; padding: 4px; border-radius: var(--radius-card); text-decoration: none; color: white; background: var(--hero-mesh-base); box-shadow: var(--shadow-card); transition: var(--transition); position: relative; overflow: hidden; isolation: isolate; margin-bottom: 24px; }
.activity-hero::before { content: ''; position: absolute; inset: 0; background:
    radial-gradient(circle at 18% 22%, rgba(56, 189, 248, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(99, 102, 241, 0.50) 0%, transparent 46%),
    radial-gradient(circle at 70% 88%, rgba(139, 92, 246, 0.42) 0%, transparent 48%),
    radial-gradient(circle at 8% 90%, rgba(14, 165, 233, 0.35) 0%, transparent 50%);
    pointer-events: none; z-index: 0; }
.activity-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(11, 18, 32, 0.10) 0%, rgba(11, 18, 32, 0.45) 100%); pointer-events: none; z-index: 0; }
a.activity-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.hero-glass { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; padding: 18px 22px; border-radius: calc(var(--radius-card) - 4px); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.hero-content { flex: 1; min-width: 0; }
.hero-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; color: #BAE6FD; display: block; }
.hero-title { font-size: 18px; font-weight: 600; line-height: 1.2; margin: 4px 0; color: white; letter-spacing: -0.015em; }
.hero-desc { font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, 0.72); margin: 0; }
.hero-cta { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; padding: 9px 18px; background: var(--apple-blue); color: #ffffff; border-radius: var(--radius-button); white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35); flex-shrink: 0; }

/* Sections and cards */
.section-card { background: var(--apple-bg-card); border-radius: var(--radius-card); padding: 36px 40px; margin-bottom: 24px; box-shadow: var(--shadow-card); scroll-margin-top: 64px; }
.section-header { margin-bottom: 20px; }
.section-header p { margin: 6px 0 0; color: var(--apple-text-secondary); font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--apple-blue); margin-bottom: 8px; }
.inner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.inner-card { background: var(--apple-bg-page); padding: 20px; border-radius: 12px; min-width: 0; }
.inner-card-icon { font-size: 26px; margin-bottom: 8px; display: block; }
.inner-card strong { font-size: 14px; display: block; margin-bottom: 4px; }
.inner-card p, .inner-card li { font-size: 13px; color: var(--apple-text-secondary); margin: 0; line-height: 1.45; }
.quick-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.quick-step { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--apple-bg-subtle); border-radius: var(--radius-medium); border: 1px solid var(--apple-border-light); font-size: 14px; line-height: 1.4; }
.step-badge { background-color: var(--apple-text-primary); color: white; border-radius: 50%; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.exercise-note { font-size: 14px; color: var(--apple-text-secondary); margin-bottom: 14px; line-height: 1.5; }
.exercise-note strong { color: var(--apple-text-primary); }

/* Callouts */
.callout { background: #f0f7ff; border: 1px solid #cce5ff; border-left: 4px solid var(--apple-blue); padding: 14px 16px; border-radius: 8px; margin: 12px 0; }
.callout strong { display: block; margin-bottom: 6px; color: #0056b3; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.callout-body { color: #2c3e50; line-height: 1.5; font-size: 14px; }
.callout.governance { background: #f4f3ff; border-color: #dcdaff; border-left-color: var(--accent-purple); }
.callout.governance strong { color: #3f3cb8; }

/* Code and prompts */
.prompt-box, pre.code { background-color: #ffffff; padding: 16px 18px; border-radius: var(--radius-medium); font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: #2c2c2e; margin: 12px 0 14px 0; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border-soft); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
pre.code { position: relative; white-space: pre; overflow-x: auto; background: #fbfbfd; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--apple-bg-page); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; font-size: inherit; }
.code-wrap { position: relative; }
.btn-copy { position: absolute; top: 8px; right: 8px; background-color: var(--apple-blue); color: white; font-size: 12px; padding: 5px 12px; border-radius: var(--radius-button); border: none; cursor: pointer; font-weight: 600; transition: var(--transition); font-family: inherit; box-shadow: 0 2px 6px rgba(0, 113, 227, 0.22); }
.btn-copy:hover { background-color: var(--apple-blue-hover); }
.btn-copy.success { background-color: var(--accent-green); }

/* Tabs */
.tab-bar { display: flex; gap: 28px; padding: 8px 0 0; margin: 8px 0 20px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; overflow-y: hidden; }
.tab-btn { position: relative; padding: 12px 0; border: none; background: transparent; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--apple-text-secondary); cursor: pointer; white-space: nowrap; }
.tab-btn.active { color: var(--apple-text-primary); font-weight: 600; }
.tab-btn.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--apple-blue); border-radius: 2px 2px 0 0; }
.tab-btn:focus-visible, .tab-panel:focus-visible, summary:focus-visible, .btn-copy:focus-visible, a:focus-visible { outline: 2px solid var(--apple-blue); outline-offset: 2px; border-radius: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Accordions */
details { border-bottom: 1px solid var(--apple-border); }
details:last-of-type { border-bottom: none; }
summary { padding: 16px 12px; margin: 0 -12px; border-radius: 10px; cursor: pointer; font-size: 17px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary:hover { background-color: var(--apple-bg-page); color: var(--apple-blue); }
summary::-webkit-details-marker { display: none; }
summary::after { content: 'Open \2192'; font-size: 12px; font-weight: 700; color: white; background: #424245; padding: 6px 14px; border-radius: var(--radius-button); flex-shrink: 0; white-space: nowrap; }
details[open] summary::after { content: 'Close'; background: #d2d2d7; color: var(--apple-text-primary); }
details[open] summary { color: var(--apple-blue); }
.ex-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; color: var(--apple-text-secondary); font-size: 12px; font-weight: 600; border: 1px solid var(--border-soft); border-radius: 999px; margin-right: 14px; flex-shrink: 0; }
details[open] .ex-num { color: var(--apple-blue); border-color: var(--apple-blue); }
summary > span:not(.ex-num) { flex: 1; }
.details-content { padding: 0 0 24px 42px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--apple-text-secondary); font-weight: 600; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--apple-border); }
td { padding: 10px; border-bottom: 1px solid var(--apple-border-light); vertical-align: top; }
tbody th { color: var(--apple-text-primary); font-weight: 400; font-size: 14px; border-bottom: 1px solid var(--apple-border-light); padding: 10px; vertical-align: top; }
table.compact td, table.compact th { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
table.compact tbody th { white-space: normal; min-width: 160px; }

/* Footer */
footer { text-align: center; padding: 32px 0 24px; color: var(--apple-text-secondary); font-size: 12px; }
footer a { color: var(--apple-text-secondary); }

@media (max-width: 734px) {
    .section-card { padding: 24px 18px; }
    .details-content { padding-left: 0; }
}
@media (max-width: 600px) {
    h1 { font-size: 32px; letter-spacing: -0.02em; }
    h2 { font-size: 24px; }
    header.hero { padding: 40px 0 28px; }
    .container { padding: 16px 16px 32px; }
    .nav-content { gap: 18px; }
    .nav-brand { display: none; }
    .global-nav a { font-size: 12px; }
    .hero-glass { flex-direction: column; align-items: flex-start; }
    summary { font-size: 15px; }
    summary::after { display: none; }
}
@media print { .global-nav { display: none; } details { break-inside: avoid; } }
