/* ============================================================
   Rachid Lamane — Maritime Portfolio
   Plain CSS. No frameworks. No build step.
   Deploy: upload this folder to Vercel or Cloudflare Pages.
   Palette: white / deep navy / ocean blue. Solid fills only.
   ============================================================ */
:root {
  --white: #ffffff;
  --paper: #f5f9fc;
  --navy: #0a2239;
  --navy-2: #10314f;
  --ink: #1d2b3a;
  --muted: #516375;
  --ocean: #0f6aa5;          /* text-safe on white */
  --ocean-line: #1b8fd0;     /* graphics only */
  --mist: #e8f2f9;
  --line: #d8e4ed;
  --radius: 6px;
  --max: 1080px;
  --font: "Manrope", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--mist); }

img, svg { display: block; max-width: 100%; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: var(--radius); text-decoration: none; font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--ocean); outline-offset: 3px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

section.block { padding: 72px 0; }
section.block.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ocean); margin-bottom: 12px;
}
h1, h2, h3 { color: var(--navy); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 8px; }
.section-sub { color: var(--muted); max-width: 64ch; margin-bottom: 36px; }
h3 { font-size: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 800; color: var(--navy); font-size: 15px; letter-spacing: -0.01em; }
.brand-name small { display: block; font-family: var(--mono); font-weight: 400; font-size: 9px; letter-spacing: 0.14em; color: var(--muted); }

nav.primary { display: flex; gap: 22px; }
nav.primary a {
  text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 600;
  border-bottom: 2px solid transparent; padding: 4px 0;
}
nav.primary a:hover { color: var(--navy); }
nav.primary a.active { color: var(--navy); border-bottom-color: var(--ocean-line); }

.header-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 40px; height: 40px; cursor: pointer; color: var(--navy); font-size: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius); padding: 12px 24px;
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid var(--navy);
}
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--mist); }
.btn-ocean { background: var(--ocean); border-color: var(--ocean); color: #fff; }
.btn-ocean:hover { background: #0d5d8f; }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--white); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; padding: 84px 0 72px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 60px); font-weight: 800; }
.hero-role { color: var(--ocean); font-weight: 700; font-size: 17px; margin: 14px 0 6px; }
.hero-keywords { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 18px; }
.hero-lead { max-width: 52ch; color: var(--ink); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; font-size: 13.5px; color: var(--muted); }
.hero-meta strong { color: var(--navy); }

.hero-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy); color: #dbe7f1; padding: 30px 28px;
}
.hero-card .hc-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: #8fb8d4; text-transform: uppercase; }
.hero-card ul { list-style: none; margin-top: 14px; display: flex; flex-direction: column; }
.hero-card li { padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 14px; }
.hero-card li:first-child { border-top: 0; }
.hero-card b { color: #fff; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about-grid p { margin-bottom: 16px; }
.fact-list { list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.fact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact-list li:last-child { border-bottom: 0; }
.fact-list dt, .fact-list .k { color: var(--muted); }
.fact-list dd, .fact-list .v { color: var(--navy); font-weight: 700; text-align: right; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline > li { position: relative; padding: 0 0 36px 32px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--ocean-line);
}
.timeline .period { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ocean); text-transform: uppercase; }
.timeline h3 { margin: 4px 0 2px; }
.timeline .org { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.timeline ul { margin-left: 18px; font-size: 14.5px; }
.timeline ul li { margin-bottom: 6px; }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edu-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); padding: 26px;
  border-top: 3px solid var(--ocean-line);
}
.edu-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edu-card .year { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ocean); }
.edu-card h3 { margin: 6px 0 4px; }
.edu-card .school { font-size: 14px; font-weight: 600; color: var(--ink); }
.edu-card p.note { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* ---------- Expertise / pills ---------- */
.spec-group { margin-bottom: 32px; }
.spec-group h3 { font-size: 14px; font-family: var(--mono); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.pills li {
  border: 1px solid var(--line); background: var(--white); color: var(--navy);
  border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-weight: 600;
}
.pills li.reg { background: var(--mist); border-color: #bcd8ea; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 24px; }
.skill-card h3 { margin-bottom: 6px; }
.skill-card p { font-size: 14px; color: var(--muted); }
.level {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; border-radius: 999px; padding: 4px 12px; margin-bottom: 12px;
}
.level.working { background: var(--mist); color: var(--ocean); border: 1px solid #bcd8ea; }
.level.developing { background: #fdf6e7; color: #8a5f00; border: 1px solid #ecd9a0; }
.skills-note { margin-top: 24px; font-size: 14px; color: var(--muted); border-left: 3px solid var(--ocean-line); padding-left: 16px; max-width: 70ch; }

/* ---------- Projects ---------- */
.proj-group-title { font-size: 14px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 36px 0 16px; }
.proj-group-title:first-of-type { margin-top: 0; }
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.proj-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.proj-card h3 { font-size: 17px; }
.proj-card p { font-size: 14px; }
.proj-card .src { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.proj-card .go { margin-top: auto; padding-top: 8px; }
.proj-card .go a { color: var(--ocean); font-weight: 700; font-size: 13.5px; }

/* ---------- Interests ---------- */
.interests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; }
.interests li { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 22px; }
.interests h3 { font-size: 15.5px; margin-bottom: 6px; }
.interests p { font-size: 13.5px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 30px; }
.contact-card h3 { margin-bottom: 8px; }
.contact-card p { font-size: 14.5px; color: var(--muted); margin-bottom: 20px; }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  font-weight: 700; font-size: 14px; color: var(--navy);
}
.contact-links a:hover { background: var(--mist); }
.contact-links a span.m { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: auto; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--navy); }

/* ---------- Calendly modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 34, 57, 0.6); }
.overlay.open { display: flex; }
.sheet { background: #fff; border-radius: 8px; width: 100%; max-width: 860px; height: min(720px, 90vh); display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-head strong { color: var(--navy); font-size: 15px; }
.sheet-head button { border: 1px solid var(--line); background: #fff; border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; color: var(--navy); }
.sheet iframe { flex: 1; width: 100%; border: 0; min-height: 0; }
.sheet-foot { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.sheet-foot a { color: var(--ocean); }

/* ---------- Reveal animation (subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  nav.primary {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 8px 28px 16px;
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .header-actions .btn { display: none; }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .edu-card.featured { grid-template-columns: 1fr; }
  .skills-grid, .proj-grid, .interests, .edu-grid { grid-template-columns: 1fr; }
  section.block { padding: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
