/* ==========================================================================
   Ehab Ayman — portfolio
   Layer order: tokens → reset → primitives → layout → components → responsive
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
  /* Palette. Gold on near-black; no second accent by design. */
  --bg:          #0d0b08;
  --bg-raised:   #12100b;
  --gold:        #d9b03e;
  --gold-deep:   #a3782a;
  --gold-light:  #f0d27a;
  --cream:       #f5f1e6;
  --text-muted:  #b0a68c;
  --text-dim:    #8a7f63;
  --text-body:   #c9bda0;

  /* Gold at fixed alphas — every hairline and wash derives from these. */
  --rule:        rgba(217, 176, 62, .15);
  --rule-soft:   rgba(217, 176, 62, .08);
  --rule-strong: rgba(217, 176, 62, .30);
  --wash:        rgba(217, 176, 62, .06);
  --highlight:   rgba(245, 241, 230, .07);

  --font-display: 'Alegreya Sans SC', sans-serif;
  --font-body:    Montserrat, sans-serif;
  --font-accent:  'Cormorant Garamond', serif;

  --shell:      1150px;
  --gutter:     clamp(20px, 4vw, 32px);
  --section-y:  clamp(48px, 7vw, 96px);
  --header-h:   71px;   /* 13 + 44 logo + 13 + 1px border */
  --stick-top:  104px;

  --ease:  cubic-bezier(.22, .8, .3, 1);
  --swift: .35s var(--ease);
  --slow:  .8s var(--ease);
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 14px);
}

body {
  margin: 0;
  padding-top: var(--header-h);   /* the fixed header leaves no space of its own */
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dt, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color .3s linear;
}
a:hover { color: var(--gold-light); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* --- Scrollbars ----------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--gold-deep) var(--wash); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--wash); border-left: 1px solid var(--rule); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-deep), var(--gold));
  border: 2px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold), var(--gold-light)); }
::-webkit-scrollbar-thumb:active { background: var(--gold-light); }

/* --- Primitives ----------------------------------------------------------- */
/* Hidden by sliding up rather than parking off-screen, so the box never
   contributes horizontal extent. */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 14px 22px;
  background: var(--gold);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  transform: translateY(-100%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: none; color: var(--bg); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--solid { fill: currentColor; stroke: none; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--gold);
}

.btn {
  display: inline-block;
  padding: 14px 34px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background var(--swift), color var(--swift), border-color var(--swift);
}
.btn--solid { background: var(--gold); color: var(--bg); }
.btn--solid:hover { background: var(--gold-light); color: var(--bg); }
.btn--ghost { border: 1px solid var(--rule-strong); color: var(--cream); font-weight: 600; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }


/* Grid and flex children default to `min-width: auto`, which refuses to shrink
   below their intrinsic content width. An <input> derives that width from its
   default size="20" attribute, NOT from `width: 100%` — so a single field can
   force a section wider than a phone screen and push the whole page sideways. */
.section--split > *,
.hero > *,
.form,
.form__label,
.field,
.skills,
.roles,
.role__head,
.role__head > *,
.timeline,
.cards,
.card,
.card__body,
.vitals,
.facts { min-width: 0; }

/* Long unbroken strings (an email address, a company name) must never be the
   thing that widens the page either. */
.field, .vitals__val, .role__where, .edu__school, .card__title { overflow-wrap: break-word; }

/* Scroll-reveal transforms push elements sideways until the observer fires,
   which extends the document's scrollable width. `clip` contains that without
   creating a scroll container, so `position: sticky` keeps working (which
   `overflow: hidden` here would break). */
main { overflow-x: clip; }

/* --- Layout --------------------------------------------------------------- */
.section {
  max-width: var(--shell);
  margin-inline: auto;
  padding: var(--section-y) var(--gutter);
  border-top: 1px solid var(--rule);
}

/* Two-column editorial split. `.is-flipped` moves the sticky head right. */
.section--split {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(min(100%, 300px), 2.2fr);
  gap: clamp(24px, 4vw, 56px);
}
.section--split.is-flipped { grid-template-columns: minmax(min(100%, 300px), 2.2fr) minmax(180px, 1fr); }

/* Alternating value, so the page is not one flat plane of hairlines. */
#about, #experience, #education {
  background-image: radial-gradient(120% 75% at 0% 0%, rgba(217, 176, 62, .05), transparent 62%);
}

/* --- Section heads + ghost numerals --------------------------------------- */
.sechead { position: sticky; top: var(--stick-top); }
.sechead > * { position: relative; }   /* keeps copy above the numeral */

.sechead::before {
  content: attr(data-num);
  position: absolute;
  left: -12px;
  top: -66px;
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(110px, 12vw, 178px);
  line-height: .78;
  letter-spacing: -6px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(217, 176, 62, .15);
  pointer-events: none;
  user-select: none;
}

.sechead__label { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-dim); }
.sechead__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(36px, 4vw, 50px); margin-top: 2px; }
.sechead__note  { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-muted); line-height: 1.7; margin-top: 14px; max-width: 220px; }
.dot { color: var(--gold); }

.lede { font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.4; }
.prose-muted { color: var(--text-muted); line-height: 1.8; }
.prose-muted--narrow { max-width: 600px; }
.prose-muted--wide { max-width: 520px; }
.prose-muted--intro { margin: 12px 0 36px; }

/* --- Side rail ------------------------------------------------------------ */
.rail {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 30;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px 0 36px;
  pointer-events: none;
}
.rail__name,
.rail__link {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  color: var(--text-dim);
}
.rail__name { font-size: 12px; font-weight: 600; letter-spacing: 5px; }
.rail__link { font-size: 10px; letter-spacing: 4px; pointer-events: auto; }
.rail__line { flex: 1; width: 1px; min-height: 40px; margin: 20px 0; background: var(--rule-strong); }

/* --- Header --------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(217, 176, 62, .18);
  background: linear-gradient(180deg, rgba(13, 11, 8, .74), rgba(13, 11, 8, .52));
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  box-shadow: inset 0 1px 0 var(--highlight), 0 12px 34px rgba(0, 0, 0, .45);
}

.header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 13px var(--gutter);
}

/* The signature is the wordmark. Height stays 44px so --header-h holds. */
.brand { display: flex; align-items: center; }
.brand__mark { height: 44px; width: auto; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 13px; font-weight: 500; letter-spacing: 1px; }

.nav__link {
  position: relative;
  padding-bottom: 5px;
  color: var(--text-muted);
  transition: color .3s;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current='true']::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current='true'] { color: var(--cream); }

.nav__cta {
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 9px 22px;
  border-radius: 2px;
  letter-spacing: 2px;
  font-size: 12px;
  transition: background var(--swift), color var(--swift);
}
.nav__cta:hover { background: var(--gold); color: var(--bg); }

/* --- Mobile menu ---------------------------------------------------------- */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 60;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform var(--swift), opacity var(--swift), margin var(--swift);
}
.burger span:nth-child(1) { width: 30px; }
.burger span:nth-child(2) { width: 20px; }
.burger span:nth-child(3) { width: 26px; }
.burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; margin-left: 10px; }
.burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg) scaleX(1.16); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;   /* below .header, so the burger stays reachable */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px clamp(28px, 8vw, 60px) 40px;
  background: rgba(13, 11, 8, .78);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--swift);
}
.menu.is-open { opacity: 1; pointer-events: auto; }
.menu[hidden] { display: none; }

.menu__watermark { position: absolute; right: -70px; bottom: -90px; height: 380px; width: auto; opacity: .1; pointer-events: none; }
.menu__label { font-family: var(--font-accent); font-style: italic; font-size: 16px; color: var(--text-dim); margin-bottom: 24px; }
.menu__list { display: flex; flex-direction: column; gap: 4px; }
.menu__label, .menu__list, .menu__contact { transform: translateY(26px); transition: transform .45s var(--ease); }
.menu.is-open .menu__label,
.menu.is-open .menu__list,
.menu.is-open .menu__contact { transform: none; }

.menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(217, 176, 62, .12);
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(34px, 9vw, 52px);
  color: var(--cream);
}
.menu__link:hover { color: var(--gold); }
.menu__link em { font-family: var(--font-accent); font-style: italic; font-size: 15px; color: var(--gold); }
.menu__link--cta { font-weight: 300; color: var(--gold); border-bottom: none; }
.menu__link--cta em { color: var(--text-dim); }
.menu__contact { margin-top: 30px; font-size: 12px; letter-spacing: 2px; color: var(--text-dim); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 88px) var(--gutter) clamp(48px, 7vw, 96px);
}

.portrait { position: relative; }
.portrait__glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 90%; height: 90%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(217, 176, 62, .28) 0%, transparent 68%);
  animation: breathe 7s ease-in-out infinite;
  pointer-events: none;
}
.portrait__frame {
  position: absolute;
  inset: 22px -22px -22px 22px;
  border: 1px solid var(--rule-strong);
  animation: drift 8s ease-in-out infinite;
}
.portrait__stack { position: relative; overflow: hidden; contain: paint; }
.portrait__img { width: 100%; height: clamp(440px, 54vw, 640px); object-fit: cover; }

/* Three offset copies clipped on different rhythms = RGB tear. */
.portrait__ghost {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.portrait__ghost--a { animation: tearA 2.8s steps(1) infinite, settle 9s linear infinite; filter: brightness(1.25) contrast(1.1); }
.portrait__ghost--b { animation: tearB 3.7s steps(1) infinite, settle 9s linear infinite; filter: sepia(.9) saturate(2.6) brightness(1.05); opacity: .9; }
.portrait__ghost--c { animation: tearA 4.6s steps(1) infinite reverse, settle 9s linear infinite; filter: brightness(.7) contrast(1.3); opacity: .85; }

.portrait__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
  opacity: .55;
  animation: scan 1.2s linear infinite;
  pointer-events: none;
}
.portrait__monogram {
  position: absolute;
  right: 16px; bottom: 14px;
  z-index: 2;
  height: clamp(96px, 12vw, 150px);
  width: auto;
  filter: drop-shadow(0 12px 34px rgba(0, 0, 0, .75)) drop-shadow(0 0 22px rgba(217, 176, 62, .3));
}

.hero__copy { padding-bottom: clamp(10px, 3vw, 48px); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(56px, 8vw, 102px);
  line-height: .94;
  letter-spacing: -4px;
  margin: 18px 0 24px;
}
.hero__title b { font-weight: 500; color: var(--gold); }
.hero__intro {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.7;
  color: #d8cfb8;
  max-width: 440px;
  margin-bottom: 32px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- About ---------------------------------------------------------------- */
.pullquote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.32;
  margin-bottom: 20px;
}
.pullquote q { quotes: none; }
.pullquote em { font-family: var(--font-accent); font-style: italic; color: var(--gold); font-size: 1.4em; line-height: 0; }
.pullquote b { font-weight: inherit; color: var(--gold); }

/* 1px gaps over a gold ground draw the dividers — no per-cell borders. */
.vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  margin-top: 38px;
  background: rgba(217, 176, 62, .18);
  border: 1px solid rgba(217, 176, 62, .18);
}
.vitals__cell { background: var(--bg); padding: 18px 20px; }
.vitals__key { font-size: 10px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 6px; }
.vitals__val { font-size: 14px; color: var(--cream); }
a.vitals__val:hover { color: var(--gold); }
.vitals__val--link { color: var(--gold); }

/* --- Skills --------------------------------------------------------------- */
.skills { display: flex; flex-direction: column; gap: 24px; }
.skill__head { display: flex; align-items: baseline; gap: 16px; font-size: 14px; margin-bottom: 10px; }
.skill__num { flex: none; font-family: var(--font-accent); font-style: italic; font-size: 15px; color: var(--text-dim); }
.skill__name { font-weight: 500; letter-spacing: .5px; }
.skill__track { height: 2px; background: rgba(217, 176, 62, .14); border-radius: 99px; overflow: hidden; }
.skill__fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-light));
  transition: width 1.4s var(--ease);
}

/* --- Experience accordion -------------------------------------------------- */
.roles { display: flex; flex-direction: column; }

.role {
  position: relative;
  border-bottom: 1px solid var(--rule);
  transition: background var(--swift);
}
.role::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-deep), var(--gold), var(--gold-light));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .45s var(--ease);
  pointer-events: none;
}
.role:hover { background: linear-gradient(90deg, rgba(217, 176, 62, .07), transparent 72%); }
.role:hover::before,
.role.is-open::before { transform: scaleY(1); }

.role__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 21px 2px;
  text-align: left;
  cursor: pointer;
  flex-wrap: wrap;
  transition: padding-left .4s var(--ease);
}
.role:hover .role__head,
.role.is-open .role__head { padding-left: 20px; }

.role__num { flex: none; font-family: var(--font-accent); font-style: italic; font-size: 16px; color: var(--text-dim); transition: color .3s; }
.role.is-open .role__num { color: var(--gold); }
.role__title { font-family: var(--font-display); font-size: 22px; letter-spacing: .5px; color: var(--cream); transition: color .3s; }
.role.is-open .role__title { color: var(--gold); }
.role__where { display: block; font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.role__period {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold);
  transition: background var(--swift), color var(--swift), border-color var(--swift);
}
.role.is-open .role__period { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.role__period .icon { transition: transform var(--swift); }
.role.is-open .role__period .icon { transform: rotate(180deg); }

/* grid-template-rows 0fr→1fr animates to auto height without measuring. */
.role__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.role.is-open .role__panel { grid-template-rows: 1fr; }
.role__panel > div { overflow: hidden; }

.role__body { padding: 2px 2px 26px 34px; transition: padding-left .4s var(--ease); }
.role:hover .role__body,
.role.is-open .role__body { padding-left: 52px; }

.role__body li {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  color: var(--text-body);
  font-size: 13.5px;
  line-height: 1.85;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s var(--ease);
}
.role.is-open .role__body li { opacity: 1; transform: none; }
.role__body li::before { content: '✦'; color: var(--gold); }

/* --- Facts ---------------------------------------------------------------- */
/* Full-bleed band without breaking the grid: a -1 layer inside an isolated
   stacking context, stretched past the shell with 50vw margins. */
#facts { position: relative; isolation: isolate; }
#facts::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  z-index: -1;
  background: linear-gradient(180deg, rgba(217, 176, 62, .06), rgba(217, 176, 62, .012));
  border-block: 1px solid var(--rule);
  pointer-events: none;
}

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 40px; }
.fact {
  position: relative;
  padding: 30px 22px 26px;
  border: 1px solid rgba(217, 176, 62, .25);
  text-align: center;
  overflow: hidden;
  transition: border-color .3s;
}
.fact:hover { border-color: var(--gold); }
.fact__watermark { position: absolute; right: -18px; bottom: -24px; height: 82px; width: auto; opacity: .12; pointer-events: none; }
.fact .icon { color: var(--gold); font-size: 20px; }
.fact__n { font-family: var(--font-display); font-weight: 300; font-size: 54px; line-height: 1.05; margin-top: 12px; }
.fact__n span { color: var(--gold); }
.fact__label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }

/* --- Education ------------------------------------------------------------ */
.timeline { border-left: 1px solid var(--rule-strong); padding-left: clamp(20px, 3vw, 34px); }

.edu { position: relative; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.edu::before {
  content: '';
  position: absolute;
  left: calc(-5px - clamp(20px, 3vw, 34px));
  top: 18px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
}
.edu__row { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.edu__title { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.edu__school { display: block; font-size: 13px; color: var(--text-dim); }
.edu__year { margin-left: auto; font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-dim); }

/* Degrees outrank certificates. */
.edu--major { padding: 22px 0; }
.edu--major::before { left: calc(-8px - clamp(20px, 3vw, 34px)); top: 30px; width: 13px; height: 13px; background: var(--gold); }
.edu--major .edu__title { font-family: var(--font-display); font-weight: 300; font-size: 25px; letter-spacing: .5px; color: var(--cream); }
.edu--major .edu__year { font-size: 24px; color: var(--gold); }

/* --- Contact -------------------------------------------------------------- */
.contact__title { font-family: var(--font-display); font-weight: 100; font-size: clamp(38px, 4.6vw, 60px); margin-bottom: 14px; }
.contact__title em { font-family: var(--font-accent); font-style: italic; font-weight: 500; color: var(--gold); }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; max-width: 640px; margin-top: 34px; }
.form__row { grid-column: 1 / -1; }
.form__label { display: block; font-size: 10px; letter-spacing: 3px; color: var(--text-dim); }

.field {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(217, 176, 62, .25);
  color: var(--cream);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--swift);
}
.field:focus { outline: none; border-bottom-color: var(--gold); }
.field:focus-visible { outline: none; }
textarea.field { resize: none; }

.form__submit { justify-self: start; grid-column: 1 / -1; padding: 15px 48px; letter-spacing: 3px; }
.form__status { grid-column: 1 / -1; font-size: 12px; letter-spacing: 1px; color: var(--text-dim); min-height: 1.2em; }

/* --- Journal -------------------------------------------------------------- */
.journal__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 32px; flex-wrap: wrap; }
.journal__kicker { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-dim); }
.journal__title { font-family: var(--font-display); font-weight: 300; font-size: clamp(28px, 3vw, 38px); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }

.card {
  display: flex;
  color: inherit;
  flex-direction: column;
  width: 100%;
  border: 1px solid rgba(217, 176, 62, .2);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .3s;
}
.card:hover { border-color: var(--gold); color: inherit; }
.card__media { display: block; position: relative; height: 190px; overflow: hidden; }
.card__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(13, 11, 8, .85) 100%); }
.card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.25) contrast(1.05);
  transition: transform .8s var(--ease), filter .8s;
}
.card:hover .card__img { transform: scale(1.08) rotate(.6deg); filter: saturate(1); }
.card__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 22px 24px 24px; }
.card__title, .card__more { display: block; }
.card__meta { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 2px; color: var(--text-dim); }
.card__meta .icon { color: var(--gold); }
.card__title { font-family: var(--font-display); font-size: 23px; line-height: 1.3; }
.card__more { margin-top: auto; font-size: 12px; letter-spacing: 2px; color: var(--gold); }

/* --- Article pages -------------------------------------------------------- */

/* Slim header for reading pages: brand + a way back, nothing else. */
.header--slim .header__inner { padding-block: 13px; }

.reader { max-width: 820px; margin-inline: auto; padding: 0 var(--gutter) clamp(48px, 7vw, 96px); }

.reader__hero { margin: 0 calc(var(--gutter) * -1) clamp(24px, 4vw, 40px); overflow: hidden; }
.reader__hero img { width: 100%; height: clamp(240px, 34vw, 420px); object-fit: cover; }
.reader__hero--square img { object-position: center 40%; }

.reader__meta { font-size: 11px; letter-spacing: 3px; color: var(--gold); margin-bottom: 12px; }
.reader__meta a { color: var(--gold); }

.reader__title {
  font-family: var(--font-display);
  font-weight: 100;
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -2px;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.reader .prose { padding: 0; }
.reader .prose p { font-size: 16px; line-height: 1.95; }

.reader__more { margin-top: clamp(36px, 5vw, 60px); border-top: 1px solid var(--rule); padding-top: 24px; }
.reader__more-label { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-dim); margin-bottom: 12px; }
.reader__more-link {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--cream);
  transition: color .3s, padding-left .4s var(--ease);
}
.reader__more-link:hover { color: var(--gold); padding-left: 12px; }

/* Spam trap. Clipped rather than display:none, which many bots skip — and
   clipped rather than parked off-screen, which can widen the document. */
.form__trap {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form__status:not(:empty) { padding-top: 4px; }
.form__status--ok { color: var(--gold); }
.form__status--error { color: #e0876a; }

.prose { padding: clamp(22px, 4vw, 40px); }
.prose p { color: var(--text-body); line-height: 1.95; font-size: 14.5px; margin-bottom: 18px; }
.prose p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 74px;
  line-height: .8;
  padding: 6px 12px 0 0;
  color: var(--gold);
}
.prose b { color: var(--gold); font-weight: 600; letter-spacing: .3px; }
.prose .btn { margin-top: 10px; padding: 13px 34px; font-size: 11px; letter-spacing: 3px; }

/* --- Footer --------------------------------------------------------------- */
.footer { padding: 44px var(--gutter) 40px; border-top: 1px solid var(--rule); text-align: center; }
.footer__motto { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-muted); margin: 0 0 20px; }
.footer__signature { height: 52px; width: auto; margin: 0 auto 26px; opacity: .95; }
.footer__social {
  display: inline-flex;
  width: 50px; height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--gold);
  font-size: 18px;
  transition: background var(--swift), color var(--swift);
}
.footer__social:hover { background: var(--gold); color: var(--bg); }
.footer__legal { font-size: 12px; letter-spacing: 2px; color: var(--text-dim); margin-top: 22px; }

/* --- Reveal on scroll ------------------------------------------------------ */
[data-reveal] { opacity: 0; }
[data-reveal='up']    { transform: translateY(46px); }
[data-reveal='down']  { transform: translateY(-46px); }
[data-reveal='left']  { transform: translateX(-56px); }
[data-reveal='right'] { transform: translateX(56px); }
[data-reveal='zoom']  { transform: scale(.82); }
[data-reveal='swing'] { transform: rotate(-7deg) translateY(-20px); }
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity var(--slow), transform var(--slow);
}

/* --- Keyframes ------------------------------------------------------------- */
@keyframes drift    { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(10px, 10px); } }
@keyframes breathe  { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }
@keyframes scan     { from { background-position: 0 0; } to { background-position: 0 6px; } }
@keyframes kenburns { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09) translate(-1.4%, -1%); } }
@keyframes settle   { 0%, 72%, 100% { opacity: 1; } 73%, 86% { opacity: 0; } }

@keyframes tearA {
  0%   { clip-path: inset(12% 0 82% 0); transform: translateX(-10px); }
  8%   { clip-path: inset(44% 0 46% 0); transform: translateX(8px); }
  16%  { clip-path: inset(70% 0 22% 0); transform: translateX(-6px); }
  24%  { clip-path: inset(28% 0 64% 0); transform: translateX(12px); }
  32%  { clip-path: inset(88% 0 4% 0);  transform: translateX(-9px); }
  40%  { clip-path: inset(4% 0 90% 0);  transform: translateX(7px); }
  48%  { clip-path: inset(56% 0 36% 0); transform: translateX(-12px); }
  56%  { clip-path: inset(18% 0 74% 0); transform: translateX(9px); }
  64%  { clip-path: inset(78% 0 14% 0); transform: translateX(-7px); }
  72%  { clip-path: inset(36% 0 56% 0); transform: translateX(11px); }
  80%  { clip-path: inset(62% 0 30% 0); transform: translateX(-10px); }
  88%  { clip-path: inset(8% 0 86% 0);  transform: translateX(6px); }
  100% { clip-path: inset(50% 0 42% 0); transform: translateX(-8px); }
}
@keyframes tearB {
  0%   { clip-path: inset(64% 0 28% 0); transform: translateX(9px); }
  10%  { clip-path: inset(20% 0 72% 0); transform: translateX(-11px); }
  20%  { clip-path: inset(82% 0 10% 0); transform: translateX(6px); }
  30%  { clip-path: inset(38% 0 54% 0); transform: translateX(-8px); }
  40%  { clip-path: inset(6% 0 88% 0);  transform: translateX(12px); }
  50%  { clip-path: inset(52% 0 40% 0); transform: translateX(-6px); }
  60%  { clip-path: inset(74% 0 18% 0); transform: translateX(10px); }
  70%  { clip-path: inset(26% 0 66% 0); transform: translateX(-12px); }
  80%  { clip-path: inset(90% 0 2% 0);  transform: translateX(7px); }
  90%  { clip-path: inset(14% 0 78% 0); transform: translateX(-9px); }
  100% { clip-path: inset(46% 0 46% 0); transform: translateX(8px); }
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1260px) {
  .rail { display: none; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: flex; }

  .hero { gap: 52px; }
  .hero__title { letter-spacing: -2px; }
  .portrait__frame { inset: 12px -10px -12px 10px; animation: none; }

  .section--split,
  .section--split.is-flipped { grid-template-columns: 1fr; gap: 22px; }
  .section--split.is-flipped > :last-child { order: -1; }

  .sechead { position: static; }
  .sechead::before { display: none; }

  /* No horizontal room to borrow on a phone: reveal vertically instead, so an
     unrevealed element can never widen the page. */
  [data-reveal='left'],
  [data-reveal='right'] { transform: translateY(36px); }
  [data-reveal='swing'] { transform: translateY(-20px); }
}

/* --- Reduced motion --------------------------------------------------------
   Honours the OS setting: kills every looping animation and the scroll
   choreography, while leaving all content visible and reachable. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .portrait__ghost, .portrait__scan, .portrait__glow { display: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .header, .rail, .menu, .burger, .hero__actions, .form, .reader__more { display: none !important; }
  body { padding-top: 0; background: #fff; color: #000; }
}
