/* ============================================================
   Said Rustom — Portfolio
   Design system: dark, precise, high-contrast
   ------------------------------------------------------------
   Tweak defaults locked in production:
     · Mood    = Vault   (dark navy + blue accent)
     · Density = Compact (tight spacing scale, see --section-pad etc)
     · Texture = Grid    (blueprint background, see --bg-pattern)
     · Accent  = #3b82f6
   The mood/density/texture/accent panel is intentionally NOT
   shipped. Every value below is a CSS variable so any of these
   can be re-tuned in one place. See THEME-SYSTEM.md.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Palette (Vault mood) ---- */
  --bg:           #0f1624;
  --bg-card:      #161f30;
  --bg-subtle:    #1e2d45;
  --bg-elevated:  #1a2335;
  --border:       #2a3a55;
  --border-soft:  #223149;
  --text:         #e2e8f0;
  --text-muted:   #8899aa;
  --text-faint:   #5a6a82;
  --accent:       #3b82f6;
  --accent-soft:  #60a5fa;
  --accent-glow:  rgba(59,130,246,0.15);
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;

  /* ---- Type ---- */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Fira Code', monospace;

  /* ---- Layout ---- */
  --maxw:         1180px;
  --gutter:       2rem;

  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;

  /* ---- Density scale (Compact mode — locked) ----
     These six values move together. Bumping density to "standard"
     would mean: --section-pad 5rem, --hero-pad "7rem 0 6rem",
     --h1-clamp-min 2.5rem, --h1-clamp-max 4.5rem, --prose-lh 1.65,
     --card-pad 1.5rem, --tl-entry-pad 3rem.
     Spacious adds ~50% on top of standard. */
  --section-pad:    3.5rem;
  --hero-pad:       5rem 0 4rem;
  --h1-clamp-min:   2rem;
  --h1-clamp-max:   3.75rem;
  --prose-lh:       1.55;
  --card-pad:       1.1rem;
  --tl-entry-pad:   2rem;

  /* ---- Texture (Grid blueprint pattern — locked) ---- */
  --grid-rgb: 42, 58, 85;
  --bg-pattern:
    linear-gradient(rgba(var(--grid-rgb), 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--grid-rgb), 0.18) 1px, transparent 1px);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--prose-lh);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* page background — subtle grid + radial accent, CSS only. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--bg-pattern);
  background-size: 64px 64px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 70%);
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-soft); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(var(--h1-clamp-min), 6vw, var(--h1-clamp-max)); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; color: var(--text); }
p.muted { color: var(--text-muted); }

img { max-width: 100%; display: block; }

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

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.section {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--border-soft);
}
.section:first-of-type { border-top: 0; }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { margin-top: 0.75rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 22, 36, 0.78);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand .mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.15rem;
  height: 1px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  background: var(--text);
  height: 1.5px;
  width: 16px;
  margin: 0 auto;
  position: relative;
  transition: transform .2s ease;
}
.nav-toggle span::before { content: ""; position: absolute; top: -5px; left: 0; width: 16px; }
.nav-toggle span::after  { content: ""; position: absolute; top:  5px; left: 0; width: 16px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--hero-pad);
  overflow: hidden;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(34,197,94,0.05); }
}

.hero h1 {
  margin-top: 1.5rem;
  max-width: 18ch;
}
.hero .accent { color: var(--accent); }
.hero .title-line {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  max-width: 60ch;
}
.hero .tagline {
  margin-top: 1.25rem;
  font-size: 1.2rem;
  color: var(--text);
  max-width: 56ch;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg-elevated); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn-ghost { background: transparent; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-sm { padding: 0.55rem 0.85rem; font-size: 0.85rem; }

/* hero corner ticks (industrial detail) */
.hero-frame {
  position: absolute;
  inset: 5rem var(--gutter) 4rem;
  pointer-events: none;
  border: 1px solid transparent;
}
.hero-frame::before, .hero-frame::after,
.hero-frame > i::before, .hero-frame > i::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--border);
}
.hero-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero-frame::after  { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hero-frame > i::before { content: ""; bottom: 0; left: 0; position: absolute; border-right: 0; border-top: 0; }
.hero-frame > i::after  { content: ""; bottom: 0; right: 0; position: absolute; border-left: 0; border-top: 0; }

/* ---------- Highlights strip (clearance + award) ---------- */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}
.credential {
  position: relative;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%),
    var(--bg-card);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
}
.credential::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--border);
}
.credential.is-active::before  { background: var(--success); }
.credential.is-pending::before { background: var(--warning); }
.credential.is-award::before   { background: var(--accent); }

.credential-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.credential-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.credential-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.credential-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
}
.is-active  .credential-status .dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}
.is-pending .credential-status .dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.is-award   .credential-status .dot { background: var(--accent);  box-shadow: 0 0 0 3px var(--accent-glow); }

.credential-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.credential-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}
.about-aside {
  position: sticky;
  top: 90px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.about-aside .label { color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.7rem; }
.about-aside .row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-soft); }
.about-aside .row:last-child { border-bottom: 0; }
.about-prose p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  text-wrap: pretty;
}
.about-prose p:first-child { font-size: 1.2rem; color: var(--text); }
.about-prose p strong { color: var(--text); }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.skill-group {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.skill-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.skill-group-title h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}
.skill-group-title .count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.skill-group.is-industrial .pill {
  border-color: rgba(245,158,11,0.35);
  color: var(--warning);
  background: rgba(245,158,11,0.08);
}
.skill-group.is-industrial .skill-group-title h4 { color: var(--warning); }

/* ---------- Project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.project-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(59,130,246,0.12), rgba(245,158,11,0.04)),
    var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project-cover svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
}
.project-cover .badge-featured {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.project-cover .glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.project-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.project-meta .year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.project-card h3 { font-size: 1.3rem; }
.project-tagline { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.project-desc    { font-size: 0.92rem; color: var(--text-muted); line-height: 1.65; margin: 0; }
.project-tags    { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.project-actions { display: flex; gap: 0.5rem; padding-top: 0.5rem; }
.project-actions .btn { padding: 0.55rem 0.85rem; font-size: 0.85rem; }

/* ---------- Project sections ---------- */
.project-card { scroll-margin-top: 84px; }
.project-cover .cover-hit { position: absolute; inset: 0; z-index: 2; }
.project-cover .badge-featured { z-index: 3; }

.project-section { padding-top: 0.8rem; padding-bottom: 0.45rem; border-top: 1px solid var(--border); }
.project-section--lead { border-top: none; padding-top: 0.2rem; padding-bottom: 0.2rem; }
.project-section .h {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}
.section-body { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; }
.section-body p { margin: 0 0 0.5rem; white-space: pre-wrap; }
.section-body p:last-child { margin-bottom: 0; }
.section-body ul { margin: 0.15rem 0 0.35rem; padding-left: 1.05rem; }
.section-body li { margin: 0.12rem 0; }

.project-more { border: 0; }
.project-more > summary { list-style: none; cursor: pointer; display: block; }
.project-more > summary::-webkit-details-marker { display: none; }
.section-teaser {
  position: relative;
  max-height: 78px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 16%, rgba(0,0,0,0.18) 74%, transparent);
          mask-image: linear-gradient(180deg, #000 16%, rgba(0,0,0,0.18) 74%, transparent);
}
.project-more[open] .section-teaser { display: none; }
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.4rem 0.7rem;
  background: var(--bg-subtle);
  transition: border-color 0.15s ease;
}
.more-btn:hover { border-color: var(--accent); }
.more-btn .m-hide { display: none; }
.project-more[open] .more-btn .m-show { display: none; }
.project-more[open] .more-btn .m-hide { display: inline; }

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--border) 0%, var(--border) 70%, transparent 100%);
}
.tl-entry {
  position: relative;
  padding: 0 0 var(--tl-entry-pad);
}
.tl-entry::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  z-index: 1;
}
.tl-entry.is-current::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
.tl-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  transition: border-color .2s ease;
}
.tl-card:hover { border-color: var(--accent); }
.tl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tl-role { margin: 0; font-size: 1.3rem; }
.tl-company {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.3rem;
  letter-spacing: 0.01em;
}
.tl-dates {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}
.tl-dates .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}
.tl-desc {
  color: var(--text);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-wrap: pretty;
}
.tl-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tl-bullets {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.tl-bullets li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.93rem;
}
.tl-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Resume page ---------- */
.resume-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border-soft);
}
.resume-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.resume-contacts {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: right;
}
.resume-contacts a { color: var(--text); }
.resume-contacts a:hover { color: var(--accent); }

.education-list { display: flex; flex-direction: column; gap: 1rem; }
.edu-card {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
}
.edu-years {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.edu-degree { margin: 0; font-size: 1.1rem; }
.edu-inst { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.95rem; }
.honour-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.08);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field textarea { min-height: 130px; }
.field .err {
  color: var(--danger);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}
.contact-side {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.contact-side .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.contact-side .value { color: var(--text); font-size: 1rem; word-break: break-word; }
.contact-side .value a { color: var(--text); border-bottom: 1px solid var(--border); }
.contact-side .value a:hover { color: var(--accent); border-color: var(--accent); }

.success-banner {
  border: 1px solid var(--success);
  background: rgba(34,197,94,0.08);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.success-banner .dot {
  margin-top: 0.4rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
  flex-shrink: 0;
}
.success-banner h3 { margin-bottom: 0.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 5rem;
  padding: 3rem 0 2.5rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.15));
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-brand {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.footer-brand .sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}
.footer-col .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.2rem 0;
}
.footer-col a:hover { color: var(--accent); }
.footer-meta {
  border-top: 1px dashed var(--border-soft);
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border-soft); padding: 0.5rem 0; }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 0.85rem var(--gutter); border-radius: 0; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .highlights      { grid-template-columns: 1fr; }
  .about-grid      { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-aside     { position: static; order: 2; }
  .project-grid    { grid-template-columns: 1fr; }
  .contact-grid    { grid-template-columns: 1fr; }
  .footer-grid     { grid-template-columns: 1fr; gap: 1.5rem; }
  .resume-head     { flex-direction: column; align-items: flex-start; }
  .resume-contacts { text-align: left; }
  .edu-card        { grid-template-columns: 1fr; }
  .skills-grid     { grid-template-columns: 1fr; }
  .section         { padding: 3.5rem 0; }
  .hero            { padding: 4rem 0 3rem; }

  .hero h1         { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.1; }
  .hero .tagline   { font-size: 1.05rem; }
  .hero-frame      { inset: 3rem 1rem 2rem; }
  .credentials     { gap: 0.4rem; }
  .credential      { font-size: 0.7rem; padding: 0.3rem 0.6rem; }

  .tl-head         { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .tl-dates        { font-size: 0.72rem; }
  .tl-role         { font-size: 1.1rem; }
}

@media (max-width: 560px) {
  :root { --gutter: 1.1rem; }
  body { font-size: 0.95rem; }
  h1, h2, h3 { text-wrap: balance; }
  .section         { padding: 2.75rem 0; }
  .hero            { padding: 3rem 0 2.25rem; }
  .hero-frame      { display: none; }
  .section-head    { margin-bottom: 1.75rem; }
  .skill-group, .tl-card, .contact-form, .contact-side, .project-card {
    padding: 1.1rem;
  }
  .timeline        { padding-left: 1.5rem; }
  .tl-entry        { padding-bottom: 2rem; }
  .pill            { font-size: 0.7rem; padding: 0.2rem 0.55rem; }
  .btn             { padding: 0.65rem 0.9rem; font-size: 0.85rem; }
  .resume-head h1  { font-size: 1.6rem; }
  .footer-grid     { gap: 1.25rem; }
  .tl-bullets li   { font-size: 0.9rem; }
}

/* ---------- Accessibility ---------- */

.skip-link {
  position: absolute;
  left: 0; top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

@media (max-width: 560px) {
  .project-body { padding: 0.95rem; }   /* tighter sides on phones → wider lines */
}

/* ---------- Print (Resume) ---------- */
@media print {
  @page { margin: 14mm; }

  body { background: #fff; color: #111; font-size: 10.5pt; line-height: 1.45; }
  body::before { display: none; }
  .skip-link, .site-header, .site-footer, .nav, .nav-toggle, .btn-print-hide { display: none !important; }
  main { max-width: none; }
  .container { padding: 0; max-width: none; }
  .section { padding: 0.6rem 0; border: 0; page-break-inside: avoid; break-inside: avoid; }
  .skill-group, .credential, .edu-card, .tl-card, .contact-form, .contact-side {
    background: #fff; border: 1px solid #ddd; color: #111;
    break-inside: avoid;
    box-shadow: none;
  }
  .pill { background: #f4f4f4; color: #111; border-color: #ddd; }
  .eyebrow, .skill-group-title h4, .field label { color: #555; }

  a { color: #111; text-decoration: underline; }
  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
    font-family: var(--font-mono);
  }
  a[href^="#"]::after { content: ""; }

  h1, h2, h3, h4 { color: #111; page-break-after: avoid; break-after: avoid; }
  .resume-head { padding: 0 0 0.75rem; border-color: #ddd; }
  .timeline { page-break-inside: auto; }
  .tl-entry { page-break-inside: avoid; break-inside: avoid; }
}
