/* ==========================================================================
   Secure Signal — portfolio theme
   Telecom × cybersecurity. Dark by default, light via [data-theme="light"].
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0e14;
  --bg-alt: #0e131b;
  --surface: #121924;
  --surface-2: #18212f;
  --border: #223044;
  --text: #e6edf3;
  --text-muted: #8b98a9;
  --accent: #00e5a8;
  --accent-2: #3b82f6;
  --accent-soft: rgba(0, 229, 168, .12);
  --danger: #ff5f56;
  --warn: #ffbd2e;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));

  /* Text-safe variants (equal to the accents in dark mode; darker in light
     mode so small text and gradient headings pass WCAG AA). */
  --accent-text: var(--accent);
  --danger-text: #ff7b72;
  --grad-text: var(--grad);

  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 72px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);

  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --on-accent: #04110d;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #dbe3ee;
  --text: #0f172a;
  --text-muted: #5b6b80;
  --accent: #00a87a;
  --accent-2: #2563eb;
  --accent-soft: rgba(0, 168, 122, .1);

  --accent-text: #007a5a;
  --danger-text: #c62828;
  --grad-text: linear-gradient(120deg, #007a5a, #2563eb);
  --shadow: 0 20px 50px -24px rgba(15, 23, 42, .22);

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 200;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

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

/* Background grid, fading out from the top centre */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .25;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 75%);
}

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Pulsing status dot */
.pulse-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--grad);
  color: var(--on-accent);
  font-family: var(--font-sans);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--accent) 75%, transparent);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s, color .2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn .icon { width: 18px; height: 18px; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: none;
}

.btn--small { padding: .55rem 1.15rem; font-size: .9rem; }
.btn--full { width: 100%; }

/* ---------- Tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tag {
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.5;
}

/* ---------- Sections ---------- */
.section { position: relative; padding: 110px 0; }
.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head { margin-bottom: 3.5rem; }
.section__head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.section__label {
  margin-bottom: .9rem;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .04em;
}

.section__title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .9rem;
  text-align: center;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.nav.is-scrolled,
.nav.is-menu-open {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-right: auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
}
.nav__logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-weight: 700;
}
.nav__logo-accent { color: var(--accent-text); }

.nav__menu { display: flex; align-items: center; gap: 2rem; }

.nav__links {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: .35rem 0;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover,
.nav__link.is-active { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__sun { display: block; }
[data-theme="light"] .theme-toggle__moon { display: none; }

.nav__burger {
  position: relative;
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.nav__burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav__burger span:nth-child(1) { top: 12px; }
.nav__burger span:nth-child(2) { top: 18px; }
.nav__burger span:nth-child(3) { top: 24px; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 48px) 0 96px;
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.6rem;
  padding: .45rem .95rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
}

.hero__title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.typed { color: var(--accent-text); }
.typed::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: .9em;
  margin-left: 4px;
  vertical-align: -0.08em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.hero__lead {
  max-width: 540px;
  margin-bottom: 2.2rem;
  color: var(--text-muted);
  font-size: 1.15rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.socials {
  display: flex;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  transition: color .2s, border-color .2s, transform .25s var(--ease);
}
.social .icon { width: 20px; height: 20px; }
.social:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Terminal card */
.hero__visual { position: relative; min-width: 0; }

.terminal {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 70px -20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.terminal__dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal__dot--red { background: #ff5f56; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green { background: #27c93f; }
.terminal__title {
  margin-left: auto;
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal__body {
  padding: 1.4rem 1.5rem 1.6rem;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.terminal__line { color: var(--text); }
.prompt { margin-right: .7rem; color: var(--accent-text); }
.terminal__out {
  margin-bottom: .55rem;
  padding-left: 1.4rem;
  color: var(--text-muted);
}
.terminal__open { margin-right: 1ch; color: var(--accent-text); }

.cursor {
  display: inline-block;
  width: .6em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

/* Signal rings behind the card's top-right corner */
.signal {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: 220px;
  height: 220px;
  transform: translate(50%, -50%);
  pointer-events: none;
}
.signal span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: ring 4s var(--ease) infinite;
}
.signal span:nth-child(2) { animation-delay: 1.3s; }
.signal span:nth-child(3) { animation-delay: 2.6s; }

@keyframes ring {
  0%   { transform: scale(.2); opacity: 0; }
  15%  { opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  text-decoration: none;
  transform: translateX(-50%);
  animation: bob 2s ease-in-out infinite;
}
.hero__scroll:hover { color: var(--accent-text); }

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* ---------- Stats strip ---------- */
.stats { position: relative; }

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.stat {
  padding: 2rem 1.5rem;
  background: var(--surface);
  text-align: center;
}
.stat__value {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  margin-top: .35rem;
  color: var(--text-muted);
  font-size: .92rem;
}

/* ---------- About ---------- */
.about { overflow-x: clip; }

.about__grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  align-items: center;
  gap: 4.5rem;
}

.about__media {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.about__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  opacity: .5;
  transform: translate(18px, 18px);
}

.about__frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.about__frame img { width: 100%; height: 100%; object-fit: cover; }
.about__frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  pointer-events: none;
}

.about__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    var(--surface);
  font-size: clamp(7rem, 16vw, 11rem);
  font-weight: 700;
  line-height: 1;
}

.about__badge {
  position: absolute;
  left: -20px;
  bottom: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 600;
}
.about__badge .icon { width: 20px; height: 20px; }

.about__text .section__title { margin-bottom: 1.6rem; }
.about__text > p:not(.section__label) {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 2rem;
  margin: 2rem 0 0;
}
.fact {
  padding-bottom: .85rem;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: .9rem;
}
.fact dt {
  margin-bottom: .3rem;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fact dd { margin: 0; color: var(--text); }
.fact--ok dd { color: var(--accent-text); }

/* ---------- Expertise ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .35s var(--ease), border-color .35s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in srgb, var(--accent) 13%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card > * { position: relative; }
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.card:hover::before { opacity: 1; }

.card__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 1.4rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.card__icon .icon { width: 26px; height: 26px; }
.card__title { margin-bottom: .6rem; font-size: 1.25rem; }
.card__text { margin-bottom: 1.3rem; color: var(--text-muted); font-size: .97rem; }

/* Skill bars */
.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 3rem;
  margin-top: 4rem;
}
.skill__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .55rem;
  font-weight: 500;
}
.skill__value {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .88rem;
}
.skill__track {
  overflow: hidden;
  height: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.skill__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width 1.4s var(--ease);
}
.skills.is-visible .skill__fill,
html:not(.js) .skill__fill { width: var(--w); }

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0;
  padding: 0 0 0 2.5rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 0;
  left: 7px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2), transparent);
}
.timeline__item { position: relative; padding-bottom: 3rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -2.5rem;
  width: 16px;
  height: 16px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.timeline__date {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .85rem;
}
.timeline__title { margin: .35rem 0 .25rem; font-size: 1.3rem; }
.timeline__company { margin-bottom: .7rem; font-weight: 500; opacity: .75; }
.timeline__text { color: var(--text-muted); }

/* ---------- Projects ---------- */
.filters {
  display: inline-flex;
  gap: .25rem;
  max-width: 100%;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.filter {
  flex: none;
  padding: .5rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.filter:hover { color: var(--text); }
.filter.is-active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.project:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--shadow);
}
.project.is-hidden { display: none; }

.project__media {
  --glow: rgba(0, 229, 168, .45);
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0b1018;
}
.project__media--1 { --glow: rgba(0, 229, 168, .45); }  /* green  */
.project__media--2 { --glow: rgba(59, 130, 246, .5); }  /* blue   */
.project__media--3 { --glow: rgba(139, 92, 246, .5); }  /* purple */
.project__media--4 { --glow: rgba(34, 211, 238, .45); } /* cyan   */
.project__media--5 { --glow: rgba(244, 63, 94, .45); }  /* rose   */
.project__media--6 { --glow: rgba(250, 204, 21, .4); }  /* yellow */

.project__cover,
.project__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform .6s var(--ease);
}
.project__img { object-fit: cover; }
.project__cover {
  background:
    radial-gradient(circle at 30% 35%, var(--glow), transparent 60%),
    radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--glow) 50%, transparent), transparent 55%),
    #0b1018;
}
.project__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 22px 22px;
}
.project:hover .project__cover,
.project:hover .project__img { transform: scale(1.06); }

.project__category {
  position: absolute;
  top: .9rem;
  left: .9rem;
  z-index: 2;
  padding: .3rem .65rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.6rem;
}
.project__title { margin-bottom: .55rem; font-size: 1.18rem; }
.project__summary { margin-bottom: 1.2rem; color: var(--text-muted); font-size: .95rem; }
.project__links {
  display: flex;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 1.3rem;
}
.project__links a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.project__links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Education & certifications ---------- */
.edu__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
  gap: 2.5rem;
}

.degrees { display: grid; gap: 1.4rem; }

.degree {
  display: flex;
  gap: 1.4rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.degree__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--grad);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
}
.degree__years {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .85rem;
}
.degree__title { margin: .3rem 0 .2rem; font-size: 1.2rem; }
.degree__school { margin-bottom: .7rem; font-weight: 500; opacity: .75; }
.degree__text { color: var(--text-muted); }

.certs {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.certs__title {
  margin-bottom: 1rem;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
}
.certs__list { margin: 0; padding: 0; list-style: none; }
.cert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .95rem 0;
  border-bottom: 1px dashed var(--border);
}
.cert:last-child { border-bottom: 0; padding-bottom: 0; }
.cert__badge {
  flex: none;
  min-width: 52px;
  padding: .35rem .45rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.cert__info { display: flex; flex-direction: column; min-width: 0; }
.cert__name { font-size: .95rem; font-weight: 500; text-decoration: none; }
a.cert__name:hover { color: var(--accent-text); }
.cert__meta { color: var(--text-muted); font-size: .8rem; }
.certs__note { margin-top: 1rem; color: var(--text-muted); font-size: .8rem; }

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: start;
  gap: 4rem;
}

.contact__intro {
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.contact__list { margin: 0; padding: 0; list-style: none; }
.contact__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.contact__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.contact__icon .icon { width: 20px; height: 20px; }
.contact__label {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.contact__value {
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.contact__value:hover { color: var(--accent-text); }

.form {
  padding: 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.2rem;
}
.form__field { margin-bottom: 1.2rem; }
.form label {
  display: block;
  margin-bottom: .45rem;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
}
.form input,
.form textarea {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: .97rem;
  transition: border-color .2s, box-shadow .2s;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input::placeholder,
.form textarea::placeholder { color: var(--text-muted); opacity: .8; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form [aria-invalid="true"] { border-color: var(--danger); }
.form__error { margin-top: .4rem; color: var(--danger-text); font-size: .82rem; }
.form__hp { display: none !important; }
.form .btn { margin-top: .4rem; }

.alert {
  margin-bottom: 1.2rem;
  padding: .85rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .92rem;
}
.alert--success {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.alert--error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .82rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer__status { display: inline-flex; align-items: center; gap: .6rem; }

/* ---------- Reveal on scroll ---------- */
/* Uses an animation on `translate` so it never fights hover `transform`s. */
.js .reveal { opacity: 0; }
.js .reveal.is-visible {
  animation: reveal .8s var(--ease) both;
  animation-delay: var(--delay, 0ms);
}
@keyframes reveal {
  from { opacity: 0; translate: 0 28px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .cards,
  .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: 80px 0; }

  /* Mobile menu: dropdown panel sliding down from under the nav */
  .nav__burger { display: block; }
  .nav__menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 16px 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .35s var(--ease), visibility 0s linear .35s;
  }
  .nav__menu.is-open {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .35s var(--ease), visibility 0s;
  }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__link { display: block; padding: .8rem 0; font-size: 1.02rem; }
  .nav__link::after { bottom: .45rem; width: 2.5rem; }
  .nav__cta { align-self: flex-start; }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 56px); }
  .hero__grid,
  .about__grid,
  .edu__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .hero__grid { gap: 3.5rem; }
  .about__grid { gap: 3.5rem; }
  .contact__grid { gap: 2.5rem; }
  .about__media { justify-self: center; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .skills { grid-template-columns: 1fr; }
  .certs { position: static; }
}

@media (max-width: 600px) {
  .cards,
  .projects,
  .facts,
  .form__row,
  .stats__grid { grid-template-columns: 1fr; }

  .hero__scroll { display: none; }
  .terminal__body { padding: 1.1rem 1.1rem 1.3rem; font-size: .78rem; }
  .terminal__out { padding-left: 1rem; }
  .signal { width: 160px; height: 160px; }

  .about__media { width: calc(100% - 18px); }
  .about__badge { left: 12px; }

  .degree { flex-direction: column; padding: 1.6rem; }
  .card,
  .certs { padding: 1.6rem; }
  .form { padding: 1.5rem; }

  .section__head--row { align-items: flex-start; }
  .filters {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; }
  .skill__fill { width: var(--w); }
  .signal { display: none; }
}
