/* ==========================================================================
   Mehdi CHIBANI – Portfolio
   Palette taken from the reference visual: deep navy + electric blue,
   with React-cyan / Flutter-blue / Android-green as small accents.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #070d1a;
  --bg-alt: #0a1224;
  --surface: #0e182e;
  --surface-2: #131f3a;
  --border: rgba(148, 170, 214, 0.14);
  --border-strong: rgba(148, 170, 214, 0.28);

  --text: #eaf0fd;
  --text-soft: #b6c3df;
  --muted: #8493b3;

  --accent: #2f7cff;
  --accent-hi: #5b9bff;
  --accent-soft: rgba(47, 124, 255, 0.14);
  --cyan: #4cc9ff; /* Flutter / React cyan */
  --green: #3ddc84; /* Android */
  --amber: #ffb547;

  --on-accent: #ffffff;
  --header-bg: rgba(7, 13, 26, 0.72);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.65);
  --glow: 0 0 0 1px rgba(47, 124, 255, 0.35), 0 10px 40px -10px rgba(47, 124, 255, 0.55);

  --radius: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --header-h: 68px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #f4f7fd;
  --bg-alt: #eaf0fb;
  --surface: #ffffff;
  --surface-2: #f1f5fd;
  --border: rgba(30, 58, 110, 0.12);
  --border-strong: rgba(30, 58, 110, 0.25);

  --text: #0b1530;
  --text-soft: #34456b;
  --muted: #5d6e92;

  --accent: #1f6bff;
  --accent-hi: #1f6bff;
  --accent-soft: rgba(31, 107, 255, 0.1);
  --cyan: #0a8fd0;
  --green: #139a57;
  --amber: #b9740b;

  --header-bg: rgba(244, 247, 253, 0.8);
  --shadow: 0 18px 40px -22px rgba(20, 44, 100, 0.35);
  --glow: 0 0 0 1px rgba(31, 107, 255, 0.35), 0 10px 30px -10px rgba(31, 107, 255, 0.4);
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 6px;
}
.mono {
  font-family: var(--mono);
}
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: block;
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn .icon {
  transition: transform 0.25s;
}
.btn:hover .icon-arrow {
  transform: translateX(4px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4a90ff);
  color: var(--on-accent);
  box-shadow: 0 10px 28px -10px rgba(47, 124, 255, 0.8);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(47, 124, 255, 0.95);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent-hi);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.btn-lg {
  padding: 1rem 1.8rem;
  font-size: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chips li {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.soon-pill,
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}
.soon-pill {
  color: var(--muted);
  border: 1px dashed var(--border-strong);
}
.link-pill.play {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  transition: background 0.2s, transform 0.2s;
}
.link-pill.play:hover {
  background: color-mix(in srgb, var(--green) 22%, transparent);
  transform: translateY(-1px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.site-header.scrolled,
.menu-open .site-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  box-shadow: 0 8px 20px -8px rgba(47, 124, 255, 0.8);
}
.brand-name b {
  color: var(--accent-hi);
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--accent-soft);
}
.nav a.active {
  color: var(--accent-hi);
}
.nav .nav-cta {
  margin-left: 0.4rem;
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 600;
}
.nav .nav-cta:hover {
  background: var(--accent-hi);
  color: var(--on-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.icon-btn:hover {
  border-color: var(--accent-hi);
  background: var(--accent-soft);
}
.icon-btn .icon {
  width: 1.2rem;
  height: 1.2rem;
}
.ico-sun {
  display: none !important;
}
[data-theme="light"] .ico-sun {
  display: inline-flex !important;
}
[data-theme="light"] .ico-moon {
  display: none !important;
}
.menu-btn {
  display: none;
}
.menu-btn .ico-close {
  display: none;
}
.menu-open .menu-btn .ico-open {
  display: none;
}
.menu-open .menu-btn .ico-close {
  display: inline-flex;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 4rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.glow-a {
  width: 520px;
  height: 520px;
  top: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(47, 124, 255, 0.65), transparent 70%);
}
.glow-b {
  width: 420px;
  height: 420px;
  bottom: -120px;
  left: -140px;
  background: radial-gradient(circle, rgba(76, 201, 255, 0.35), transparent 70%);
}
[data-theme="light"] .glow {
  opacity: 0.4;
}
.grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.45;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 1.1rem;
}
.eyebrow-line {
  width: 34px;
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
}
.hero-name {
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero-name span {
  display: block;
}
.hero-name .last {
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 30%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-role {
  margin-top: 1.4rem;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-soft);
}

.tech-icons {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.6rem;
}
.tech-icons li:not(.sep) {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.25s, border-color 0.25s;
}
.tech-icons li:not(.sep):hover {
  transform: translateY(-3px) rotate(-4deg);
  border-color: var(--border-strong);
}
.tech-icons .icon {
  width: 24px;
  height: 24px;
}
.t-react {
  color: #61dafb;
}
.t-flutter {
  color: #3fb6ff;
}
.t-spring {
  color: #6db33f;
}
.t-apple {
  color: var(--text);
}
.t-android {
  color: var(--green);
}
.tech-icons .sep {
  width: 1px;
  height: 26px;
  background: var(--border-strong);
}

.hero-tagline {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--text-soft);
  font-size: 1.05rem;
}
.feature-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 0.75rem clamp(2rem, 6vw, 4.5rem);
}
.feature-grid li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.feature-grid .icon {
  color: var(--accent-hi);
  width: 1.3rem;
  height: 1.3rem;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2.2rem;
}
.hero-contacts,
.hero-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.phone-btn,
.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 44px;
  padding: 0 1.05rem 0 0.8rem;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.phone-btn .icon,
.email-btn .icon {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent-hi);
}
.phone-btn:hover,
.email-btn:hover {
  color: var(--accent-hi);
  border-color: var(--accent-hi);
  background: var(--accent-soft);
  transform: translateY(-3px);
}
.social-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-soft);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.social-btn:hover {
  color: var(--accent-hi);
  border-color: var(--accent-hi);
  background: var(--accent-soft);
  transform: translateY(-3px);
}
.social-btn .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* hero photo */
.hero-media {
  position: relative;
  justify-self: end;
  width: min(100%, 560px);
}
.photo-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), 0 0 80px -20px rgba(47, 124, 255, 0.45);
  aspect-ratio: 4 / 4.4;
  background: var(--surface);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7, 13, 26, 0.55)),
    linear-gradient(90deg, rgba(47, 124, 255, 0.12), transparent 40%);
  pointer-events: none;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 50%;
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: 22px -18px -18px 22px;
  border-radius: 28px;
  border: 1px dashed var(--border-strong);
  z-index: -1;
}
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.chip .icon {
  width: 1.05rem;
  height: 1.05rem;
}
.chip-b {
  right: 18px;
  top: 18px;
  animation-delay: -2s;
}
.chip-b .icon {
  color: var(--amber);
}
.chip-c {
  right: -14px;
  bottom: 28px;
  font-family: var(--mono);
  font-size: 0.74rem;
  animation-delay: -4s;
}
.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 25%, transparent);
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* stats */
.stats {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.2rem;
  padding: 1.4rem 1.5rem;
  border-left: 1px solid var(--border);
}
.stat:first-child {
  border-left: 0;
}
.stat dd {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.stat dd {
  background: linear-gradient(100deg, var(--text) 40%, var(--accent-hi));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat dt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
}
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-hi);
  margin-bottom: 0.9rem;
}
.kicker::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.section-sub {
  margin-top: 0.9rem;
  color: var(--text-soft);
  font-size: 1.05rem;
}
.subhead {
  margin: clamp(2.5rem, 5vw, 4rem) 0 1.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* reveal on scroll (only when JS is available) */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about-text p + p,
.about-text .section-title + p {
  margin-top: 1.1rem;
}
.about-text p:not(.kicker) {
  color: var(--text-soft);
}
.about-text .section-title {
  margin-bottom: 1.4rem;
}
.skills-card {
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.skills-title {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.skills-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 14px 0 0 var(--amber), 28px 0 0 #ff6b6b;
  margin-right: 28px;
}
.skill-group + .skill-group {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border);
}
.skill-group h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 1.6rem;
  padding-left: 2.2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border) 60%, transparent);
}
.tl-item {
  position: relative;
}
.tl-dot {
  position: absolute;
  left: calc(-2.2rem + 1px);
  top: 1.9rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--accent);
}
.tl-dot.is-current {
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 124, 255, 0.55);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(47, 124, 255, 0);
  }
}
.tl-card {
  padding: clamp(1.2rem, 3vw, 1.9rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.3s;
}
.tl-card:hover {
  border-color: var(--border-strong);
}
.tl-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.tl-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-weight: 800;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  flex: none;
}
.tl-head-text {
  flex: 1;
  min-width: 14rem;
}
.tl-head-text h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}
.tl-head-text p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.tl-head-text a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-hi);
  font-weight: 600;
}
.tl-head-text a .icon {
  width: 0.8rem;
  height: 0.8rem;
}
.tl-head-text a:hover {
  text-decoration: underline;
}
.dot-sep {
  margin-inline: 0.25rem;
  opacity: 0.6;
}
.period {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  white-space: nowrap;
}
.period.is-current {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}
.tl-stack {
  margin-top: 1.3rem;
}
.label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.missions-label {
  margin-top: 1.5rem;
}
.missions {
  display: grid;
  gap: 0.7rem;
}
.mission {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.25s;
}
.mission[open] {
  border-color: var(--border-strong);
}
.mission summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  list-style: none;
}
.mission summary::-webkit-details-marker {
  display: none;
}
.mission-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 12px;
}
.mission-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mission-title {
  font-weight: 700;
}
.mission-client {
  font-size: 0.85rem;
  color: var(--muted);
}
.mission-period {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-soft);
  white-space: nowrap;
}
.mission-period .icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--accent-hi);
}
.mission-chevron .icon {
  transition: transform 0.3s;
  color: var(--muted);
}
.mission[open] .mission-chevron .icon {
  transform: rotate(180deg);
}
.mission-body {
  padding: 0 1.1rem 1.2rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.bullets {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}
.bullets li {
  position: relative;
  padding-left: 1.4rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}
.mission-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

/* internships */
.intern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.intern-card {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.3s, border-color 0.3s;
}
.intern-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.intern-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--accent-hi);
  font-weight: 700;
}
.intern-meta .mono {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.intern-card h4 {
  font-size: 1.05rem;
  line-height: 1.35;
}
.intern-card > p:not(.intern-meta) {
  color: var(--text-soft);
  font-size: 0.92rem;
  flex: 1;
}

/* ---------- Shipped apps ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: start;
}
.app-card {
  --h: 212;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 110px;
  background: radial-gradient(120% 100% at 50% 0%, hsl(var(--h) 90% 55% / 0.22), transparent 70%);
  pointer-events: none;
}
.app-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.app-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px; /* app-icon "squircle" feel */
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 90% 60%), hsl(calc(var(--h) + 35) 85% 42%));
  box-shadow: 0 14px 28px -12px hsl(var(--h) 90% 50% / 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.app-icon--logo {
  object-fit: cover;
  background: #fff;
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.55);
}
.app-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.app-info p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.app-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
}
.app-link span:nth-child(2) {
  flex: 1;
}
.app-link .icon:last-child {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.7;
}
.app-link:hover {
  text-decoration: underline;
}
button.app-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: zoom-in;
  text-align: left;
}

.app-card--shot {
  padding-top: 0;
}
.app-card--shot::before {
  display: none;
}
.app-shot {
  position: relative;
  display: block;
  width: calc(100% + 3rem);
  margin: 0 -1.5rem 0.15rem;
  padding: 0;
  border: 0;
  background: #07101f;
  cursor: zoom-in;
  overflow: hidden;
}
.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.app-shot:hover img,
.app-shot:focus-visible img {
  transform: scale(1.045);
}
.app-shot-zoom {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: rgba(7, 13, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
.app-shot-zoom .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.app-shot:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: -3px;
}

/* ---------- Image lightbox ---------- */
body.lightbox-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.lightbox[hidden] {
  display: none;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: zoom-out;
  background: rgba(4, 8, 18, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1080px, 100%);
}
.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 2.5rem);
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75);
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  color: #fff;
  background: rgba(7, 13, 26, 0.72);
  cursor: pointer;
}
.lightbox-close:hover {
  background: rgba(7, 13, 26, 0.9);
}
.lightbox-close .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem;
}
.project-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project-card:nth-child(-n + 2) {
  grid-column: span 3;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-hi);
  box-shadow: var(--glow);
}
.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.project-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--accent-hi);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.project-icon .icon {
  width: 1.4rem;
  height: 1.4rem;
}
.status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}
.status.progress {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
}
.status.done {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}
.project-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 0.3rem;
}
.project-period {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -0.4rem;
}
.project-desc {
  color: var(--text-soft);
  font-size: 0.93rem;
  flex: 1;
}
.project-card .soon-pill {
  margin-top: 0.4rem;
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}
.edu-card {
  position: relative;
  padding: 1.8rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.edu-year {
  position: absolute;
  right: 1.2rem;
  top: 0.4rem;
  font-size: 3.6rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.14;
  line-height: 1;
  user-select: none;
}
.edu-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 1.1rem;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
}
.edu-icon .icon {
  width: 1.4rem;
  height: 1.4rem;
}
.edu-card h3 {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
}
.edu-card p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Contact ---------- */
.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4rem);
  border-radius: 28px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.contact-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  right: -140px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 124, 255, 0.5), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
.contact-card > :not(.contact-glow) {
  position: relative;
}
.contact-card .section-sub {
  max-width: 36rem;
}
.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 2rem 0 2.2rem;
  max-width: 44rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.contact-item:hover {
  border-color: var(--accent-hi);
  transform: translateY(-2px);
  background: var(--accent-soft);
}
.contact-item > [data-icon] {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  flex: none;
}
.contact-item small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-weight: 600;
}
.to-top .up .icon {
  transform: rotate(-90deg);
}
.to-top:hover {
  color: var(--accent-hi);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  /* mobile nav = dropdown panel */
  .menu-btn {
    display: grid;
  }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 1rem 1.25rem 1.4rem;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .menu-open .nav {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav a {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-radius: 12px;
  }
  .nav .nav-cta {
    margin: 0.4rem 0 0;
    text-align: center;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-media {
    justify-self: center;
    width: min(100%, 520px);
    margin-top: 0.5rem;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-card,
  .project-card:nth-child(-n + 2) {
    grid-column: span 1;
  }
  .project-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  :root {
    --header-h: 62px;
  }
  .container {
    width: min(100% - 2rem, var(--container));
  }
  .brand-name {
    display: none;
  }
  .hero-name {
    font-size: clamp(2.7rem, 15vw, 3.6rem);
  }
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
  }
  .hero-actions,
  .hero-ctas {
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .chip-c {
    right: -6px;
  }
  .hero-media::before {
    inset: 14px -8px -10px 14px;
  }

  .timeline {
    padding-left: 1.5rem;
  }
  .timeline::before {
    left: 4px;
  }
  .tl-dot {
    left: calc(-1.5rem - 2px);
    top: 1.6rem;
  }
  .tl-head {
    align-items: flex-start;
  }
  .tl-head-text {
    min-width: 0;
    flex-basis: calc(100% - 70px);
  }
  .period {
    order: 3;
  }
  .mission summary {
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
  }
  .mission-main {
    flex: 1 1 calc(100% - 90px);
  }
  .mission-period {
    order: 3;
  }
  .mission-chevron {
    margin-left: auto;
    order: 2;
  }

  .intern-grid,
  .edu-grid,
  .contact-list {
    grid-template-columns: 1fr;
  }
  .apps-grid {
    grid-template-columns: 1fr;
  }
  .app-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .app-card .app-info {
    flex: 1;
    min-width: 0;
  }
  .app-card .app-link {
    flex-basis: 100%;
  }
  .app-card--shot {
    flex-direction: column;
    align-items: stretch;
  }
  .app-card--shot .app-shot {
    flex-basis: auto;
    width: calc(100% + 3rem);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card,
  .project-card:nth-child(-n + 2),
  .project-card:last-child:nth-child(odd) {
    grid-column: span 1;
  }
  .stat {
    padding: 1.1rem;
  }
  .btn-lg {
    width: 100%;
    justify-content: center;
  }
  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .lang-switch button {
    padding: 0.3rem 0.55rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
