/* ═══════════════════════════════════════════════
   SRM Helper — Design Tokens & Core Styles
   Google Material Design 3 color system
   WCAG 2.1 AA compliant · prefers-reduced-motion
   ═══════════════════════════════════════════════ */

:root {
  --bg:           #0a0f1c;
  --surface:      #111827;
  --surface-2:    #1a2540;
  --surface-3:    #1f2e4a;
  --text-primary: #e8edf5;
  --text-secondary: #9aa9c1;
  --text-disabled: #5c6880;
  --brand:        #60a5fa;
  --brand-dim:    #3b82f6;
  --brand-bg:     rgba(96,165,250,.10);
  --brand-border: rgba(96,165,250,.22);
  --accent:       #fbbf24;
  --accent-dim:   #f59e0b;
  --accent-bg:    rgba(251,191,36,.10);
  --accent-border:rgba(251,191,36,.24);
  --ok:           #34d399;
  --ok-bg:        rgba(52,211,153,.10);
  --ok-border:    rgba(52,211,153,.28);
  --danger:       #f87171;
  --danger-bg:    rgba(248,113,113,.10);
  --danger-border:rgba(248,113,113,.28);
  --divider:      rgba(255,255,255,.10);
  --divider-strong:rgba(255,255,255,.16);
  --radius-xs:    8px;
  --radius-sm:    12px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --radius-pill:  9999px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 8px 24px rgba(0,0,0,.5);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.55);
  --max-width:    1180px;
  --header-h:     64px;
  --ease-out:     cubic-bezier(.2,0,0,1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Skip Link ── */
.skip-link {
  position: absolute; top: 12px; left: 12px; z-index: 100;
  background: var(--brand); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: .875rem;
  transform: translateY(-200%);
  transition: transform .15s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.025em; }
p { margin: 0; }
img, svg { max-width: 100%; display: block; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  padding: 0 max(20px, calc((100vw - var(--max-width)) / 2));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(10,15,28,.82);
  border-bottom: 1px solid var(--divider);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.125rem;
}

.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), #818cf8);
  color: #0a0f1c; font-weight: 900;
}

.site-nav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}

.site-nav a {
  font-weight: 600; font-size: .875rem; color: var(--text-secondary);
  padding: 8px 12px; border-radius: var(--radius-pill);
  transition: color .15s var(--ease-out), background .15s var(--ease-out);
}

.site-nav a:hover, .site-nav a.active {
  background: rgba(255,255,255,.08); color: var(--text-primary);
}

.nav-toggle {
  display: none; border: 1px solid var(--divider);
  background: rgba(255,255,255,.06); color: var(--text-primary);
  padding: 8px 14px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .875rem; cursor: pointer;
}

/* ── Layout ── */
.hero, .section, .page-hero { max-width: var(--max-width); margin: 0 auto; padding: 64px 20px; }
.page-hero { padding-top: 48px; padding-bottom: 28px; }
.section-anchor { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 36px; align-items: center;
  min-height: calc(100vh - var(--header-h));
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent-border); background: var(--accent-bg);
  color: var(--accent); padding: 5px 12px;
  border-radius: var(--radius-pill); font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.5vw, 5rem);
  line-height: .96; margin: 16px 0; letter-spacing: -.04em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary), var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lead {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary); max-width: 720px; line-height: 1.65;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid var(--divider);
  background: rgba(255,255,255,.07); color: var(--text-primary);
  font-weight: 700; font-size: .875rem;
  padding: 11px 20px; border-radius: var(--radius-pill);
  cursor: pointer; transition: transform .15s var(--ease-out);
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand-dim), #6366f1); border-color: transparent; color: #fff; }
.btn.accent { background: linear-gradient(135deg, var(--accent), #f97316); border-color: transparent; color: #1a1000; }
.btn.small { padding: 6px 14px; font-size: .75rem; }

/* ── Cards ── */
.card, .hero-card, .tool-panel, .resource-card {
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

.card { padding: 20px; }
.card h3 { font-size: 1rem; margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: .875rem; }
.card:hover { border-color: var(--divider-strong); }

/* ── Hero card ── */
.hero-card { padding: 22px; }

.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--divider-strong);
  border-radius: var(--radius-md); padding: 12px 14px;
}

.search-box input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text-primary); font-size: 1rem; font-family: inherit;
}

.search-box input::placeholder { color: var(--text-disabled); }

.suggestions { display: grid; gap: 8px; margin-top: 12px; }

.suggestions a {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--divider);
  border-radius: var(--radius-sm); background: rgba(255,255,255,.03);
  color: var(--text-secondary); font-size: .875rem;
}

.suggestions a:hover { background: rgba(255,255,255,.06); color: var(--text-primary); }
.suggestions strong { color: var(--text-primary); font-weight: 600; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { padding: 14px; border-radius: var(--radius-md); background: var(--surface-3); border: 1px solid var(--divider); }
.stat b { display: block; font-size: 1.25rem; color: var(--brand); font-weight: 800; }
.stat span { font-size: .75rem; color: var(--text-secondary); }

/* ── Sections ── */
.section.compact { padding-top: 28px; padding-bottom: 28px; }
.section h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin-bottom: 10px; letter-spacing: -.03em; }
.section-intro { color: var(--text-secondary); max-width: 760px; font-size: 1.125rem; line-height: 1.65; }

/* ── Grids ── */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── Tags ── */
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag { display: inline-flex; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--brand-bg); border: 1px solid var(--brand-border); font-size: .75rem; color: var(--brand); font-weight: 600; }
.tag.accent { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }
.tag.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* ── Timeline ── */
.timeline { display: grid; gap: 12px; margin-top: 22px; }
.step { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; }
.step-num { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--brand-bg); border: 1px solid var(--brand-border); font-weight: 900; font-size: 1.125rem; color: var(--brand); }
.step-content { padding: 16px; border: 1px solid var(--divider); border-radius: var(--radius-md); background: var(--surface); }
.step-content h3 { font-size: 1rem; margin-bottom: 6px; }
.step-content p { margin: 0; color: var(--text-secondary); font-size: .875rem; }

/* ── Notices ── */
.notice { border: 1px solid var(--accent-border); background: var(--accent-bg); border-radius: var(--radius-md); padding: 16px 18px; color: var(--accent); font-size: .875rem; line-height: 1.6; }
.notice.danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.notice.info { border-color: var(--brand-border); background: var(--brand-bg); color: var(--brand); }

/* ── Page hero ── */
.page-hero h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; margin: 12px 0; letter-spacing: -.04em; }
.breadcrumb { color: var(--text-secondary); font-weight: 600; font-size: .875rem; }
.breadcrumb a { color: var(--brand); }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Filters ── */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.filters input, .filters select, .tool-panel input, .tool-panel select, .tool-panel textarea {
  background: var(--bg); border: 1px solid var(--divider); border-radius: var(--radius-sm);
  color: var(--text-primary); padding: 10px 14px; font-size: .875rem;
  font-family: inherit; outline: none;
  transition: border-color .15s var(--ease-out);
}
.filters input:focus, .filters select:focus, .tool-panel input:focus, .tool-panel select:focus, .tool-panel textarea:focus { border-color: var(--brand); }
.filters input { min-width: 240px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--divider); border-radius: var(--radius-md); margin-top: 16px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; background: var(--surface); }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
.table th { color: var(--accent); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
.table td { color: var(--text-secondary); font-size: .875rem; }
.table strong { color: var(--text-primary); }

/* ── Tools ── */
.tool-panel { padding: 22px; }
.tool-panel form { display: grid; gap: 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.result { padding: 16px 18px; border-radius: var(--radius-md); background: var(--ok-bg); border: 1px solid var(--ok-border); font-size: 1.125rem; font-weight: 700; color: var(--ok); margin-top: 12px; }
.result.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

/* ── Subject ── */
.subject-header { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.mini-list { display: grid; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.mini-list li { padding: 10px 14px; border: 1px solid var(--divider); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); font-size: .875rem; }

/* ── Quote ── */
.quote {
  font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1.2;
  letter-spacing: -.03em; color: var(--text-primary);
  padding: 22px 24px; border-left: 4px solid var(--brand);
  background: var(--brand-bg); border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ── Footer ── */
.site-footer { max-width: var(--max-width); margin: 48px auto 0; padding: 32px 20px 56px; border-top: 1px solid var(--divider); display: grid; grid-template-columns: 1fr auto; gap: 24px; color: var(--text-secondary); font-size: .875rem; }
.footer-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { padding: 7px 12px; border: 1px solid var(--divider); border-radius: var(--radius-pill); font-size: .75rem; white-space: nowrap; }
.owner-note { font-size: .875rem; color: var(--text-secondary); }
.kbd { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; background: rgba(255,255,255,.1); border: 1px solid var(--divider); border-radius: 6px; padding: 2px 6px; font-size: .75rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: var(--header-h); right: 12px; left: 12px; padding: 12px; background: rgba(10,15,28,.98); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--divider); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
  .site-nav.open { display: grid; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 36px; }
  .grid, .grid.two, .grid.four, .tool-grid, .subject-header { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .hero h1 { font-size: 2.6rem; }
  .section { padding: 44px 16px; }
  .page-hero { padding: 40px 16px 22px; }
}

@media (max-width: 480px) {
  .cta-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
