/* ============================================================
   Omar Ebrahim — personal site
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --paper:      #F6EFD4;  /* page background      */
  --card:       #FFFCF0;  /* raised surfaces      */
  --ink:        #262038;  /* text + hairlines     */
  --gold:       #E8A80C;  /* accent               */
  --gold-deep:  #B97F06;  /* accent, on light bg  */
  --muted:      #756C4E;  /* secondary text       */
  --rule-soft:  #DFD3A4;  /* separators           */
  /* Focus ring only — kept separate from --gold-deep, which is a text colour.
     The one hue in this palette that clears WCAG 1.4.11's 3:1 on every surface
     the site uses: 3.56:1 on --paper, 3.99:1 on --card, 3.80:1 on --ink. */
  --focus:      #A87300;

  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --gutter: max(24px, env(safe-area-inset-left));
  --measure: 1140px;
  --marquee-duration: 28s;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip; /* clip doesn't create a scroll container, so position:sticky survives */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .18s ease-out;
}
a:hover { color: var(--gold-deep); }

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

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
/* The dark section can afford the brighter accent — 7.46:1 on --ink. */
.now :focus-visible { outline-color: var(--gold); }

/* ---------- utilities ---------- */
.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  width: 100%;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.eyebrow--dim { color: rgba(246, 239, 212, .55); }

.link-gold { color: var(--gold-deep); }
.gold { color: var(--gold); }

/* section headers ------------------------------------------- */
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-head__title { font: inherit; margin: 0; color: var(--ink); }
.sec-head__meta  { text-align: right; }

.sec-head--invert { border-bottom-color: rgba(246, 239, 212, .25); color: rgba(246, 239, 212, .6); }
.sec-head--invert .sec-head__title { color: var(--paper); }

/* chips ------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 16px 7px 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip img {
  height: 26px; width: 26px;
  object-fit: contain;
  border-radius: 999px;
  background: var(--card);
  flex: none;
}
.chip--bare { padding: 7px 16px; }
.chip--dark { background: var(--ink); color: var(--paper); }
.chip--lg   { padding: 8px 18px 8px 9px; }
.chip--lg img { height: 30px; width: 30px; }
.chip--lg span { font-size: 11px; letter-spacing: .12em; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 96px var(--gutter) 72px;
}

.hero__inner {
  max-width: var(--measure);
  margin-inline: auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
}

.hero__copy  { flex: 1 1 480px; min-width: 0; }
.hero__media { flex: 0 1 360px; min-width: 280px; position: relative; }

.hero__eyebrow { margin-bottom: 28px; animation: rise .5s ease-out .05s both; }

.hero__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 10.5vw, 168px);
  line-height: .94;
  letter-spacing: -.015em;
  margin: 0 0 30px;
  white-space: nowrap;
}
.hero__name span[aria-hidden] {
  display: inline-block;
  animation: riseL .6s ease-out both;
}
/* staggered entrance, per letter */
.hero__name span:nth-of-type(1)  { animation-delay: .12s }
.hero__name span:nth-of-type(2)  { animation-delay: .16s }
.hero__name span:nth-of-type(3)  { animation-delay: .20s }
.hero__name span:nth-of-type(4)  { animation-delay: .24s }
.hero__name span:nth-of-type(5)  { animation-delay: .30s }
.hero__name span:nth-of-type(6)  { animation-delay: .34s }
.hero__name span:nth-of-type(7)  { animation-delay: .38s }
.hero__name span:nth-of-type(8)  { animation-delay: .42s }
.hero__name span:nth-of-type(9)  { animation-delay: .46s }
.hero__name span:nth-of-type(10) { animation-delay: .50s }
.hero__name span:nth-of-type(11) { animation-delay: .54s }

.hero__lede {
  font-size: 20px;
  line-height: 1.5;
  max-width: 36ch;
  margin: 0 0 34px;
  text-wrap: pretty;
  animation: rise .55s ease-out .62s both;
}
.hero__lede strong { font-weight: 700; }

.hero__links {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  animation: rise .55s ease-out .75s both;
}
.hero__links .sep { color: var(--rule-soft); }

/* hero photo + offset colour block */
.hero__media { animation: rise .6s ease-out .85s both; }

.hero__frame {
  position: relative;
  width: min(340px, 86%);
  aspect-ratio: 4 / 5;
  margin-left: auto;
}
.hero__frame-block {
  position: absolute;
  inset: 0;
  background: var(--gold);
  animation: drift 7s ease-in-out infinite;
}
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 1px solid var(--ink);
  background: var(--card);
}

.hero__stamp {
  position: absolute;
  top: -52px; left: -52px;
  width: 112px; height: 112px;
  animation: spin 16s linear infinite;
  pointer-events: none;
}
.hero__stamp svg { width: 100%; height: 100%; overflow: visible; }
.hero__stamp text {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .24em;
  fill: var(--ink);
}

.hero__polaroid {
  position: relative;
  width: 172px;
  margin: -44px 0 0 4px;
  transform: rotate(-4deg);
}
.hero__polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 6px solid var(--card);
  box-shadow: 0 10px 28px rgba(38, 32, 56, .18);
}
.hero__polaroid figcaption {
  margin-top: 8px;
  font-size: 10px;
  text-align: center;
}

.hero__scroll {
  position: absolute;
  left: var(--gutter);
  bottom: 22px;
  animation: rise .5s ease-out 1.05s both;
}
.hero__arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
  padding: 12px 0;
  background: var(--paper);
}
.marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  /* How far one loop travels. 50% is the no-JS fallback (two authored groups,
     the original behaviour); main.js clones groups until the track covers the
     viewport twice and then pins this to one group's exact pixel width, which
     is what stops the blank band appearing on wide screens. */
  --mq-shift: 50%;
  animation: mq var(--marquee-duration) linear infinite;
}
/* WCAG 2.2.2 — give people a way to stop the movement */
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }

.marquee__group {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px 0 0;
  margin: 0;
  list-style: none;
}

/* ============================================================
   STORY  (scroll-driven chapters)
   ============================================================ */
.story { height: 420svh; position: relative; }

.story__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px var(--gutter);
  overflow: hidden;
}

.story__body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 72px;
  align-items: center;
  margin-top: 24px;
  min-height: 46svh;
}

.story__num {
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(140px, 24vh, 300px);
  line-height: .85;
  color: #2F7FD1;
  font-variant-numeric: tabular-nums;
  transition: opacity .16s ease-out, transform .16s ease-out;
}

.story__text { flex: 1 1 380px; min-width: 260px; }
.story__text > div { transition: opacity .16s ease-out, transform .16s ease-out; }

.story__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  margin: 0 0 16px;
}
.story__blurb {
  font-size: 18px;
  line-height: 1.55;
  max-width: 52ch;
  margin: 0 0 20px;
  text-wrap: pretty;
}

.story__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}
.story__foot a { font-size: 12px; letter-spacing: .08em; }

.rail { display: flex; gap: 6px; flex-wrap: wrap; }
.rail button {
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding: 8px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rail button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ============================================================
   NOW / ANTICIPY
   ============================================================ */
.now { background: var(--ink); padding: 110px 0; }

.now__body {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  margin-top: 56px;
  align-items: flex-start;
}

.now__copy {
  flex: 1 1 480px;
  min-width: 280px;
  color: var(--paper);
}
.now__copy p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 58ch;
  text-wrap: pretty;
}
.now__copy p:last-child { margin-bottom: 0; }

.now__lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(34px, 4.6vw, 58px) !important;
  line-height: 1.08 !important;
  margin-bottom: 30px !important;
}

.now__copy .link-gold {
  color: var(--gold);
  text-decoration-color: rgba(232, 168, 12, .5);
}

.now__card {
  flex: 1 1 320px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brandcard {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border-radius: 12px;
  padding: 16px 20px;
}
.brandcard img { height: 56px; width: 56px; object-fit: contain; border-radius: 10px; flex: none; }
.brandcard__name { font-family: var(--serif); font-size: 24px; margin: 0; color: var(--ink); }
.brandcard .eyebrow { font-size: 10px; letter-spacing: .12em; margin-top: 4px; }

.now__shot {
  aspect-ratio: 3 / 2;
  border: 1px dashed rgba(246, 239, 212, .4);
  border-radius: 12px;
  overflow: hidden;
}
.now__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================================
   THE NOTE
   ============================================================ */
.note { padding-top: 120px; }

.note__card {
  max-width: 640px;
  margin: 44px auto 0;
  border: 1px solid var(--ink);
  background: var(--card);
  box-shadow: 8px 8px 0 var(--gold);
  padding: 34px;
}

.note__pitch { font-size: 17px; line-height: 1.55; margin: 0 0 24px; text-wrap: pretty; }

.note__form { display: flex; flex-wrap: wrap; gap: 12px; }
.note__form input {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--sans);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
}
.note__form input::placeholder { color: #9a9182; }
/* No outline-color override here: --gold measured 1.80:1 against the input's
   own fill, i.e. an invisible ring on the most important control on the page.
   The shared :focus-visible ring is the accessible one. */

.note__form button {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  padding: 12px 22px;
  background: var(--gold);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.note__form button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.note__form button:active { transform: none; box-shadow: none; }

.note__fine { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

/* Failure state for the signup. Deliberately not red-on-cream shouty —
   it sits in the same rhythm as the fine print, just darker and marked. */
.note__error {
  font-size: 14px;
  line-height: 1.45;
  color: #8C2F1B;
  margin: 14px 0 0;
  padding-left: 12px;
  border-left: 2px solid #8C2F1B;
}
.note__error[hidden] { display: none; }

.note__form button[disabled] { opacity: .6; cursor: progress; }

.note__confirm {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  margin: 0;
  color: var(--gold-deep);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease-out, transform .35s ease-out;
}
.note__confirm.is-in { opacity: 1; transform: none; }

/* ============================================================
   STATUS
   ============================================================ */
.status { padding-top: 120px; padding-bottom: 110px; }

.status__body {
  max-width: 640px;
  margin: 44px auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.status__lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.3;
  margin: 0;
  text-wrap: pretty;
}
.status__muted { font-size: 17px; line-height: 1.55; color: var(--muted); margin: 0; text-wrap: pretty; }
.status__line  { font-size: 17px; line-height: 1.55; margin: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer__row {
  border-top: 1px solid var(--ink);
  padding: 20px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.footer__row a { color: var(--muted); }
.footer__links { display: flex; gap: 14px; }

/* ============================================================
   SCROLL REVEALS
   ============================================================ */
/* Gated on .js so the content is never hidden when scripts don't run. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity   .5s ease-out var(--reveal-delay, 0s),
    transform .5s ease-out var(--reveal-delay, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes riseL {
  from { opacity: 0; transform: translateY(.55em) rotate(2.5deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mq    { to { transform: translateX(calc(-1 * var(--mq-shift))); } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes drift {
  0%, 100% { transform: translate(14px, 14px); }
  50%      { transform: translate(24px, 26px); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   NARROW SCREENS
   ============================================================ */
@media (max-width: 720px) {
  .hero { padding-top: 72px; }
  .hero__inner { gap: 40px; }
  .hero__media { flex-basis: 100%; }
  /* Keep the frame right-aligned so the stamp's negative offset stays on screen. */
  .hero__frame { width: min(280px, 72%); margin-inline: auto 0; }
  .hero__stamp { top: -30px; left: -30px; width: 84px; height: 84px; }
  .hero__polaroid { width: 140px; margin: -36px auto 0 0; }

  .story { height: 480svh; }
  .story__body { gap: 8px 32px; }
  .story__num { font-size: clamp(96px, 18vh, 180px); }

  .now { padding: 80px 0; }
  .note, .status { padding-top: 88px; }
  .note__card { padding: 24px; box-shadow: 6px 6px 0 var(--gold); }
  .sec-head { font-size: 10px; }
}
