/* Portfolio — Youness Bakas */

:root {
  --bg: #ffffff;
  --surface: #eef3fb;
  --surface-2: #dfe8f6;
  --ink: #0f1d33;
  --muted: #4a5a74;
  --accent: #385ca9;
  --accent-ink: #2b4a8c;
  --deep: #12264a;
  --deep-ink: #f3f6fc;
  --deep-muted: #b9c6de;

  --font: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(4.25rem, 1rem + 10.5vw, 11rem);

  --margin: clamp(20px, 3vw, 44px);
  --gap-section: clamp(112px, 14vw, 200px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --seam: 56%;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { padding-inline: var(--margin); max-width: 1440px; margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--margin); top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 500; font-size: var(--step-body);
  padding: 14px 22px; border-radius: 0;
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.arrow { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arrow, .link:hover .arrow { transform: translateX(4px); }

.link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; text-decoration: none; color: var(--accent-ink);
  padding-block: 4px;
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor; transform-origin: left;
  transition: transform .4s var(--ease);
}
.link:hover::after { transform: scaleX(0); transform-origin: right; }
.link-light { color: var(--deep-ink); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px calc(var(--margin) + 12px);
  font-size: var(--step-small); font-weight: 500;
  transition: transform .45s var(--ease), background-color .3s;
}
.nav.is-solid { background: var(--bg); }
.nav.is-hidden { transform: translateY(-100%); }
.nav a { text-decoration: none; }
.nav-mark { font-weight: 700; font-size: var(--step-body); justify-self: start; }
.nav-links { display: flex; gap: 32px; }
.nav-links a, .nav-cta { position: relative; }
.nav-links a::after, .nav-cta::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav-links a:hover::after, .nav-cta:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { justify-self: end; color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100svh; min-height: 700px; max-height: 1100px; }
.hero-panel {
  position: absolute; top: 12px; left: 12px; right: 12px;
  height: calc(var(--seam) - 12px);
  background: var(--surface);
  transform-origin: top;
}
.hero-inner {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  grid-template-rows: var(--seam) 1fr;
  padding-inline: calc(var(--margin) + 12px);
  max-width: 1464px; margin-inline: auto;
}
.hero-name {
  grid-column: 1 / 9; grid-row: 1; align-self: end;
  font-size: var(--step-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: -0.035em; line-height: 0.86;
  margin-bottom: -0.035em;
}
.hero-name .line { display: block; overflow: hidden; padding-top: .06em; }
.hero-name .word { display: inline-block; }
.hero-text { grid-column: 1 / 7; grid-row: 2; padding-top: 32px; }
.hero-role { font-size: var(--step-lead); font-weight: 500; color: var(--muted); }
.hero-sentence { margin-top: 14px; max-width: 34ch; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.hero-photo {
  grid-column: 9 / 13; grid-row: 1 / 3; align-self: center;
  margin-top: 40px;
  aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-2);
  max-height: 72vh; justify-self: end; width: 100%;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* ---------- Moving band ---------- */
.band { overflow: hidden; padding-block: clamp(48px, 7vw, 96px) 0; }
.band-track {
  white-space: nowrap; font-weight: 700; text-transform: uppercase;
  font-size: clamp(3rem, 1rem + 7vw, 8rem); letter-spacing: -0.03em; line-height: 1;
  color: var(--accent);
  will-change: transform;
}

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  padding-top: clamp(64px, 8vw, 120px);
}
.facts { grid-column: 1 / 4; display: grid; gap: 22px; align-content: start; padding-top: 8px; }
.facts dt { font-size: var(--step-small); color: var(--muted); }
.facts dd { font-size: var(--step-body); font-weight: 500; }
.about-text {
  grid-column: 4 / 12;
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.75rem); line-height: 1.4; font-weight: 400; max-width: 46ch;
}

/* ---------- Section titles ---------- */
.section-title {
  font-size: var(--step-head); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1; text-transform: uppercase;
}

/* ---------- Work ---------- */
.work { padding-top: var(--gap-section); }
.work .section-title { margin-bottom: clamp(48px, 6vw, 88px); }
.project {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  align-items: center;
}
.project + .project { margin-top: clamp(88px, 10vw, 152px); }
.project-text { grid-column: 1 / 6; }
.project-media { grid-column: 7 / 13; }
.project:nth-of-type(even) .project-text { grid-column: 8 / 13; grid-row: 1; }
.project:nth-of-type(even) .project-media { grid-column: 1 / 7; grid-row: 1; }

.project h3 { font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.5rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.project-context { margin-top: 10px; font-size: var(--step-small); color: var(--accent-ink); font-weight: 500; }
.project-text > p:not(.project-context) { margin-top: 18px; }
.psd { margin-top: 24px; display: grid; gap: 14px; }
.psd > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; }
.psd dt { font-size: var(--step-small); color: var(--muted); padding-top: 2px; }
.psd dd { font-size: var(--step-body); }
.project .link { margin-top: 26px; }
.todo { background: #fff4d6; color: #5b4300; padding: 2px 6px; font-size: var(--step-small); }

.project-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease); }
.project:hover .project-media img { transform: scale(1.04); }
.placeholder-inner {
  height: 100%; display: grid; place-content: center; gap: 6px; text-align: center;
  background: var(--surface);
}
.placeholder-inner span { font-size: var(--step-lead); font-weight: 500; color: var(--accent-ink); }
.placeholder-inner small { font-size: var(--step-small); color: var(--muted); }

/* ---------- Skills ---------- */
.skills { margin-top: var(--gap-section); background: var(--surface); padding-block: clamp(88px, 10vw, 152px); }
.skills-inner { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.skills-intro { grid-column: 1 / 5; align-self: start; position: sticky; top: 110px; }
.skills-intro p { margin-top: 24px; max-width: 30ch; }
.rows { grid-column: 6 / 12; display: grid; gap: 44px; }
.group-name { font-size: var(--step-small); color: var(--muted); margin-bottom: 10px; }
.rows li {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  transition: transform .35s var(--ease);
}
.rows li:hover { transform: translateX(6px); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); flex: none; transition: transform .35s var(--ease), background-color .35s; }
.rows li:hover .dot { transform: scale(1.4); background: var(--accent); }
.rows .name { font-size: var(--step-body); }
.rows .val { margin-left: auto; font-size: var(--step-small); color: var(--muted); text-align: right; }
.rows li.strong .name { font-size: var(--step-lead); font-weight: 500; }
.rows li.strong .dot { background: var(--accent); }

/* ---------- Path ---------- */
.path { padding-top: var(--gap-section); }
.path .section-title { margin-bottom: clamp(40px, 5vw, 72px); }
.path-cols { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.path-col { grid-column: 1 / 6; display: grid; gap: 36px; align-content: start; }
.path-col + .path-col { grid-column: 7 / 12; }
.path-col .group-name { margin-bottom: -12px; }
.entry-head { display: flex; align-items: baseline; gap: 16px; }
.entry-head h3 { font-size: var(--step-lead); font-weight: 500; line-height: 1.25; }
.entry-head .val { margin-left: auto; font-size: var(--step-small); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry p { margin-top: 8px; }
.entry-place { color: var(--muted); }

/* ---------- Contact ---------- */
.contact { margin-top: var(--gap-section); background: var(--deep); color: var(--deep-ink); padding-block: clamp(96px, 11vw, 160px); }
.contact-inner { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
.contact-sentence {
  grid-column: 1 / 6;
  font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em;
}
.contact-photo { grid-column: 7 / 9; aspect-ratio: 1; overflow: hidden; max-width: 180px; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.contact-links { grid-column: 9 / 13; display: grid; justify-items: start; gap: 12px; }
.contact-q { font-size: var(--step-lead); font-weight: 500; margin-bottom: 8px; }
.contact-note { margin-top: 12px; font-size: var(--step-small); color: var(--deep-muted); }

/* ---------- Footer ---------- */
.footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline;
  padding-block: 28px 30px; font-size: var(--step-small); color: var(--muted);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-year { justify-self: end; }

/* ---------- Motion (only when JS is on) ---------- */
.js .reveal, .js .reveal-group > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .is-in.reveal, .js .is-in.reveal-group > * { opacity: 1; transform: none; }

.js .shutter { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--ease); }
.js .shutter > * { transform: scale(1.12); transition: transform 1.4s var(--ease); }
.js .shutter.is-in { clip-path: inset(0 0 0 0); }
.js .shutter.is-in > * { transform: scale(1); }

.js .hero-name .word { transform: translateY(105%); transition: transform 1s var(--ease); }
.js .hero-panel { transform: scaleY(0); transition: transform 1.1s var(--ease); }
.js .is-loaded .hero-name .word { transform: none; }
.js .is-loaded .hero-name .line + .line .word { transition-delay: .09s; }
.js .is-loaded .hero-panel { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
  .js .reveal, .js .reveal-group > *, .js .shutter > *, .js .hero-name .word, .js .hero-panel { opacity: 1; transform: none; }
  .js .shutter { clip-path: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  .nav-links { gap: 20px; }
  .facts { grid-column: 1 / 13; grid-template-columns: repeat(4, 1fr); margin-bottom: 40px; order: 2; }
  .about-text { grid-column: 1 / 13; order: 1; margin-bottom: 40px; }
  .skills-intro { grid-column: 1 / 13; position: static; margin-bottom: 48px; }
  .rows { grid-column: 1 / 13; }
}

/* ---------- Phone ---------- */
@media (max-width: 799px) {
  .nav { padding: 16px 32px; grid-template-columns: 1fr auto; }
  .nav-links { display: none; }

  .hero { height: auto; min-height: 0; max-height: none; padding-bottom: 8px; }
  .hero-panel { height: calc(118px + 2 * 0.86 * 18vw); }
  .hero-inner { position: relative; display: flex; flex-direction: column; padding-top: 130px; padding-inline: 32px; }
  .hero-name { font-size: 18vw; margin-bottom: 0; }
  .hero-text { padding-top: 24px; }
  .hero-photo { order: 3; width: 74vw; max-height: none; margin-top: 40px; align-self: flex-end; margin-right: -12px; }

  .about, .project, .path-cols, .contact-inner { display: block; }
  .facts { grid-template-columns: 1fr 1fr; gap: 20px 16px; margin-bottom: 0; margin-top: 36px; }
  .about { display: flex; flex-direction: column; }
  .about-text { margin-bottom: 0; }

  .project-media { margin-top: 28px; aspect-ratio: 16 / 10; }
  .psd > div { grid-template-columns: 1fr; gap: 2px; }

  .path-col + .path-col { margin-top: 56px; }
  .entry-head { flex-direction: column; gap: 2px; }
  .entry-head .val { margin-left: 0; }

  .contact-sentence { font-size: 1.5rem; }
  .contact-photo { width: 120px; margin-top: 40px; }
  .contact-links { margin-top: 40px; }

  .footer { grid-template-columns: 1fr; gap: 8px; padding-top: 20svh; }
  .footer-year { justify-self: start; }
}
