/* shahar.ephrath // offsec — terminal portfolio */

:root {
  /* Sh4d0w Ember palette — warm dark base, ember-orange accent, cream highlight */
  --bg: #0d0a07;
  --bg-soft: #14100b;
  --surface: #1a1510;
  --surface-2: #211a13;
  --border: #2c2218;
  --border-strong: #3d3024;
  --text: #e5dccf;
  --text-muted: #a39584;
  --text-dim: #6e6052;

  --accent: #ed8136;
  --accent-dim: #c95f1c;
  --accent-soft: rgba(237, 129, 54, 0.09);
  --accent-glow: rgba(237, 129, 54, 0.32);

  /* Pale ember/cream — used for inline code chips, project stack tags, secondary highlights.
     Var name kept as `--cyan` only for backwards compatibility within this stylesheet. */
  --cyan: #f4d35e;
  --severity-critical: #ff5470;
  --severity-high: #f0a04b;

  --radius: 4px;
  --radius-lg: 8px;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;

  --max-width: 1080px;
  --header-h: 56px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Backdrop: subtle dotted grid + faint radial glow */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(237, 129, 54, 0.06), transparent 60%),
    radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  background-position: center top, 0 0;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(255, 255, 255, 0.012) 2px 3px
  );
  mix-blend-mode: overlay;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}
.brand-prompt { color: var(--accent); }
.brand-name { color: var(--text); }
.brand-cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  list-style: none;
}

.nav-menu a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  padding: 0.25rem 0;
  position: relative;
}

.nav-menu a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width .25s var(--ease);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
}

.nav-menu a.active::before,
.nav-menu a:hover::before { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--accent);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

/* Main layout */
main {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.loading {
  font-family: var(--font-mono);
  text-align: center;
  color: var(--accent);
  padding: 5rem 1rem;
  font-size: 0.95rem;
}

.dot-loader::after {
  content: "...";
  display: inline-block;
  animation: dots 1.4s steps(4) infinite;
  width: 1.5ch;
  text-align: left;
  overflow: hidden;
  vertical-align: bottom;
}
@keyframes dots {
  0%   { width: 0; }
  100% { width: 1.5ch; }
}

.section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-h) + 24px);
  animation: fadeUp .5s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: ">";
  color: var(--accent);
  font-weight: 700;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border) 0%, transparent 100%);
  margin-left: 0.4rem;
}

/* Profile hero */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem 2.2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.2rem;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 0% 0%, var(--accent-soft), transparent 50%);
  pointer-events: none;
}

.profile-hero > * { position: relative; z-index: 1; }

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(237, 129, 54, 0.06), 0 0 30px rgba(237, 129, 54, 0.08);
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.profile-avatar:hover {
  transform: translateY(-1px);
}

/* When a real photo loads successfully (onload adds .has-photo), the artwork
   carries its own ring/framing — strip the placeholder chrome entirely so
   we don't end up with two concentric rings. */
.profile-avatar.has-photo {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.profile-avatar.has-photo:hover {
  box-shadow: 0 0 26px rgba(237, 129, 54, 0.28);
}

/* Image overlay sits on top of the initials underlay. */
.profile-avatar {
  position: relative;
}
.profile-avatar .profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
  /* Crop the heavy black padding the source image carries around the ring. */
  transform: translateX(-2px) scale(1.17);
  transform-origin: center;
}

.profile-name {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.15;
  display: inline-block;
}

.profile-name::after {
  content: "_";
  color: var(--accent);
  margin-left: 0.1em;
  animation: blink 1.1s steps(1) infinite;
}

.profile-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.profile-meta {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.profile-meta a { color: var(--cyan); }
.profile-meta a:hover { color: var(--accent); }

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.profile-links a,
.btn {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: all .18s var(--ease);
}

.profile-links a::before {
  content: "→ ";
  color: var(--accent);
}

.profile-links a:hover,
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.profile-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* About */
.about-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem 1.7rem;
  border-radius: var(--radius-lg);
}

.about-block p {
  color: var(--text);
  margin-bottom: 0.85rem;
}
.about-block p:last-child { margin-bottom: 0; }

.looking-for {
  margin-top: 1.2rem;
  padding: 1rem 1.15rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.93rem;
  color: var(--text);
}

.looking-for strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Highlights */
.highlights-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  align-items: center;
  font-family: var(--font-mono);
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 0.4rem;
}

.filter-btn {
  font-family: var(--font-mono);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s var(--ease);
}

.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.highlights-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.9rem;
}

.highlight-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--severity-high);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  position: relative;
}

.highlight-post:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  border-left-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px var(--accent-soft);
}

.highlight-post.severity-critical { border-left-color: var(--severity-critical); }
.highlight-post.severity-high     { border-left-color: var(--severity-high); }

.post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.severity-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.45rem;
  border-radius: 2px;
  color: var(--bg);
}

.severity-badge.critical { background: var(--severity-critical); }
.severity-badge.high     { background: var(--severity-high); }

.post-engagement {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.post-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}

.post-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.post-impact {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.post-technique {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  opacity: 0.85;
}

.post-technique::before {
  content: "// ";
  color: var(--text-dim);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.12rem 0.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
}

.tag::before { content: "#"; color: var(--text-dim); }

.post-hidden { display: none !important; }

.highlights-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.section-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.section-hint::before { content: "// "; }

.section-disclaimer {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-dim);
  background: var(--accent-soft);
  border: 1px solid rgba(237, 129, 54, 0.18);
  border-radius: var(--radius);
  padding: 0.45rem 0.8rem;
  margin-bottom: 1.2rem;
  line-height: 1.45;
}
.section-disclaimer .dot,
.modal-disclaimer .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(237, 129, 54, 0.22);
  flex-shrink: 0;
}

.modal-disclaimer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-dim);
  letter-spacing: 0.02em;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.9rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  position: relative;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

.project-card.internal { opacity: 0.7; }
.project-card.internal::after {
  content: "internal";
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.project-name::before {
  content: "$ ";
  color: var(--text-dim);
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
  font-weight: 400;
}

.project-stack {
  font-size: 0.78rem;
  margin: 0.65rem 0 0.7rem;
}

.project-stack span {
  font-family: var(--font-mono);
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  margin: 0.15rem 0.2rem 0 0;
  font-size: 0.7rem;
  color: var(--cyan);
}

.project-summary {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.project-highlights {
  list-style: none;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.project-highlights li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}

.project-highlights li::before {
  content: "└";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Experience */
.job {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin-bottom: 0.7rem;
  transition: border-color .2s var(--ease);
}

.job:hover { border-color: var(--border-strong); }

.job-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.55rem;
  align-items: baseline;
}

.job-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}

.job-org { color: var(--text); font-weight: 700; }

.job-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.job ul {
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  list-style: none;
}

.job li {
  margin-bottom: 0.3rem;
  position: relative;
  padding-left: 0.6rem;
}
.job li::before {
  content: "▸";
  color: var(--accent);
  position: absolute;
  left: -0.7rem;
  font-size: 0.7rem;
  top: 0.2em;
}

.military-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.military-note strong { color: var(--accent); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

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

.skills-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}

.skill-tier {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 1rem 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border);
}
.skill-tier:first-child { margin-top: 0; }
.skill-tier::before { content: "// "; color: var(--text-dim); }

.skill-line {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.skill-cat {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  font-size: 0.78rem;
}

.soft-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.soft-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 2px;
  transition: all .15s var(--ease);
}

.soft-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Achievements */
.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
}

.achievement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  transition: all .18s var(--ease);
}

.achievement-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(237, 129, 54, 0.1);
}

.achievement-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.achievement-detail {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Education */
.edu-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  transition: border-color .2s var(--ease);
}
.edu-block:hover { border-color: var(--border-strong); }

.edu-title {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.92rem;
}
.edu-title span { color: var(--text); font-weight: 500; }

.edu-subtitle {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.edu-details {
  margin-top: 0.5rem;
  padding-left: 1rem;
  font-size: 0.85rem;
  list-style: none;
  color: var(--text-muted);
}

.edu-details li {
  margin-bottom: 0.2rem;
  position: relative;
  padding-left: 0.6rem;
}
.edu-details li::before {
  content: "·";
  color: var(--accent);
  position: absolute;
  left: -0.2rem;
}

/* Contact */
.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.8rem 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}

.contact-block > * { position: relative; }

.contact-block p {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.contact-block p:first-of-type {
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.contact-links a {
  font-family: var(--font-mono);
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .18s var(--ease);
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.site-footer .muted { color: var(--text-dim); }

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(10, 12, 16, 0.97);
    backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0.6rem;
  }

  .nav-menu.open { display: flex; }

  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.6rem 1.4rem;
  }

  .profile-avatar { margin: 0 auto; }

  .profile-meta,
  .profile-links,
  .profile-actions {
    justify-content: center;
  }
}

/* Print — clean light layout for PDF export */
@media print {
  :root {
    --bg: #fff;
    --bg-soft: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --text: #111;
    --text-muted: #333;
    --text-dim: #666;
    --accent: #c0392b;
    --accent-dim: #962d22;
    --border: #ccc;
    --border-strong: #999;
  }
  body { background: #fff; color: #111; font-size: 10.5pt; font-family: var(--font-sans); }
  .bg-grid, .scanline, .site-header, .site-footer, .highlights-toolbar, .nav-toggle, .profile-actions { display: none !important; }
  main { padding: 0; max-width: 100%; }
  .section { break-inside: avoid; page-break-inside: avoid; margin-bottom: 1.4rem; }
  .highlight-post, .project-card, .job, .skills-col, .achievement-card, .edu-block, .about-block, .profile-hero, .contact-block {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
  }
  .highlights-feed { grid-template-columns: 1fr 1fr; }
  .profile-name::after, .brand-cursor { display: none; }
  a { color: #111 !important; text-decoration: none; }
}

/* Card CTA / clickable affordance */
.card-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  transition: color .15s var(--ease);
}
.highlight-post:hover .card-cta,
.project-card:hover .card-cta,
.highlight-post:focus-visible .card-cta,
.project-card:focus-visible .card-cta {
  color: var(--accent);
}
.highlight-post,
.project-card {
  cursor: pointer;
}
.highlight-post:focus-visible,
.project-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px var(--accent-glow);
}

/* Modal */
body.no-scroll { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.modal.open {
  display: flex;
  animation: modalFade .18s var(--ease);
}
@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100vh - 4rem);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-soft);
  animation: modalRise .22s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@keyframes modalRise {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 4px;
  font-size: 1.25rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all .15s var(--ease);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.modal-content {
  padding: 2rem 2.2rem 2.4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

.modal-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.15rem;
  margin-bottom: 0.4rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.7rem;
}
.modal-engagement {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.modal-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: auto;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.modal-technique {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  margin-top: 0.4rem;
}
.modal-technique::before { content: "// "; color: var(--text-dim); }

.modal-tags {
  margin-top: 0.7rem;
}

.modal-body { color: var(--text); }

/* ─── Section header ─── */
.modal-h {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2.4rem 0 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-h::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--accent);
}
.modal-h:first-child { margin-top: 0.6rem; }

/* ─── "In short" / "Summary" lead-in card ─── */
.modal-summary {
  background: linear-gradient(180deg, rgba(237, 129, 54, 0.04), transparent),
              var(--surface-2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem 1.2rem;
  margin: 0.4rem 0 1.6rem;
}
.modal-summary-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.modal-summary p {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
}
.modal-summary strong { color: var(--accent); font-weight: 700; }
.modal-summary code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(237, 129, 54, 0.08);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  color: var(--cyan);
}

/* ─── Long-form prose (description / "about" body) ─── */
.modal-prose {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text);
}
.modal-prose p { margin: 0 0 0.95rem; }
.modal-prose p:last-child { margin-bottom: 0; }

/* ─── Walkthrough sections ─── */
.modal-walk {
  margin: 0.2rem 0;
}
.modal-step {
  padding: 0 0 0 1.1rem;
  border-left: 1px solid var(--border);
  margin: 0 0 2.1rem;
  position: relative;
}
.modal-step:hover { border-left-color: var(--border-strong); }
.modal-step:last-child { margin-bottom: 0.4rem; }

.modal-step-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.65rem;
  letter-spacing: -0.005em;
  line-height: 1.3;
  position: relative;
}
.modal-step-title::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.55em;
  width: 0.55rem;
  height: 1px;
  background: var(--accent);
}

.modal-step-body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}
.modal-step-body p { margin: 0 0 0.85rem; }
.modal-step-body p:last-child { margin-bottom: 0; }

/* ─── Fenced code blocks (multi-line) ─── */
.code-block {
  background: #07090d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  margin: 0.85rem 0 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.code-block code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  white-space: pre;
  word-break: normal;
  font-family: inherit;
  font-size: inherit;
}
.code-block::-webkit-scrollbar { height: 6px; }
.code-block::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* ─── Inline code (within prose) ─── */
.modal-step-body code,
.modal-prose code,
.modal-list code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(237, 129, 54, 0.07);
  border: 1px solid var(--border);
  padding: 0.05em 0.4em;
  border-radius: 3px;
  color: var(--cyan);
  white-space: nowrap;
  word-break: keep-all;
}
.modal-step-body strong,
.modal-prose strong,
.modal-list strong {
  color: var(--accent);
  font-weight: 700;
}

/* ─── Bullet lists (build details / highlights / recommendations) ─── */
.modal-list {
  list-style: none;
  padding-left: 0;
  font-family: var(--font-sans);
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text);
}
.modal-list li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.25rem;
  margin-bottom: 0.2rem;
}
.modal-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.95em;
  width: 0.45rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

/* Backward compat — kept tiny so anything still referencing it doesn't break */
.modal-body-text { font-size: 0.95rem; line-height: 1.65; color: var(--text); font-family: var(--font-sans); }

/* Takeaway pull-quote — closes the walkthrough on a single reflective line */
.modal-takeaway {
  margin: 2.2rem 0 0.6rem;
  padding: 1.3rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, rgba(237, 129, 54, 0.05), transparent 80%),
              var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.modal-takeaway::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
}
.modal-takeaway .takeaway-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.modal-takeaway p {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
  font-weight: 500;
}

/* ─── Inline figures (within step bodies / description) ─── */
.inline-figure {
  margin: 1.1rem 0 0.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.inline-figure img {
  width: 100%;
  height: auto;
  max-height: 580px;
  object-fit: contain;
  display: block;
  background: #07090d;
}
.inline-figure figcaption {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.65rem 0.95rem 0.75rem;
  border-top: 1px solid var(--border);
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}
.inline-figure.desc-figure {
  max-width: 640px;
  margin: 1.1rem auto 0.4rem;
}
.inline-figure.step-figure,
.inline-figure.chain-figure {
  margin: 1rem 0 0.4rem;
  border-color: var(--border-strong);
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.4rem;
}
.modal-images figure {
  margin: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.modal-images figure:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.modal-images img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #07090d;
}
.modal-images figcaption {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--border);
  line-height: 1.45;
  font-style: italic;
}

@media (max-width: 640px) {
  .modal { padding: 1rem 0.5rem; }
  .modal-panel { max-height: calc(100vh - 2rem); }
  .modal-content { padding: 1.2rem 1.1rem 1.4rem; }
  .modal-title { font-size: 1.1rem; }
}

/* Reduced motion */
@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;
  }
}
