/* ═══════════════════════════════════════════════
   AYMANE BERHOUA — Personal Website
   style.css
   ═══════════════════════════════════════════════ */

/* ─── RESET & BASE ─────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue-900: #0a1628;
  --blue-800: #0d1f3c;
  --blue-700: #112a52;
  --blue-600: #1a3d6e;
  --blue-500: #1e5799;
  --blue-400: #2874cc;
  --blue-300: #4a9eff;
  --blue-200: #7dbfff;
  --blue-100: #b8d9ff;
  --blue-50: #e8f3ff;

  --bg: #070d18;
  --bg-card: #0d1628;
  --bg-dark: #050c15;

  --text: #e8eef8;
  --text-muted: #6b84a8;
  --text-dim: #3d5278;

  --accent: #2874cc;
  --accent-light: #4a9eff;
  --accent-glow: rgba(40, 116, 204, 0.35);

  --border: rgba(40, 116, 204, 0.15);
  --border2: rgba(40, 116, 204, 0.3);
  --border3: rgba(255, 255, 255, 0.06);

  --mono: "JetBrains Mono", "Courier New", monospace;
  --display: "Bebas Neue", "Impact", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-blue: 0 0 0 1px var(--border2), 0 8px 32px rgba(40, 116, 204, 0.15);
  --nav-h: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}

/* Noise grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* ─── FLOATING SQUARES CANVAS ──────────────────── */
#squares-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ensure all content layers sit above the canvas */
.nav,
.hero,
.section,
.connect-section,
.footer {
  position: relative;
  z-index: 1;
}

/* ─── SCROLLBAR ────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--blue-600);
  border-radius: 2px;
}

/* ─── CURSOR ───────────────────────────────────── */
.cursor,
.cursor-trail {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition:
    width var(--transition),
    height var(--transition);
}
.cursor {
  width: 8px;
  height: 8px;
  background: var(--accent-light);
}
.cursor-trail {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border2);
  background: transparent;
  transition:
    transform 0.12s linear,
    width var(--transition),
    height var(--transition);
}
@media (hover: none) {
  .cursor,
  .cursor-trail {
    display: none;
  }
}

/* ─── TYPOGRAPHY ───────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
}

/* ─── CONTAINER ────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── BUTTONS ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition);
  border: 1px solid transparent;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(40, 116, 204, 0.4);
}
.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 28px rgba(74, 158, 255, 0.5);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border2);
}
.btn-outline:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
}
.btn-lg {
  font-size: 14px;
  padding: 1rem 2.25rem;
}

/* ─── TAGS ─────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border2);
  border-radius: 100px;
  color: var(--blue-200);
  background: rgba(40, 116, 204, 0.07);
  letter-spacing: 0.04em;
}

/* ─── SECTIONS ─────────────────────────────────── */
.section {
  padding: 7rem 0;
}
.section-dark {
  background: var(--bg-dark);
  border-top: 1px solid var(--border3);
  border-bottom: 1px solid var(--border3);
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3.5rem;
}
.section-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  font-size: clamp(36px, 5vw, 56px);
}

/* ─── REVEAL ───────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal]:nth-child(2) {
  transition-delay: 0.1s;
}
[data-reveal]:nth-child(3) {
  transition-delay: 0.2s;
}
[data-reveal]:nth-child(4) {
  transition-delay: 0.3s;
}

/* ═══════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 2.5rem;
  background: rgba(7, 13, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border3);
  transition:
    background var(--transition),
    border-color var(--transition);
}
.nav.scrolled {
  background: rgba(7, 13, 24, 0.98);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 210;
}
.logo-bracket {
  color: var(--accent-light);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.nav-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition);
}
.nav-link:hover {
  color: var(--text);
}
.nav-num {
  color: var(--accent);
  font-size: 10px;
}
.nav-cta {
  color: var(--accent-light) !important;
  border: 1px solid var(--border2);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  transition:
    background var(--transition),
    color var(--transition) !important;
}
.nav-cta:hover {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 210;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 195;
  backdrop-filter: blur(2px);
}
.nav-backdrop.visible {
  display: block;
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: calc(var(--nav-h) + 4rem) 2.5rem 5rem;
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
}
.hero-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(40, 116, 204, 0.12) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    black 30%,
    transparent 100%
  );
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border2);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  background: rgba(40, 116, 204, 0.06);
  opacity: 0;
  animation: fadeUp 0.7s 0.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.status-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  background: #3dffa0;
  border-radius: 50%;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(61, 255, 160, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(61, 255, 160, 0);
  }
}

.hero-name {
  font-family: var(--display);
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.hero-name-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.hero-name-line:nth-child(1) {
  animation-delay: 0.25s;
}
.hero-name-line:nth-child(2) {
  animation-delay: 0.4s;
}
.hero-name-blue {
  color: var(--accent-light);
  -webkit-text-stroke: 1px var(--accent);
}

.hero-tagline {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 420px;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2.25rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.7s 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.code-kw {
  color: var(--accent-light);
}
.code-var {
  color: #7ddfff;
}
.code-str {
  color: #a8e6a3;
}
.code-comment {
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-right {
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.9s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.hero-photo-frame {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.hero-photo {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  filter: grayscale(15%);
  transition: filter var(--transition);
}
.hero-photo:hover {
  filter: grayscale(0%);
}
.hero-photo-border {
  position: absolute;
  inset: -10px -10px 10px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  z-index: -1;
}
.hero-photo-badge {
  position: absolute;
  bottom: -1rem;
  left: -1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(40, 116, 204, 0.45);
}
.hero-photo-badge span {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
}
.hero-photo-badge small {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.8;
  letter-spacing: 0.1em;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s 1.2s ease forwards;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollAnim 2s ease-in-out infinite;
}
@keyframes scrollAnim {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1.3);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.about-bio p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-size: 15.5px;
}
.about-bio p strong {
  color: var(--text);
  font-weight: 500;
}
.about-closing {
  color: var(--accent-light) !important;
  font-family: var(--mono);
  font-size: 14px !important;
  margin-top: 1.5rem !important;
}
.about-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-200);
  border: 1px solid var(--border2);
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(40, 116, 204, 0.06);
}
.lang-flag {
  font-size: 14px;
}
.lang-level {
  color: var(--text-dim);
  font-size: 10px;
  margin-left: 2px;
}

/* ─── INTERESTS ROW ─────────────────────────── */
.interests-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
}
.interest-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition:
    border-color var(--transition),
    transform var(--transition);
}
.interest-chip:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.interest-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: rgba(40, 116, 204, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.interest-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.interest-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.interest-val {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}

/* ─── STOIC QUOTE ───────────────────────────── */
.stoic-quote {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  position: relative;
}
.stoic-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.stoic-portrait {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border2);
  filter: grayscale(30%) sepia(20%);
  transition: filter var(--transition);
}
.stoic-portrait:hover {
  filter: grayscale(0%) sepia(10%);
}
.stoic-body {
  position: relative;
  flex: 1;
}
.stoic-mark {
  font-family: var(--display);
  font-size: 48px;
  line-height: 0.6;
  color: var(--accent);
  opacity: 0.3;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.stoic-text {
  font-size: 13.5px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}
.stoic-attr {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-light);
  letter-spacing: 0.05em;
  padding-left: 1.25rem;
  display: block;
}

/* ─── STATS GRID ────────────────────────────── */
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition:
    border-color var(--transition),
    transform var(--transition);
}
.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
}
.stat-icon {
  font-size: 22px;
  margin-bottom: 0.25rem;
}
.stat-value {
  font-family: var(--display);
  font-size: 38px;
  color: var(--accent-light);
  line-height: 1;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════
   SKILLS
   ═══════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.skill-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}
.skill-item:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
}
.skill-item-ai {
  border-color: rgba(40, 116, 204, 0.25);
  background: linear-gradient(
    135deg,
    var(--bg-card) 80%,
    rgba(40, 116, 204, 0.06)
  );
}
.skill-item-ai:hover {
  border-color: var(--accent-light);
  box-shadow:
    0 0 0 1px var(--accent-light),
    0 8px 32px rgba(74, 158, 255, 0.18);
}
.skill-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.skill-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.skill-icon {
  width: 36px;
  height: 36px;
  background: rgba(40, 116, 204, 0.1);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent-light);
  flex-shrink: 0;
}
.skill-name {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.skill-pct {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-light);
}
.skill-bar-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  width: 0%;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.timeline-item {
  position: relative;
  padding: 0 0 3.5rem 2.5rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -2.6rem;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow:
    0 0 0 3px var(--border2),
    0 0 12px var(--accent-glow);
}
.timeline-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-light);
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}
.timeline-role {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.timeline-org {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
}
.timeline-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 640px;
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════
   ACHIEVEMENTS
   ═══════════════════════════════════════════════ */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.ach-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition:
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.ach-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.ach-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-blue);
}
.ach-card:hover::before {
  opacity: 1;
}
.ach-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}
.ach-title {
  font-size: 19px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.ach-org {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-light);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.ach-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}
.ach-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  filter: grayscale(20%);
  transition: filter var(--transition);
}
.ach-photo:hover {
  filter: grayscale(0%);
}
.cert-img-wrap {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.cert-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  padding: 0.5rem;
  transition: transform var(--transition);
}
.cert-img:hover {
  transform: scale(1.03);
}

/* ═══════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════ */
.gallery-sub-label {
  margin: 3rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.gallery-sub-label:first-of-type {
  margin-top: 0;
}
.gallery-sub-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border3);
}
.gallery-sub-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-light);
  letter-spacing: 0.07em;
  padding: 4px 12px;
  border: 1px solid var(--border2);
  border-radius: 100px;
  background: rgba(40, 116, 204, 0.07);
  white-space: nowrap;
}

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

.gallery-wide,
.gallery-tall {
  grid-column: unset;
  grid-row: unset;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 4/3;
}

.gallery-item.gallery-tall {
  aspect-ratio: 4/3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.4s;
  filter: grayscale(10%) brightness(0.92);
}
.gallery-item:hover img {
  transform: scale(1.05);
  filter: grayscale(0%) brightness(1);
}
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(7, 13, 24, 0.95), transparent);
  padding: 2.5rem 1rem 0.85rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue-100);
  letter-spacing: 0.05em;
  transform: translateY(100%);
  transition: transform var(--transition);
}
.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   CONNECT
   ═══════════════════════════════════════════════ */
.connect-section {
  background: var(--bg-dark);
  border-top: 1px solid var(--border3);
}
.connect-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.connect-inner {
  max-width: 100%;
}
.connect-headline {
  font-size: clamp(52px, 6vw, 100px);
  line-height: 0.95;
  margin-bottom: 1.75rem;
  margin-top: 1rem;
}
.connect-blue {
  color: var(--accent-light);
  -webkit-text-stroke: 1px var(--accent);
}
.connect-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}
.connect-socials {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: 13px;
  flex-wrap: wrap;
}
.social-link {
  color: var(--text-muted);
  transition: color var(--transition);
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border);
}
.social-link:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}
.social-sep {
  color: var(--text-dim);
}

/* Connect right panel */
.connect-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.connect-panel-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
}
.connect-panel-terminal .t-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}
.connect-panel-terminal .t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.t-dot-r {
  background: #ff5f57;
}
.t-dot-y {
  background: #febc2e;
}
.t-dot-g {
  background: #28c840;
}
.t-line {
  color: var(--text-dim);
}
.t-line .t-prompt {
  color: var(--accent-light);
}
.t-line .t-cmd {
  color: var(--text);
}
.t-line .t-out {
  color: #3dffa0;
}
.t-line .t-str {
  color: #a8e6a3;
}
.t-line .t-dim {
  color: var(--text-dim);
}

.connect-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.connect-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition:
    border-color var(--transition),
    transform var(--transition);
}
.connect-stat:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}
.connect-stat-val {
  font-family: var(--display);
  font-size: 32px;
  color: var(--accent-light);
  line-height: 1;
}
.connect-stat-lbl {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border3);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-logo {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
}
.footer-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.footer-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET  769px – 1024px
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: calc(var(--nav-h) + 3rem);
    gap: 3rem;
  }
  .hero-right {
    justify-content: flex-start;
  }
  .hero-photo-frame {
    max-width: 320px;
  }
  .hero-scroll-hint {
    display: none;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .ach-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid,
  .gallery-samsung {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-wide,
  .gallery-tall {
    grid-column: unset;
    grid-row: unset;
  }
  .connect-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .connect-panel {
    display: none;
  }
  .interests-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 768px
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Nav */
  .nav {
    padding: 0 1.25rem;
  }
  .nav-toggle {
    display: flex;
  }

  /* Slide-in drawer */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(80vw, 300px);
    height: 100dvh;
    background: #0d1628;
    border-left: 1px solid rgba(40, 116, 204, 0.2);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.75rem;
    padding: 5rem 2rem 3rem;
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 205;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  }
  .nav-menu.open {
    transform: translateX(0);
  }
  .nav-link {
    font-size: 15px !important;
    color: var(--text) !important;
  }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: unset;
    padding: calc(var(--nav-h) + 2rem) 1.25rem 3.5rem;
    gap: 2rem;
  }
  .hero-left {
    order: 2;
    text-align: center;
  }
  .hero-right {
    order: 1;
    justify-content: center;
  }
  .hero-photo-frame {
    max-width: 200px;
    margin: 0 auto;
  }
  .hero-photo-badge {
    bottom: -0.75rem;
    left: -0.75rem;
  }
  .hero-name {
    font-size: clamp(52px, 14vw, 80px);
  }
  .hero-status {
    justify-content: center;
  }
  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-scroll-hint {
    display: none;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    justify-content: center;
  }

  /* Sections */
  .section {
    padding: 4rem 0;
  }
  .container {
    padding: 0 1.25rem;
  }
  .section-title {
    font-size: clamp(30px, 8vw, 44px);
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
  .interests-row {
    grid-template-columns: 1fr;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.25rem;
  }
  .timeline-item {
    padding-left: 1.75rem;
  }
  .timeline-dot {
    left: -1.75rem;
  }

  /* Achievements */
  .ach-grid {
    grid-template-columns: 1fr;
  }

  /* Gallery — single column, all equal */
  .gallery-grid,
  .gallery-samsung {
    grid-template-columns: 1fr;
  }
  .gallery-wide,
  .gallery-tall {
    grid-column: unset;
    grid-row: unset;
  }
  .gallery-item,
  .gallery-item.gallery-tall {
    aspect-ratio: 16/9;
  }
  .gallery-sub-tag {
    font-size: 10px;
  }

  /* Connect */
  .connect-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .connect-panel {
    display: none;
  }
  .connect-headline {
    font-size: clamp(44px, 12vw, 72px);
  }
  .connect-sub br {
    display: none;
  }
  .connect-socials {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .social-sep {
    display: none;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .footer-code {
    display: none;
  }

  /* Reduce square count on mobile for performance */
  #squares-canvas {
    opacity: 0.7;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — SMALL  ≤ 480px
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero-name {
    font-size: clamp(46px, 13vw, 64px);
  }
  .about-stats {
    grid-template-columns: 1fr;
  }
  .interests-row {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #squares-canvas {
    display: none;
  }
}
