/* ============================================================
   OMAR BENGOURICH — PORTFOLIO
   Design system: Ink / Ignition · Archivo / Newsreader / Geist Mono
   ============================================================ */

:root {
  --ink: #0B0B0C;
  --accent: #FF4A1C;
  --carbon: #15151A;
  --surface-2: #1A1A1C;
  --paper: #F2EEE6;
  --bone: #F2EEE6;
  --mist: #C9C4BA;
  --ash: #8A8A92;
  --steel-deep: #16314A;
  --steel: #5E86AE;
  --hairline: rgba(242,238,230,0.12);
  --hairline-strong: rgba(242,238,230,0.20);
  --crop-mark: rgba(242,238,230,0.55);

  --max: 1240px;
  --gut: clamp(22px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
em { font-style: normal; color: var(--accent); }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--ink); }

/* ─── Shared scaffolding ─── */
.mono-label, .meta-row, .idx, .card-tag, .card-year, .tl-date,
.footer-content, .scroll-cue span, .nav-links, .chips span, .skill-col h3 {
  font-family: 'Geist Mono', monospace;
}

/* ─── GRAIN ─── */
#grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 9000;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.45;
}
@media (prefers-reduced-motion: reduce) { #grain { display: none; } }

/* ─── SCROLL PROGRESS ─── */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--accent);
  z-index: 8000;
  transition: width .1s linear;
}

/* ─── NAV ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 7000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11,11,12,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.ob-chip {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--ink);
  font-weight: 900; font-size: 15px; letter-spacing: -0.02em;
  transition: transform .4s var(--ease);
}
.nav-mark:hover .ob-chip { transform: rotate(-8deg) scale(1.06); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px);
  font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-links a { color: var(--mist); position: relative; padding: 6px 0; transition: color .3s; }
.nav-links a:hover { color: var(--bone); }
.nav-links a::after {
  content:''; position:absolute; left:0; bottom:0; height:1px; width:0; background: var(--accent); transition: width .3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-cta { color: var(--ink) !important; background: var(--accent); padding: 8px 16px !important; border-radius: 3px; }
.nav-cta::after { display: none; }
.nav-cta:hover { filter: brightness(1.08); }

/* ─── CROP MARKS ─── */
.crop-marks { position: absolute; inset: 22px; z-index: 6; pointer-events: none; }
.crop-marks::before, .crop-marks::after,
.crop-marks span::before, .crop-marks span::after {
  content: ''; position: absolute; width: 15px; height: 15px;
  border-color: var(--crop-mark); border-style: solid; border-width: 0;
}
.crop-marks::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.crop-marks::after { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.crop-marks span { position: absolute; inset: 0; }
.crop-marks span::before { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.crop-marks span::after { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* ─── META ROW ─── */
.meta-row {
  position: absolute; top: 46px; left: var(--gut); right: var(--gut);
  z-index: 5; display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(96px, 14vh, 150px) var(--gut) clamp(80px, 12vh, 130px);
  overflow: hidden;
}
/* keep the hero meta-row clear of the fixed nav */
.hero .meta-row { top: clamp(88px, 12vh, 120px); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  align-items: center;
  gap: clamp(30px, 5vw, 70px);
  width: 100%; max-width: var(--max); margin: 0 auto;
}

/* Small framed portrait, anchored left — does not overlap text */
.hero-portrait {
  position: relative;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: 5px; overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: var(--carbon);
}
.hero-portrait .crop-marks { inset: 10px; z-index: 3; }
.hero-portrait img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%;
  filter: contrast(1.06) saturate(1.05);
  transition: transform .8s var(--ease), filter .8s var(--ease);
}
.hero-portrait:hover img { transform: scale(1.04); }
.hero-portrait figcaption {
  position: absolute; left: 12px; bottom: 10px; z-index: 3;
  font-family: 'Geist Mono', monospace; font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--bone);
  background: rgba(11,11,12,0.55); padding: 4px 8px; border-radius: 3px;
}

.hero-copy { position: relative; z-index: 4; min-width: 0; }
.kicker {
  font-family: 'Newsreader', serif; font-style: italic; font-weight: 400;
  font-size: clamp(17px, 2.4vw, 26px); color: var(--mist); margin-bottom: 14px;
}
.hero-title {
  font-weight: 900; text-transform: uppercase;
  letter-spacing: -0.045em; line-height: 0.84;
  font-size: clamp(34px, 9.2vw, 128px);
  overflow-wrap: break-word;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-sub {
  font-family: 'Newsreader', serif; font-style: italic;
  font-size: clamp(16px, 2vw, 23px); color: var(--mist);
  max-width: 560px; margin-top: 26px; line-height: 1.45;
}
.hero-sub em { font-style: italic; }

.scroll-cue {
  position: absolute; left: var(--gut); bottom: 40px; z-index: 4;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-family: 'Geist Mono', monospace; font-size: 10px; letter-spacing: 0.3em; color: var(--ash);
}
.scroll-line { width: 1px; height: 44px; background: linear-gradient(var(--accent), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-line { animation: cue 2s var(--ease) infinite; transform-origin: top; }
}
@keyframes cue { 0%,100% { transform: scaleY(.4); opacity:.5;} 50% { transform: scaleY(1); opacity:1;} }

/* ─── RUNNING MAT (brand phrases, side-to-side) ─── */
.runmat {
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: var(--carbon); padding: 16px 0; overflow: hidden; white-space: nowrap;
}
.runmat-track {
  display: inline-flex; align-items: center; gap: 30px;
  font-family: 'Geist Mono', monospace; font-weight: 500;
  font-size: clamp(12px, 1.5vw, 15px); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mist);
  white-space: nowrap; will-change: transform;
  animation: marquee 26s linear infinite;
}
.runmat-track i { color: var(--accent); font-style: normal; }
.runmat:hover .runmat-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .runmat-track { animation-duration: 80s; } /* slower, but the band still moves */
}
@keyframes marquee { from { transform: translateX(0);} to { transform: translateX(-50%);} }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(80px, 13vh, 160px) var(--gut);
}
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(28px, 5vh, 54px); }
.idx { color: var(--accent); font-size: 12px; letter-spacing: 0.18em; font-weight: 500; }
.mono-label { color: var(--ash); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.section-head::after { content:''; flex:1; height:1px; background: var(--hairline); }

.section-title {
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.88;
  font-size: clamp(40px, 8vw, 96px); margin-bottom: 22px;
}
.section-intro {
  font-family: 'Newsreader', serif; font-style: italic;
  font-size: clamp(17px, 2vw, 23px); color: var(--mist); max-width: 640px; line-height: 1.5;
}

/* ─── MANIFESTO ─── */
.manifesto-grid { display: grid; gap: clamp(24px, 4vw, 40px); max-width: 980px; }
.lead { font-size: clamp(20px, 2.7vw, 32px); font-weight: 500; line-height: 1.4; color: var(--bone); }
.lead strong { font-weight: 900; }
.ink-accent { color: var(--accent); font-weight: 700; }
.pull {
  font-family: 'Newsreader', serif; font-style: italic; font-weight: 500;
  font-size: clamp(34px, 7vw, 76px); line-height: 1; color: var(--bone);
  padding-top: 14px; border-top: 1px solid var(--hairline);
}

/* ─── METHOD ─── */
.steps { list-style: none; margin-top: clamp(40px, 7vh, 80px); }
.step {
  display: grid; grid-template-columns: 130px 1fr; gap: clamp(18px, 4vw, 48px);
  align-items: baseline;
  padding: clamp(22px, 4vh, 38px) 0;
  border-top: 1px solid var(--hairline);
  position: relative;
}
.step:last-child { border-bottom: 1px solid var(--hairline); }
.step-num {
  font-family: 'Geist Mono', monospace; font-weight: 500;
  font-size: clamp(40px, 7vw, 86px); color: var(--ash); line-height: 0.9;
  transition: color .4s var(--ease), transform .4s var(--ease);
}
.step:hover .step-num { color: var(--accent); transform: translateX(6px); }
.step-body h3 { font-size: clamp(24px, 4vw, 46px); font-weight: 900; letter-spacing: -0.02em; line-height: 1; margin-bottom: 10px; text-transform: uppercase; }
.step-body p { font-family: 'Newsreader', serif; font-style: italic; font-size: clamp(16px, 2vw, 22px); color: var(--mist); max-width: 540px; }

/* ─── WORK / CARDS ─── */
.cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.4vw, 26px); margin-top: clamp(40px, 7vh, 70px);
}
.card-wide { grid-column: 1 / -1; }
.card {
  background: var(--carbon); border: 1px solid var(--hairline);
  border-radius: 6px; padding: clamp(24px, 3vw, 38px);
  position: relative; overflow: hidden;
  transition: border-color .4s var(--ease), transform .15s var(--ease), box-shadow .4s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.card::before {
  content:''; position:absolute; top:0; left:0; width:100%; height:2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.card:hover { border-color: var(--hairline-strong); box-shadow: 0 30px 70px -40px rgba(0,0,0,.9); }
.card:hover::before { transform: scaleX(1); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.card-tag { color: var(--accent); font-size: 10px; letter-spacing: 0.2em; font-weight: 500; }
.card-year { color: var(--ash); font-size: 10px; letter-spacing: 0.2em; }
.card-title { font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; line-height: 0.95; letter-spacing: -0.025em; text-transform: uppercase; margin-bottom: 16px; }
.card-desc { color: var(--mist); font-size: clamp(14px, 1.5vw, 16px); line-height: 1.55; max-width: 56ch; }
.card-stat { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 6px; flex-wrap: wrap; }
.count, .count-x { font-weight: 900; font-size: clamp(46px, 7vw, 78px); line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.count-label { font-family: 'Geist Mono', monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ash); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist);
  border: 1px solid var(--hairline); border-radius: 100px; padding: 5px 11px;
}

/* ─── SKILLS ─── */
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(40px, 7vh, 64px); }
.skill-col h3 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.skill-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.skill-col li { font-size: clamp(15px, 1.7vw, 19px); font-weight: 500; color: var(--bone); transition: color .25s, transform .25s var(--ease); }
.skill-col li:hover { color: var(--accent); transform: translateX(4px); }

/* ─── PATH / TIMELINE ─── */
.timeline { margin-top: clamp(40px, 7vh, 64px); border-left: 1px solid var(--hairline); }
.tl-item { display: grid; grid-template-columns: 150px 1fr; gap: clamp(16px, 3vw, 40px); padding: clamp(22px, 3.5vh, 36px) 0 clamp(22px, 3.5vh, 36px) clamp(20px, 3vw, 40px); position: relative; }
.tl-item::before {
  content:''; position:absolute; left:-5px; top: clamp(28px, 4vh, 42px); width:9px; height:9px;
  background: var(--ink); border: 1px solid var(--ash); border-radius:50%; transition: background .3s, border-color .3s, transform .3s var(--ease);
}
.tl-item:hover::before { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
.tl-date { font-size: 11px; letter-spacing: 0.16em; color: var(--ash); padding-top: 6px; }
.tl-body h3 { font-size: clamp(20px, 2.6vw, 30px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 10px; }
.tl-body h3 span { color: var(--mist); font-weight: 500; }
.tl-body p { color: var(--mist); font-size: clamp(14px, 1.6vw, 16.5px); line-height: 1.55; max-width: 62ch; }

/* ─── CONTACT ─── */
.contact { text-align: left; padding-bottom: 0; }
.contact-title { font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.86; font-size: clamp(46px, 11vw, 132px); margin: 6px 0 40px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 54px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 26px; border-radius: 4px; font-weight: 700; font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: 0.01em; transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s;
  will-change: transform;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--hairline-strong); color: var(--bone); font-family: 'Geist Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; font-size: clamp(12px,1.4vw,14px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Connect row: CV-style circular avatar (left) + social icon-chips */
.connect { display: flex; align-items: center; gap: clamp(18px, 3vw, 34px); flex-wrap: wrap; padding-bottom: 70px; }
.avatar {
  flex-shrink: 0;
  width: 84px; height: 84px; border-radius: 50%;
  padding: 3px; background: var(--accent);
  box-shadow: 0 0 0 1px var(--ink) inset;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 18%; border: 2px solid var(--ink); }

.socials { display: flex; flex-wrap: wrap; gap: clamp(10px, 1.6vw, 16px); }
.socials a { display: inline-flex; align-items: center; gap: 10px; color: var(--mist); font-family: 'Geist Mono', monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; transition: color .3s, transform .3s var(--ease); }
.socials .ico {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--hairline-strong); color: var(--bone);
  transition: border-color .3s, background .3s, color .3s, transform .3s var(--ease);
}
.socials a:hover { color: var(--accent); }
.socials a:hover .ico { border-color: var(--accent); background: var(--accent); color: var(--ink); transform: translateY(-3px); }

.footer { padding-bottom: 40px; }
.footer-line { height: 1px; background: var(--hairline-strong); margin-bottom: 16px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--mist); }
.ob-chip-sm { width: 26px; height: 26px; font-size: 11px; }
.footer-content .tag { color: var(--ash); }
.footer-content .index { color: var(--accent); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-mask span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); }
.reveal-mask.in span { transform: translateY(0); }
.steps .step.in:nth-child(2) { transition-delay: .06s; }
.steps .step.in:nth-child(3) { transition-delay: .12s; }
.steps .step.in:nth-child(4) { transition-delay: .18s; }
.steps .step.in:nth-child(5) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-mask span { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .cards { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-portrait { width: clamp(150px, 44vw, 210px); }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .nav-links { gap: 14px; font-size: 11px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-links .nav-cta { display: inline-flex; }
  .step { grid-template-columns: 64px 1fr; gap: 16px; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { padding-top: 0; }
  .meta-row { font-size: 9.5px; }
}
@media (max-width: 480px) {
  .skill-grid { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; align-items: flex-start; }
}
