/* =============================================
   ACHOURI AISSA — PORTFOLIO
   style.css
   Dark editorial aesthetic with amber accent
   ============================================= */

/* ---- TOKENS ---- */
:root {
  --bg:          #0c0d0f;
  --bg-2:        #13151a;
  --bg-3:        #1a1d25;
  --surface:     #1e2230;
  --border:      rgba(255,255,255,0.07);
  --text:        #e8e9ed;
  --text-muted:  #7a7f8e;
  --text-soft:   #b2b7c4;
  --accent:      #f0a500;
  --accent-dim:  rgba(240, 165, 0, 0.15);
  --accent-glow: rgba(240, 165, 0, 0.35);
  --radius:      12px;
  --radius-sm:   6px;
  --nav-h:       68px;
  --transition:  0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:          #f4f3ef;
  --bg-2:        #eeece8;
  --bg-3:        #e5e3dd;
  --surface:     #ffffff;
  --border:      rgba(0,0,0,0.08);
  --text:        #1a1c22;
  --text-muted:  #8a8f9e;
  --text-soft:   #4a4f5e;
  --accent:      #d4920a;
  --accent-dim:  rgba(212, 146, 10, 0.1);
  --accent-glow: rgba(212, 146, 10, 0.25);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ---- UTILITIES ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}
.accent { color: var(--accent); }

/* ---- REVEAL ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}
.nav__logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.nav__links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav__links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--accent); }

/* Theme Toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav__hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ul { list-style: none; text-align: center; }
.mobile-menu ul li + li { margin-top: 1.8rem; }
.mobile-menu a {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu__close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.mobile-menu__close:hover { color: var(--accent); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all var(--transition);
  font-weight: 500;
}
.btn--primary {
  background: var(--accent);
  color: #0c0d0f;
}
.btn--primary:hover {
  background: #ffc02e;
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-2px);
}
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--full { width: 100%; justify-content: center; }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) clamp(1.25rem, 5vw, 3rem) 4rem;
  overflow: hidden;
}

/* Dot grid background */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 80%);
  opacity: 0.6;
  pointer-events: none;
}

.hero__content {
  max-width: 680px;
  position: relative;
  z-index: 2;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 1rem;
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  background: var(--accent-dim);
  margin-bottom: 1.75rem;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero__name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}
.hero__name em {
  font-style: italic;
  color: var(--accent);
}
.hero__title {
  font-family: 'DM Mono', monospace;
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.hero__tagline {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-soft);
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Decoration */
.hero__decoration {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(250px, 38vw, 500px);
  height: clamp(250px, 38vw, 500px);
  pointer-events: none;
  z-index: 1;
}
.hero__circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.hero__circle--1 {
  inset: 0;
  animation: slowSpin 30s linear infinite;
}
.hero__circle--2 {
  inset: 15%;
  border-color: var(--accent-dim);
  animation: slowSpin 20s linear infinite reverse;
}
.hero__orbit {
  position: absolute;
  inset: 25%;
  animation: slowSpin 12s linear infinite;
}
.hero__orbit-ring {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px dashed var(--accent-dim);
}
.hero__orbit-dot {
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: clamp(1.25rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero__scroll-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  animation: lineExpand 2s ease-in-out infinite;
}
@keyframes lineExpand {
  0%, 100% { width: 60px; opacity: 1; }
  50% { width: 30px; opacity: 0.4; }
}

/* =============================================
   SECTIONS (shared)
   ============================================= */
.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}
.section:nth-child(even) {
  background: var(--bg-2);
}
.section__label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.section__heading {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  color: var(--text);
}
.section__heading em {
  font-style: italic;
  color: var(--accent);
}

/* =============================================
   ABOUT
   ============================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about__text p {
  color: var(--text-soft);
  margin-bottom: 1.2rem;
  font-size: 1.02rem;
}
.about__text strong { color: var(--text); font-weight: 500; }
.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  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(--accent);
  transform: translateY(-3px);
}
.stat-card__num {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}
.stat-card__label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.stat-card__flag-icon { width: 1em; height: 1em; flex-shrink: 0; }

/* =============================================
   SKILLS
   ============================================= */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.skill-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: default;
  transition: all var(--transition);
}
.skill-badge:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.skill-badge__icon { font-size: 1.5rem; display: flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; }
.skill-badge__icon svg { width: 100%; height: 100%; }
.skill-badge__name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.skill-badge__bar {
  height: 3px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.skill-badge__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #ffc02e);
  border-radius: 10px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1) 0.3s;
}
.skill-badge.revealed .skill-badge__fill {
  width: var(--pct);
}

/* =============================================
   PROJECTS
   ============================================= */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.25); }
.project-card:hover::before { transform: scaleX(1); }
.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-card__number {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.7;
}
.project-card__links { display: flex; gap: 0.75rem; }
.icon-link {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
}
.icon-link svg { width: 14px; height: 14px; }
.icon-link:hover { border-color: var(--accent); color: var(--accent); }
.project-card__title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--text);
  line-height: 1.2;
}
.project-card__desc {
  font-size: 0.93rem;
  color: var(--text-soft);
  line-height: 1.75;
  flex: 1;
}
.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}
.project-card__stack span {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(240, 165, 0, 0.2);
}

/* =============================================
   EDUCATION / TIMELINE
   ============================================= */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}
.timeline__item {
  position: relative;
  padding-bottom: 3rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -2.5rem;
  top: 8px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateX(-4.5px);
}
.timeline__year {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}
.timeline__content h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.timeline__place {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
}
.timeline__desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}
.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.timeline__tags span {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* =============================================
   CONTACT
   ============================================= */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.contact__left p {
  color: var(--text-soft);
  margin-bottom: 2rem;
  font-size: 1.02rem;
  line-height: 1.8;
}
.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: color var(--transition);
}
.contact__link svg { width: 16px; height: 16px; flex-shrink: 0; }
.contact__link:hover { color: var(--accent); }

/* Form */
.contact__form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.form-group label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-group input,
.form-group textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-success {
  display: none;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0,200,100,0.1);
  border: 1px solid rgba(0,200,100,0.2);
  color: #4caf82;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}
.form-success.visible { display: block; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer__logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--accent);
}
.footer p {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.footer__location { opacity: 0.7; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .projects__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .hero__decoration { opacity: 0.25; right: -15%; }
  .skills__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .about__stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero__name { font-size: clamp(3rem, 14vw, 5rem); }
  .hero__cta { flex-direction: column; }
  .about__stats { grid-template-columns: 1fr 1fr; }
  .contact__form-wrap { padding: 1.5rem; }
  .footer__inner { justify-content: center; text-align: center; }
}
