/* ============================================================
   ABDERRAOUF ATSAMNIA — Portfolio
   Aesthetic: Light Editorial — warm cream, navy ink, terracotta
   Fonts: Playfair Display (headings) + Plus Jakarta Sans (body)
         + JetBrains Mono (code)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Backgrounds — warm cream, not harsh white */
  --bg-base:      #faf8f4;
  --bg-warm:      #f4f0e8;
  --bg-card:      #ffffff;
  --bg-elevated:  #f8f5ef;
  --bg-deep:      #ede9e0;
  --bg-ink:       #1a1814;

  /* Navy — primary ink color */
  --navy:         #1c2b4a;
  --navy-soft:    #2d4068;
  --navy-muted:   #4a5f80;
  --navy-ghost:   rgba(28, 43, 74, 0.07);
  --navy-border:  rgba(28, 43, 74, 0.12);
  --navy-border-strong: rgba(28, 43, 74, 0.22);

  /* Terracotta / rust — warm accent */
  --rust:         #c85d3a;
  --rust-soft:    #d4724f;
  --rust-pale:    rgba(200, 93, 58, 0.1);
  --rust-border:  rgba(200, 93, 58, 0.25);

  /* Sage — secondary accent */
  --sage:         #4a7c6f;
  --sage-pale:    rgba(74, 124, 111, 0.09);
  --sage-border:  rgba(74, 124, 111, 0.22);

  /* Gold — tertiary accent */
  --gold:         #a07c3a;
  --gold-pale:    rgba(160, 124, 58, 0.09);

  /* Text */
  --text-ink:     #1a1814;
  --text-body:    #2e2c28;
  --text-mid:     #6b6760;
  --text-soft:    #9e9b94;
  --text-ghost:   #bab6ae;

  /* Borders */
  --border-light: rgba(28, 43, 74, 0.08);
  --border-base:  rgba(28, 43, 74, 0.13);
  --border-strong: rgba(28, 43, 74, 0.2);

  /* Shadows */
  --shadow-xs:  0 1px 4px rgba(26,24,20,0.06);
  --shadow-sm:  0 2px 12px rgba(26,24,20,0.08);
  --shadow-md:  0 6px 28px rgba(26,24,20,0.10);
  --shadow-lg:  0 16px 56px rgba(26,24,20,0.12);
  --shadow-card: 0 2px 16px rgba(26,24,20,0.07), 0 0 0 1px rgba(28,43,74,0.07);

  /* Fonts */
  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --r-xs:  3px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-2xl: 32px;
  --r-full: 9999px;

  /* Transitions */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:  0.15s var(--ease);
  --t-base:  0.22s var(--ease);
  --t-slow:  0.38s var(--ease);
}

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

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

/* Subtle paper texture */
body::before {
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-warm); }
::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-muted); }
::selection { background: rgba(200, 93, 58, 0.15); color: var(--rust); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--navy);
}

a { color: var(--rust); text-decoration: none; transition: var(--t-base); }
a:hover { color: var(--navy); }

p {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.75;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
code {
  background: var(--bg-warm);
  border: 1px solid var(--border-base);
  border-radius: var(--r-xs);
  padding: 0.14em 0.44em;
  color: var(--rust);
}
pre {
  background: var(--navy);
  color: #e8e4da;
  border-radius: var(--r-md);
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.8;
  position: relative;
  box-shadow: var(--shadow-md);
}
pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 0.78rem;
}

/* ─── LAYOUT ──────────────────────────────────────────────── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.section    { padding: 5.5rem 0; position: relative; z-index: 1; }
.section-sm { padding: 3rem 0; }

.flex { display: flex; }
.gap-2 { gap: 0.625rem; }
.mt-3 { margin-top: 1rem; }

/* Thin ruled line across sections */
.section + .section::before {
  content: '';
  display: block;
  max-width: 1160px;
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-base) 20%, var(--border-base) 80%, transparent 100%);
}

/* ─── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 2rem;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--t-slow);
}

.navbar.scrolled {
  border-bottom-color: var(--border-base);
  box-shadow: 0 1px 0 var(--border-light), 0 8px 32px rgba(26,24,20,0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  max-width: 1160px;
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  font-style: italic;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: var(--t-base);
}
.nav-logo .logo-bracket {
  color: var(--rust);
  font-style: normal;
  margin: 0 1px;
}
.nav-logo:hover { color: var(--rust); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.38rem 0.8rem;
  border-radius: var(--r-full);
  transition: var(--t-base);
}

.nav-links a:hover {
  color: var(--navy);
  background: var(--navy-ghost);
}

.nav-links a.active {
  color: var(--rust);
  background: var(--rust-pale);
}

/* ─── HAMBURGER ───────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--navy-muted);
  border-radius: 2px;
  transition: var(--t-base);
}
.nav-hamburger:hover span { background: var(--navy); }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 62px;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}

/* Decorative arcs */
.hero::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  top: -200px; right: -180px;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  top: -80px; right: -60px;
  pointer-events: none;
}

.hero-bg-orb { display: none; } /* Remove old orbs */

.hero-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-text { animation: fadeUp 0.6s var(--ease-out) both; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sage);
  background: var(--sage-pale);
  border: 1px solid var(--sage-border);
  border-radius: var(--r-full);
  padding: 0.3rem 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.status-dot {
  width: 6px; height: 6px;
  background: var(--sage);
  border-radius: 50%;
  animation: pulse 2.8s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(74,124,111,0.4); }
  50%       { opacity: 0.75; transform: scale(0.95); box-shadow: 0 0 0 5px rgba(74,124,111,0); }
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
  line-height: 1.07;
}
.hero-name .highlight {
  color: var(--rust);
  font-style: italic;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 1.75rem;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-title::before {
  content: '';
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--rust);
  flex-shrink: 0;
}
.hero-title .typed-text { color: var(--navy); font-weight: 600; }
.hero-title .cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--rust);
  margin-left: 1px;
  animation: blink 1.1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 480px;
  margin-bottom: 2.25rem;
  line-height: 1.8;
}

.hero-cta { display: flex; gap: 0.875rem; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-base);
}

.stat-item { text-align: left; }

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
  display: block;
}

/* ─── HERO VISUAL ─────────────────────────────────────────── */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeUp 0.6s 0.12s var(--ease-out) both;
}

.profile-card {
  position: relative;
  width: 275px;
}

.profile-card-glow { display: none; } /* remove glow */

.profile-card-inner {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
}
.profile-card:hover .profile-card-inner {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.profile-img-wrap { position: relative; width: 100%; overflow: hidden; }

.profile-img-wrap img {
  width: 100%; height: 300px;
  object-fit: cover; object-position: center top;
  display: block;
  filter: grayscale(8%) contrast(1.03);
  transition: filter 0.4s ease, transform 0.5s ease;
}
.profile-card:hover .profile-img-wrap img {
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.02);
}

/* Torn paper effect at bottom of image */
.profile-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
}

.profile-img-placeholder {
  width: 100%; height: 280px;
  background: linear-gradient(160deg, var(--bg-warm) 0%, var(--bg-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.profile-img-placeholder .avatar-icon { font-size: 4rem; opacity: 0.3; }
.profile-img-placeholder .avatar-text {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-soft);
  letter-spacing: 0.1em;
}

/* Remove scan line */
.profile-scan-line { display: none; }

.profile-info {
  padding: 1.1rem 1.25rem 1.4rem;
  border-top: 1px solid var(--border-light);
}
.profile-name-tag {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}
.profile-role-tag {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--rust);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

/* ─── BADGES ──────────────────────────────────────────────── */
.badge {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--navy-muted);
  background: var(--navy-ghost);
  border: 1px solid var(--navy-border);
  border-radius: var(--r-full);
  padding: 0.22rem 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.green {
  color: var(--sage);
  background: var(--sage-pale);
  border-color: var(--sage-border);
}
.badge.amber, .badge.gold {
  color: var(--gold);
  background: var(--gold-pale);
  border-color: rgba(160,124,58,0.22);
}
.badge.cyan, .badge.blue {
  color: var(--navy-soft);
  background: rgba(45, 96, 168, 0.07);
  border-color: rgba(45, 96, 168, 0.18);
}

/* ─── TERMINAL WIDGET — now styled as a notepad/card ─────── */
.terminal-widget {
  width: 100%; max-width: 320px;
  background: var(--navy);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.06);
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }
.terminal-title {
  font-size: 0.58rem; color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em; margin: 0 auto;
}
.terminal-body {
  padding: 1rem 1.1rem;
  font-size: 0.68rem;
  line-height: 2;
  min-height: 115px;
  color: rgba(255,255,255,0.7);
}
.terminal-line { display: block; }
.t-prompt      { color: #e8c88a; }
.t-cmd         { color: rgba(255,255,255,0.88); }
.t-output      { color: rgba(255,255,255,0.55); padding-left: 1rem; display: block; }
.t-output.success { color: #6ec99a; }
.t-output.info    { color: #7eb8e8; }
.t-output.warn    { color: #e8c88a; }
.t-cursor {
  display: inline-block;
  width: 6px; height: 11px;
  background: rgba(255,255,255,0.6);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--t-base);
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-soft);
  color: #fff;
  border-color: var(--navy-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(28,43,74,0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--navy-ghost);
  color: var(--navy);
  border-color: var(--navy-border-strong);
  transform: translateY(-1px);
}

.btn-rust {
  background: var(--rust);
  color: #fff;
  border-color: var(--rust);
}
.btn-rust:hover {
  background: var(--rust-soft);
  color: #fff;
  border-color: var(--rust-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,93,58,0.22);
}

.btn-teal, .btn-blue {
  background: transparent;
  color: var(--sage);
  border-color: var(--sage-border);
}
.btn-teal:hover, .btn-blue:hover {
  background: var(--sage-pale);
  color: var(--sage);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.75rem;
}

/* ─── PAGE HERO (inner pages) ─────────────────────────────── */
.page-hero {
  padding-top: calc(62px + 4rem);
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}

/* Decorative ruled lines */
.page-hero::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-base) 30%, var(--border-base) 70%, transparent 100%);
}

.page-hero-content { padding: 0 2rem; }

/* ─── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 1.75rem;
}
.breadcrumb a { color: var(--text-mid); }
.breadcrumb a:hover { color: var(--rust); }
.breadcrumb-sep { color: var(--text-ghost); }
.breadcrumb-current { color: var(--rust); }

/* ─── PAGE TITLES ──────────────────────────────────────────── */
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rust);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 0.75rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.page-title .text-green { color: var(--sage); }
.page-title .text-blue  { color: var(--navy-soft); }
.page-title .text-cyan  { color: var(--sage); }

.page-subtitle {
  font-size: 1.0625rem;
  color: var(--text-mid);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 0;
}

/* ─── SECTION HEADERS ─────────────────────────────────────── */
.section-header {
  margin-bottom: 3rem;
  max-width: 580px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.section-title .accent { color: var(--rust); font-style: italic; }

.section-divider {
  width: 40px; height: 2.5px;
  background: var(--rust);
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.section-desc {
  font-size: 0.9375rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ─── CARDS / CONTENT BLOCKS ──────────────────────────────── */
.content-block {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
}
.content-block:hover {
  box-shadow: var(--shadow-sm);
}

.content-block h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}
.content-block h2 .icon { font-size: 1rem; }

.content-block p + p { margin-top: 0.875rem; }

/* ─── PROJECT CARDS ───────────────────────────────────────── */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.project-img-placeholder {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.project-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(28,43,74,0.025) 8px,
    rgba(28,43,74,0.025) 9px
  );
}
.project-img-icon { font-size: 2.5rem; position: relative; z-index: 1; }
.project-img-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.875rem;
}

.project-tag {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--navy-muted);
  background: var(--navy-ghost);
  border: 1px solid var(--navy-border);
  border-radius: var(--r-full);
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.625rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ─── CERT CARDS ──────────────────────────────────────────── */
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
}
.cert-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.cert-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

.cert-icon { font-size: 1.5rem; flex-shrink: 0; }

.cert-meta { flex: 1; }
.cert-name {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.cert-issuer {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.cert-badge {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-full);
  border: 1.5px solid;
  color: var(--sage);
  background: var(--sage-pale);
  border-color: var(--sage-border);
  flex-shrink: 0;
}

.cert-body {
  padding: 1.5rem;
}

.cert-img-container {
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}
.cert-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.cert-description {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 0.875rem;
}
.cert-link {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-style: italic;
}

/* ─── ABOUT GRID ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ─── TIMELINE ────────────────────────────────────────────── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 1.5px;
  background: linear-gradient(to bottom, var(--rust), var(--border-light));
}

.timeline-item {
  padding-left: 1.5rem;
  margin-bottom: 1.75rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px; top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--rust-border);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--rust);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.timeline-title {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}
.timeline-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-bottom: 0.45rem;
  font-weight: 500;
}
.timeline-desc {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ─── SKILLS ──────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.skill-item {
  font-size: 0.84rem;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rust);
  flex-shrink: 0;
}
.skill-dot.blue { background: var(--navy-soft); }
.skill-dot.cyan { background: var(--sage); }

/* ─── INFO LIST ───────────────────────────────────────────── */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.info-list li {
  font-size: 0.84rem;
  color: var(--text-mid);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.info-list li:last-child { border-bottom: none; }
.info-list li::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--rust-pale);
  border: 1px solid var(--rust-border);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── TOOL LIST ───────────────────────────────────────────── */
.tool-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tool-list li {
  font-size: 0.875rem;
  color: var(--text-mid);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
}
.tool-icon { flex-shrink: 0; font-size: 1rem; }

/* ─── STEP LIST ───────────────────────────────────────────── */
.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: step-counter;
}
.step-list li {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
  padding-left: 2rem;
  position: relative;
  counter-increment: step-counter;
}
.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0; top: 0;
  width: 1.3rem; height: 1.3rem;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── DETAIL LAYOUT (project pages) ──────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.info-card-title {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--rust);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.875rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

/* ─── SCREENSHOTS ─────────────────────────────────────────── */
.screenshot-placeholder {
  background: var(--bg-warm);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-height: 180px;
}
.screenshot-icon { font-size: 2rem; opacity: 0.4; }
.screenshot-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-soft);
  letter-spacing: 0.08em;
}
.screenshot-img {
  width: 100%;
  border-radius: var(--r-sm);
  display: block;
  box-shadow: var(--shadow-sm);
}

/* ─── CONTACT FORM ────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3rem;
  align-items: start;
}

.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1.5px solid var(--border-base);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  appearance: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px var(--rust-pale);
}
.form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-ghost); }

/* ─── CONTACT INFO CARD ───────────────────────────────────── */
.contact-info-card {
  background: var(--navy);
  border-radius: var(--r-xl);
  padding: 2rem;
  color: rgba(255,255,255,0.85);
  box-shadow: var(--shadow-lg);
}
.contact-info-card h3 {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}
.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 0.84rem;
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.contact-info-text { color: rgba(255,255,255,0.6); }
.contact-info-value { color: rgba(255,255,255,0.85); font-weight: 500; }

/* ─── FORM ALERT ──────────────────────────────────────────── */
.form-alert {
  padding: 0.875rem 1.1rem;
  border-radius: var(--r-md);
  font-size: 0.84rem;
  margin-top: 1rem;
  display: none;
}
.form-alert.success {
  background: var(--sage-pale);
  color: var(--sage);
  border: 1px solid var(--sage-border);
  display: block;
}
.form-alert.error {
  background: var(--rust-pale);
  color: var(--rust);
  border: 1px solid var(--rust-border);
  display: block;
}

/* ─── DOMAIN OVERVIEW CARDS ───────────────────────────────── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-xl);
  padding: 2rem;
  transition: box-shadow var(--t-slow), transform var(--t-slow);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.section-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  color: inherit;
}

/* Subtle top accent bar */
.section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-slow);
}
.section-card:hover::before { transform: scaleX(1); }

.section-card-icon {
  font-size: 2.2rem;
  margin-bottom: 1.25rem;
  display: block;
}
.section-card-number {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-ghost);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}
.section-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}
.section-card-desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.section-card-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rust);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ─── HOME HERO SKILLS PANEL ──────────────────────────────── */
.hero-skills-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-sm);
}
.hero-skills-panel-title {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.875rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}
.hero-skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}
.hero-skill-row:last-child { border-bottom: none; }
.hero-skill-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-body);
}
.hero-skill-bar {
  width: 80px; height: 3px;
  background: var(--bg-deep);
  border-radius: 2px;
  overflow: hidden;
}
.hero-skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--rust-soft));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--ease-out);
}
.hero-skill-fill.animate { transform: scaleX(1); }

/* ─── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.07s; }
.delay-2 { transition-delay: 0.14s; }
.delay-3 { transition-delay: 0.21s; }
.delay-4 { transition-delay: 0.28s; }

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 4rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand { }
.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}
.footer-logo .accent { color: var(--rust-soft); font-style: normal; }
.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}

.footer-col-title {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links a {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--t-base);
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}
.footer-copy .accent { color: rgba(255,255,255,0.55); }

.footer-social {
  display: flex;
  gap: 1rem;
}
.footer-social-link {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color var(--t-base);
}
.footer-social-link:hover { color: rgba(255,255,255,0.85); }

/* ─── LEGACY COMPAT (keep old vars working) ───────────────── */
.text-green { color: var(--sage); }
.text-blue  { color: var(--navy-soft); }
.text-cyan  { color: var(--sage); }
.accent     { color: var(--rust); }

/* btn-blue alias */
.btn-blue {
  background: transparent;
  color: var(--navy-soft);
  border-color: var(--navy-border);
}
.btn-blue:hover {
  background: var(--navy-ghost);
  color: var(--navy);
}

/* btn-ghost alias stays navy */

/* ─── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-visual { align-items: center; }
  .hero-title { justify-content: center; }
  .hero-cta { justify-content: center; }
  .hero-stats { text-align: center; }
  .stat-item { text-align: center; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { grid-row: 1; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  .container { padding: 0 1.25rem; }
  .section { padding: 3.5rem 0; }
  .hero { padding-top: 62px; min-height: auto; padding-bottom: 3rem; }
  .page-hero { padding-top: calc(62px + 2.5rem); padding-bottom: 2.5rem; }
  .nav-links {
    display: none;
    position: fixed;
    top: 62px; left: 0; right: 0;
    background: rgba(250, 248, 244, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-bottom: 1px solid var(--border-base);
    box-shadow: var(--shadow-md);
    gap: 0.2rem;
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.65rem 1rem; border-radius: var(--r-md); }
  .nav-hamburger { display: flex; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
  .skills-grid { grid-template-columns: 1fr; }
  .content-block { padding: 1.25rem; }
}
