/* ============================================================
   eliasbouzeid.com · Typographic Poster (dark cinematic)
   Palette: 3 hues · off-black ground, warm bone text, amber accent
   Motion: spring linear() palette, cubic-bezier fallback
   ============================================================ */

@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Light.woff2') format('woff2');
  font-weight: 200;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../fonts/ClashDisplay-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #000000;
  --ink: #f2efe9;
  --ink-muted: rgba(242, 239, 233, 0.52);
  --ink-faint: rgba(242, 239, 233, 0.12);
  --accent: #e08a3c;

  --font-display: 'Clash Display', 'Helvetica Neue', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 5rem);

  /* Spring physics (Apple snappy: m1 k400 d30) with settle */
  --spring-snappy: linear(
    0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%,
    0.938 16.7%, 1.017 19.4%, 1.067 22.5%, 1.089 26%,
    1.079 30.3%, 1.049 36%, 1.024 42.6%, 1.011 50.3%,
    1.004 59.2%, 1.001 69.3%, 1
  );
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-dramatic: cubic-bezier(0.77, 0, 0.175, 1);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

/* ---- Nav ---------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.4rem var(--gutter);
  gap: 1.25rem;
  mix-blend-mode: difference;
}

.nav__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav__mark-dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Sweeping underline links ------------------------------ */

.link-sweep {
  position: relative;
  text-decoration: none;
}
.link-sweep::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-snap);
}
.link-sweep:hover::after,
.link-sweep:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---- Hero: Typographic Poster ------------------------------ */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem var(--gutter) 4.5rem;
  overflow: hidden;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: clamp(1rem, 2.5vh, 2rem);
}

/* line-height 1.08 keeps every glyph (plus baseline overshoot) inside the
   mask's clip box in all browsers regardless of font metric tables; the
   tight 0.92 visual leading is recreated by pulling the second line up */
.hero__name {
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 13.5vw, 14rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
}

.hero__line { display: block; }
.hero__line--first { font-weight: 600; }
.hero__line--last {
  font-weight: 200;
  align-self: flex-end;
  color: var(--accent);
  margin-top: -0.16em;
}

/* Masked word reveal: overflow-hidden wrapper, word rises from below.
   The padding widens the clip window so glyph ink that paints outside the
   text advance box is not cut: negative letter-spacing shrinks the box by
   0.045em per glyph INCLUDING the last one, so the final glyph's ink hangs
   past the right edge; font metric boxes also differ per engine vertically.
   The negative margins cancel the padding out of the layout. */
.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.1em 0.08em;
  margin: -0.1em -0.08em;
}
.mask__inner {
  display: inline-block;
  will-change: transform;
}
.js .mask__inner {
  transform: translateY(115%);
  animation: mask-rise 0.9s var(--spring-snappy) both;
  animation-delay: var(--stagger, 0ms);
}
@supports not (animation-timing-function: linear(0, 1)) {
  .js .mask__inner { animation-timing-function: var(--ease-out); }
}
@keyframes mask-rise {
  to { transform: translateY(0); }
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

.hero__sub {
  max-width: 34ch;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  color: var(--ink-muted);
}

.hero__meta {
  position: absolute;
  bottom: 1.6rem;
  left: var(--gutter);
  right: var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---- CTA (pressure button) --------------------------------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  min-height: 44px;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
}

.cta__arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.4s var(--ease-snap);
}
.cta:hover .cta__arrow { transform: translate(2px, 2px); }

.btn-pressure {
  transition:
    transform 0.55s var(--spring-snappy),
    border-color 0.3s var(--ease-snap),
    background-color 0.3s var(--ease-snap);
  will-change: transform;
}
@supports not (transition-timing-function: linear(0, 1)) {
  .btn-pressure { transition-timing-function: var(--ease-out); }
}
.btn-pressure:hover {
  transform: scale(0.97);
  border-color: var(--accent);
  background: rgba(224, 138, 60, 0.07);
}
.btn-pressure:active {
  transform: scale(0.94);
  transition-duration: 0.08s;
}
.btn-pressure:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Sections ---------------------------------------------- */

.section {
  padding: clamp(4.5rem, 12vh, 8rem) var(--gutter);
}

.section__head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.rule {
  flex: 1;
  height: 1px;
  background: var(--ink-faint);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-dramatic) 0.15s;
}
.is-visible .rule { transform: scaleX(1); }
html:not(.js) .rule { transform: scaleX(1); }

/* ---- Writing index ----------------------------------------- */

.index { list-style: none; }

.index__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.4rem, 3.5vh, 2.2rem) 0;
  border-bottom: 1px solid var(--ink-faint);
  text-decoration: none;
  transition: border-color 0.4s var(--ease-snap);
}
.index li:first-child .index__row { border-top: 1px solid var(--ink-faint); }
.index__row:hover { border-bottom-color: var(--accent); }

.index__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  transition: color 0.3s var(--ease-snap);
}
.index__row:hover .index__num { color: var(--accent); }

.index__body { min-width: 0; }

.index__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  transform: translateX(0);
  transition: transform 0.5s var(--ease-snap);
}
.index__row:hover .index__title { transform: translateX(0.5rem); }

.index__meta {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.index__arrow {
  font-size: 1.2rem;
  color: var(--ink-muted);
  transition: transform 0.4s var(--ease-snap), color 0.3s var(--ease-snap);
}
.index__row:hover .index__arrow {
  transform: translate(4px, -4px);
  color: var(--accent);
}
.index__row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* Compact variant: blog picks under Consulting */
.index-intro {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.index--compact .index__title {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 400;
}
.index--compact .index__row {
  padding: clamp(1rem, 2.5vh, 1.4rem) 0;
}
.index--compact .index__meta { margin-top: 0.3rem; }

/* ---- Split sections (Consulting / Resume) ------------------ */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.split__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.split__body p {
  color: var(--ink-muted);
  max-width: 48ch;
  margin-bottom: 1.6rem;
}

.split__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.link-out {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.link-out span { color: var(--accent); }

/* ---- Footer ------------------------------------------------ */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 2.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.footer__links {
  display: inline-flex;
  gap: 1.25rem;
}

.footer__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}

/* ---- Entry animations (page load) -------------------------- */

@keyframes enter-up {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes enter-down {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes enter-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.js .enter-up {
  animation: enter-up 0.7s var(--ease-out) both;
  animation-delay: var(--stagger, 0ms);
}
.js .enter-down {
  animation: enter-down 0.6s var(--ease-out) both;
}
.js .enter-fade {
  animation: enter-fade 0.8s var(--ease-out) both;
  animation-delay: var(--stagger, 0ms);
}

/* ---- Scroll reveals ---------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    filter 0.8s var(--ease-out);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.js [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.js [data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.js [data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 90ms; opacity: 1; transform: translateY(0); }
.js [data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 180ms; opacity: 1; transform: translateY(0); }

/* ---- Mobile collapse --------------------------------------- */

@media (max-width: 767px) {
  .hero__line--last { align-self: flex-start; }
  .hero__meta { position: static; margin-top: 3rem; }
  .hero { padding-bottom: 2rem; }
  .split { grid-template-columns: 1fr; }
  .index__row { grid-template-columns: auto 1fr; }
  .index__arrow { display: none; }
  .nav__links {
    gap: 0.8rem;
    font-size: 0.64rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ---- Reduced motion ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .enter-up,
  .js .enter-down,
  .js .enter-fade,
  .js .mask__inner {
    animation: enter-fade 0.3s ease both;
    animation-delay: 0ms;
  }
  /* Reset the static translate on the masked name; without this the
     hero name stays clipped out of view under reduced motion. */
  .js .mask__inner { transform: none; }
  .js [data-reveal],
  .js [data-reveal-stagger] > * {
    transform: none !important;
    filter: none !important;
    transition: opacity 0.3s ease;
    transition-delay: 0ms !important;
  }
  .rule { transform: scaleX(1) !important; transition: none; }
  .btn-pressure,
  .cta__arrow,
  .index__title,
  .index__arrow { transition: none; }
}
