/* ============================================================
   PORTFOLIO — styles.css
   Alec Sanchez · Security Architecture & Engineering Portfolio
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,300;0,400;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --ink:              #0d0d0d;
  --ink-mid:          #2a2a2a;
  --ink-light:        #555;
  --ink-faint:        #888;
  --rule:             #c8c0b4;
  --rule-light:       #e8e2d8;
  --bg:               #f5f2ed;
  --bg-paper:         #faf8f4;
  --bg-warm:          #ede9e2;
  --accent:           #1a1a1a;
  --accent-red:       #8b1a1a;
  --accent-red-light: #c0392b;
  --serif:  'Source Serif 4', Georgia, serif;
  --sans:   'IBM Plex Sans', system-ui, sans-serif;
  --mono:   'IBM Plex Mono', 'Courier New', monospace;
  --page-max: 1120px;
  --col-main: 680px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── GLOBAL TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); letter-spacing: -0.015em; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-light);
}
p {
  font-size: 1.05rem;
  max-width: 68ch;
  color: var(--ink-mid);
  margin-bottom: 1.1em;
}
p:last-child { margin-bottom: 0; }
a { color: var(--accent-red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-red-light); }
code, pre { font-family: var(--mono); }


/* ══════════════════════════════════════════════
   SITE HEADER
══════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #e8e2d8;
  border-bottom: 2px solid var(--accent-red);
}
.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.site-id {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c8c0b4;
  white-space: nowrap;
}
.site-id span { color: var(--accent-red-light); margin-right: 0.4rem; }

/* Desktop nav */
.desktop-nav { display: flex; gap: 0; }
.desktop-nav a {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8c0b4;
  text-decoration: none;
  padding: 0 0.9rem;
  height: 52px;
  display: flex;
  align-items: center;
  border-left: 1px solid #2a2a2a;
  transition: background 0.15s, color 0.15s;
}
.desktop-nav a:hover { background: #1e1e1e; color: #fff; }
.desktop-nav a.active { background: var(--accent-red); color: #fff; }

/* Hamburger button — mobile only */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #c8c0b4;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #111;
  border-top: 1px solid #2a2a2a;
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8c0b4;
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1e1e1e;
  transition: background 0.15s;
}
.mobile-nav a:hover { background: #1e1e1e; color: #fff; }
.mobile-nav a.active { background: var(--accent-red); color: #fff; }


/* ══════════════════════════════════════════════
   CLASSIFICATION BAR
══════════════════════════════════════════════ */
.classification-bar {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--rule);
  text-align: center;
  padding: 5px 1.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--ink-light);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ══════════════════════════════════════════════
   PAGE LAYOUT
══════════════════════════════════════════════ */
.page-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* ══════════════════════════════════════════════
   HERO — SECTION 00
══════════════════════════════════════════════ */
#home {
  background: var(--ink);
  color: #e8e2d8;
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
#home::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(200,192,180,0.06) 39px, rgba(200,192,180,0.06) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(200,192,180,0.04) 39px, rgba(200,192,180,0.04) 40px);
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-red-light);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-label::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent-red-light);
  flex-shrink: 0;
}
#home h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  color: #f0ebe2;
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hero-title-sub {
  font-family: var(--sans);
  font-size: 1rem;
  color: #888;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}
.hero-desc {
  font-size: 1rem;
  color: #c0b8ac;
  max-width: 60ch;
  line-height: 1.75;
  margin-bottom: 0;
  font-weight: 300;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #2a2a2a;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid #2a2a2a;
}
.stat {
  padding: 1.2rem 1.4rem;
  border-right: 1px solid #2a2a2a;
}
.stat:last-child { border-right: none; }
.stat-n {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0ebe2;
  line-height: 1;
  font-family: var(--sans);
  margin-bottom: 0.3rem;
}
.stat-n span { color: var(--accent-red-light); }
.stat-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 180px;
}


/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.btn-primary { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-primary:hover { background: #a02020; border-color: #a02020; color: #fff; }
.btn-outline { background: transparent; border-color: #444; color: #c8c0b4; }
.btn-outline:hover { border-color: #888; color: #fff; }


/* ══════════════════════════════════════════════
   DOC SECTIONS — shared structure
══════════════════════════════════════════════ */
.doc-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--rule);
}
.doc-section:last-of-type { border-bottom: none; }

/*
 * Alternate section background.
 * Used on: #research, #detections, #cyberdefenders, #contact
 * Replaces the former inline style="background:var(--bg-paper)"
 */
.doc-section--alt { background: var(--bg-paper); }

.section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.section-head {
  max-width: var(--col-main);
  margin-bottom: 2.5rem;
}
.section-head h2 { margin-bottom: 0.75rem; }
.section-head p { font-size: 1.05rem; color: var(--ink-light); }


/* ══════════════════════════════════════════════
   PAPER CARD
══════════════════════════════════════════════ */
.paper-card {
  background: var(--bg-paper);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--ink);
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
}
.paper-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}
.paper-meta .doc-id { color: var(--accent-red); }
.paper-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.paper-card .abstract {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.65;
  margin-bottom: 1.2rem;
  max-width: 70ch;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--rule);
  color: var(--ink-light);
  background: var(--bg-warm);
}
.tag.red { border-color: var(--accent-red); color: var(--accent-red); background: #fdf5f5; }


/* ══════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════ */
.doc-table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.88rem;
  min-width: 500px;
}
thead th {
  background: var(--ink);
  color: #e8e2d8;
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
tbody tr { border-bottom: 1px solid var(--rule-light); }
tbody tr:nth-child(even) { background: var(--bg-warm); }
tbody td {
  padding: 0.6rem 0.9rem;
  vertical-align: top;
  color: var(--ink-mid);
  line-height: 1.5;
}
tbody td:first-child { font-family: var(--mono); font-size: 0.78rem; color: var(--accent-red); font-weight: 500; }
tbody td.tier-0 { color: #8b1a1a; font-weight: 600; }
tbody td.tier-1 { color: #4a4a4a; }
tbody td.tier-2 { color: #777; }
.risk-high { color: #8b1a1a; font-weight: 600; }
.risk-med  { color: #7a5a00; font-weight: 600; }
.risk-low  { color: #1a4a1a; font-weight: 600; }


/* ══════════════════════════════════════════════
   OSIM DIAGRAM
══════════════════════════════════════════════ */
.osim-diagram {
  background: var(--ink);
  padding: 2rem;
  margin: 2.5rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #c8c0b4;
  line-height: 1.9;
  border: 1px solid #333;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.osim-diagram .zone-line {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.osim-diagram .zone-name  { color: #e8e2d8; font-weight: 500; min-width: 150px; }
.osim-diagram .zone-subnet { color: #888; min-width: 110px; }
.osim-diagram .zone-trust  { font-size: 0.68rem; }
.osim-diagram .zone-note   { color: #555; font-size: 0.68rem; }
.osim-diagram .trust-0     { color: var(--accent-red-light); }
.osim-diagram .trust-1     { color: #c8a400; }
.osim-diagram .trust-2     { color: #888; }
.osim-diagram .divider     { border-top: 1px solid #2a2a2a; margin: 0.6rem 0; }
.osim-diagram .diagram-title {
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-red-light);
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #2a2a2a;
}
.osim-diagram .indent      { color: #333; margin-left: 1rem; font-size: 0.72rem; line-height: 1.4; }
.osim-diagram .footer-note { color: #444; font-size: 0.68rem; margin-top: 0.4rem; }


/* ══════════════════════════════════════════════
   INVARIANT GRID
══════════════════════════════════════════════ */
.invariant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 2rem 0;
}
.invariant-item {
  background: var(--bg-paper);
  padding: 1.1rem 1.3rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.inv-id {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent-red);
  font-weight: 500;
  min-width: 50px;
  padding-top: 0.1rem;
}
.inv-text {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--ink-mid);
  line-height: 1.5;
}


/* ══════════════════════════════════════════════
   PRINCIPLE LIST
   Used for: Design Principles, SOC Workflow, Diagram Roadmap
══════════════════════════════════════════════ */
.principle-list { margin: 1.5rem 0; }
.principle-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.2rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule-light);
  align-items: start;
}
.principle-item:last-child { border-bottom: none; }
.prin-n { font-family: var(--mono); font-size: 0.7rem; color: var(--accent-red); padding-top: 0.15rem; }
.prin-body h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.prin-body p  { font-size: 0.9rem; color: var(--ink-light); margin: 0; max-width: 65ch; }


/* ══════════════════════════════════════════════
   SPEC GRID — Lab hardware / software cards
══════════════════════════════════════════════ */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}
.spec-card {
  background: var(--bg-paper);
  border: 1px solid var(--rule);
  padding: 1.3rem 1.5rem;
}
.spec-card h4 { margin-bottom: 0.8rem; font-size: 0.7rem; }
.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--sans);
  font-size: 0.83rem;
}
.spec-item:last-child { border-bottom: none; }
.spec-key { color: var(--ink-light); flex-shrink: 0; }
.spec-val { color: var(--ink); font-family: var(--mono); font-size: 0.75rem; text-align: right; }


/* ══════════════════════════════════════════════
   RED TEAM CARDS
══════════════════════════════════════════════ */
.rt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.rt-card {
  border: 1px solid var(--rule);
  padding: 1.4rem;
  background: var(--bg);
}
.rt-id {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent-red);
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
}
.rt-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.rt-card p  { font-size: 0.86rem; color: var(--ink-light); margin-bottom: 0.9rem; }
.rt-evidence { font-family: var(--mono); font-size: 0.67rem; color: var(--ink-faint); }


/* ══════════════════════════════════════════════
   MITRE ATT&CK TAGS & LEGEND
══════════════════════════════════════════════ */
.attck-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1.5rem 0; }
.attck-tag {
  font-family: var(--mono);
  font-size: 0.63rem;
  padding: 0.2rem 0.5rem;
  background: var(--ink);
  color: #c8c0b4;
  letter-spacing: 0.05em;
}
.attck-tag.mitigated { background: #2a1a1a; color: var(--accent-red-light); }

/* Legend — semantic dl replacing the original plain-text "■ RED / ■ DARK" note */
.attck-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.attck-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.attck-legend-item dt { margin: 0; }
.attck-legend-item dd {
  font-size: 0.65rem;
  font-family: var(--mono);
  color: var(--ink-faint);
  margin: 0;
}


/* ══════════════════════════════════════════════
   COVERAGE BARS
══════════════════════════════════════════════ */
.coverage-bar-wrap { margin: 2rem 0; }
.coverage-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
}
.cov-label { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-light); min-width: 180px; }
.cov-bar   { flex: 1; height: 5px; background: var(--rule-light); }
.cov-fill  { height: 100%; background: var(--ink); }
/* Note: width values are set per-element via style="width:X%" in HTML.
   The JS animation reads these, resets to 0%, then animates to target. */
.cov-pct   { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-light); min-width: 38px; text-align: right; }


/* ══════════════════════════════════════════════
   CALLOUT BLOCKS
══════════════════════════════════════════════ */
.callout {
  background: var(--bg-warm);
  border-left: 3px solid var(--ink);
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.6;
}
.callout strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

/* Warning variant — IPS Promotion Gate, replaces former .callout.red */
.callout--warning {
  border-color: var(--accent-red);
  background: #fdf5f5;
}

/* Legacy alias — kept for backward compatibility if .callout.red appears elsewhere */
.callout.red { border-color: var(--accent-red); background: #fdf5f5; }


/* ══════════════════════════════════════════════
   CONTACT SECTION
══════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule-light);
}
.contact-icon {
  width: 34px;
  height: 34px;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-light);
  flex-shrink: 0;
}
.contact-detail h4 { font-size: 0.7rem; margin-bottom: 0.2rem; }
.contact-detail p  { font-size: 0.9rem; color: var(--ink-mid); margin: 0; max-width: none; }

/*
 * Structural containers — layout wrappers within .contact-grid.
 * .contact-list  : wraps the four contact-item rows (left column)
 * .quick-ref-wrap: wraps the quick-reference card (right column)
 * No visual styling needed; declared here for clarity and future use.
 */
.contact-list  { display: flex; flex-direction: column; }
.quick-ref-wrap { display: flex; flex-direction: column; }

/* Quick reference card */
.quick-ref {
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  padding: 1.8rem;
}
.quick-ref h4 { margin-bottom: 1rem; }
.qr-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--sans);
  font-size: 0.86rem;
}
.qr-row:last-child { border-bottom: none; }
.qr-key { color: var(--ink-light); }
.qr-val { font-family: var(--mono); font-size: 0.78rem; color: var(--ink); text-align: right; }


/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
footer {
  background: var(--ink);
  color: #555;
  padding: 2.2rem 0;
  font-family: var(--sans);
  font-size: 0.78rem;
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Replaces the former inline style div in footer */
.footer-name {
  color: #888;
  margin-bottom: 0.3rem;
  font-family: var(--sans);
}
.footer-links { margin-top: 0.3rem; }
.footer-links a { color: #666; text-decoration: none; }
.footer-links a:hover { color: #999; }
.footer-doc {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  color: #3a3a3a;
  text-align: right;
  line-height: 1.9;
}


/* ══════════════════════════════════════════════
   FADE-IN ANIMATION
══════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible { opacity: 1; transform: none; }


/* ══════════════════════════════════════════════
   UTILITY CLASSES
══════════════════════════════════════════════ */
.mt-sm  { margin-top: 1rem; }
.mt-md  { margin-top: 1.5rem; }
.mt-lg  { margin-top: 2.5rem; }
.mb-sm  { margin-bottom: 1rem; }
.mb-md  { margin-bottom: 1.5rem; }
.text-mono  { font-family: var(--mono); font-size: 0.85rem; }
.text-faint { color: var(--ink-faint); }
.text-light { color: var(--ink-light); }


/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET  (max-width: 900px)
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .spec-grid    { grid-template-columns: 1fr 1fr; }
  .rt-grid      { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-cta {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: unset;
  }
}


/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE  (max-width: 640px)
══════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Header */
  .site-id { font-size: 0.68rem; letter-spacing: 0.07em; }
  .desktop-nav { display: none; }
  .hamburger { display: flex; }
  .classification-bar { font-size: 0.58rem; letter-spacing: 0.07em; }

  /* Hero */
  #home { padding: 48px 0 44px; }
  .hero-stats { grid-template-columns: 1fr; border: 1px solid #2a2a2a; }
  .stat { border-right: none; border-bottom: 1px solid #2a2a2a; padding: 1rem 1.2rem; }
  .stat:last-child { border-bottom: none; }
  .stat-n { font-size: 1.5rem; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }

  /* Sections */
  .doc-section   { padding: 48px 0; }
  .section-head  { margin-bottom: 2rem; }
  h3 { font-size: 1.08rem; }
  p  { font-size: 0.97rem; }

  /* Grids collapse to single column */
  .spec-grid      { grid-template-columns: 1fr; gap: 1rem; }
  .rt-grid        { grid-template-columns: 1fr; gap: 1rem; }
  .invariant-grid { grid-template-columns: 1fr; }
  .contact-grid   { grid-template-columns: 1fr; }

  /* Principle items */
  .principle-item { grid-template-columns: 2.5rem 1fr; gap: 0.8rem; }

  /* Coverage bars */
  .cov-label { min-width: 120px; font-size: 0.62rem; }

  /* Tables */
  table     { font-size: 0.8rem; min-width: 480px; }
  thead th  { font-size: 0.62rem; padding: 0.5rem 0.7rem; }
  tbody td  { padding: 0.5rem 0.7rem; }

  /* OSIM diagram */
  .osim-diagram            { font-size: 0.7rem; padding: 1.4rem; }
  .osim-diagram .zone-name   { min-width: unset; }
  .osim-diagram .zone-subnet { min-width: unset; }

  /* ATT&CK legend stacks on mobile */
  .attck-legend { flex-direction: column; gap: 0.5rem; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-doc   { text-align: left; }

  /* Quick ref card */
  .quick-ref  { padding: 1.2rem; }
  .qr-row     { font-size: 0.78rem; }
  .qr-val     { font-size: 0.7rem; }
}