/* =========================================================
   Aïmen Talbi — aimentalbi.com
   Design tokens
   ========================================================= */
:root {
  --navy: #060E1E;
  --navy-soft: #1B2740;
  --white: #F8F7F4;
  --paper: #FFFFFF;
  --sand: #EFEBE2;
  --sand-line: #E2DCCE;
  --gold: #EF9F27;
  --gold-dark: #C97F14;
  --ink: #2B2F38;
  --ink-soft: #5B6270;

  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Montserrat", Arial, Helvetica, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(6, 14, 30, 0.18);
  --shadow-sm: 0 4px 14px -6px rgba(6, 14, 30, 0.14);
  --maxw: 1160px;
  --pad: clamp(20px, 5vw, 48px);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); margin: 0; line-height: 1.12; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

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

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-dark);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 48px;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

/* =========================================================
   Skip link
   ========================================================= */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--sand-line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
}
.logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.main-nav ul {
  display: flex;
  gap: 4px;
}
.main-nav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  transition: background 0.15s ease;
}
.main-nav a:hover { background: var(--sand); }
.main-nav .btn-primary { margin-left: 8px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 70px);
}
.hero-grid {
  display: grid;
  gap: 40px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  max-width: 16ch;
  letter-spacing: -0.01em;
}
.hero-sub {
  margin-top: 22px;
  max-width: 54ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--ink-soft);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--sand-line);
  max-width: 560px;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy);
}
.stat span {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* =========================================================
   About
   ========================================================= */
.about {
  padding: clamp(50px, 8vw, 90px) 0;
  background: var(--paper);
  border-top: 1px solid var(--sand-line);
  border-bottom: 1px solid var(--sand-line);
}
.about-grid {
  display: grid;
  gap: 32px;
  align-items: start;
}
.about h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  max-width: 20ch;
}
.about-body p {
  color: var(--ink-soft);
  max-width: 62ch;
}
.about-body p + p { margin-top: 16px; }
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.tag {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--navy);
  border: 1px solid var(--sand-line);
}

/* =========================================================
   Portfolio
   ========================================================= */
.portfolio {
  padding: clamp(56px, 9vw, 100px) 0;
}
.portfolio-head {
  max-width: 62ch;
  margin-bottom: 44px;
}
.portfolio-head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
}
.portfolio-head p {
  margin-top: 16px;
  color: var(--ink-soft);
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--sand-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.seal {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.seal svg { width: 22px; height: 22px; stroke: var(--navy); fill: none; stroke-width: 2; }

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.card-body h3 {
  font-size: 1.15rem;
  word-break: break-word;
}
.card-body p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  flex: 1;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  margin-top: 6px;
  width: fit-content;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}
.card-link svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.card-link:hover svg { transform: translate(3px, -3px); }

/* =========================================================
   Contact
   ========================================================= */
.contact {
  padding: clamp(56px, 9vw, 100px) 0;
  background: var(--paper);
  border-top: 1px solid var(--sand-line);
}
.contact-panel {
  border: 1.5px solid var(--navy);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  gap: 28px;
  position: relative;
  overflow: hidden;
}
.contact-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(239, 159, 39, 0.08));
  pointer-events: none;
}
.contact-panel h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  max-width: 18ch;
}
.contact-panel > p {
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: -12px;
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.contact-email {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}
.contact-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--sand-line);
  padding: 40px 0;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-brand {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--navy);
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--navy); }
.footer-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  width: 100%;
  margin-top: 8px;
}

/* =========================================================
   Responsive: header nav collapse
   ========================================================= */
@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 24px var(--pad);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    height: calc(100vh - 76px);
  }
  .main-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 4px;
  }
  .main-nav a {
    padding: 16px 6px;
    border-bottom: 1px solid var(--sand-line);
    border-radius: 0;
  }
  .main-nav .btn-primary {
    margin: 18px 6px 0;
    justify-content: center;
  }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 0.85fr 1.15fr; }
  .contact-panel { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
  .contact-panel > p { grid-column: 1; margin-top: 0; }
  .contact-panel h2 { grid-column: 1; }
  .contact-row { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; }
}
