/* ==================================================================
   Ritaj — online CV
   Violet sections, rose accent, a typing headline, a portrait with
   rings, a logo strip, an about block, project cards.
   ================================================================== */

/* ----------------------------- tokens ----------------------------- */
:root {
  --bg:      #150e22;
  --bg-2:    #1c1430;
  --panel:   #241a3c;
  --panel-2: #2e2249;
  --line:    rgba(255, 255, 255, .10);
  --line-2:  rgba(255, 255, 255, .20);

  --text:  #f7eefb;
  --muted: #c3aed4;
  --faint: #937fa8;

  --accent:   #f07fb0;   /* rose */
  --accent-2: #b98cff;   /* lilac */
  --accent-3: #ffa9d0;   /* blush */
  --accent-4: #6fdcc0;   /* mint */
  --accent-5: #f5b971;   /* warm gold */

  --font:  "Poppins", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-ar: "Tajawal", "Segoe UI", Tahoma, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg:      #fdf5fa;
  --bg-2:    #ffffff;
  --panel:   #ffffff;
  --panel-2: #f8edf5;
  --line:    rgba(43, 19, 56, .10);
  --line-2:  rgba(43, 19, 56, .20);

  --text:  #2b1338;
  --muted: #6b4f78;
  --faint: #9a83a6;

  --accent:   #d1417f;
  --accent-2: #7c4ddb;
  --accent-3: #b8437a;
  --accent-4: #0f9d78;
  --accent-5: #b3762a;
}

/* ------------------------------ base ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* every small label carries a four-pointed spark, the one motif
   borrowed wholesale from the reference */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 13px; height: 13px;
  background: currentColor;
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
}
.hl { color: var(--accent); }

/* the same shape, loose in the hero */
.spark {
  position: absolute; z-index: 3;
  width: 26px; height: 26px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  animation: twinkle 4.5s ease-in-out infinite;
}
.spark--a { top: 7%;    left: 7%;   }
.spark--b { bottom: 13%; right: 5%;  width: 17px; height: 17px; animation-delay: 1.2s; }
.spark--c { top: 44%;   right: 13%; width: 12px; height: 12px; animation-delay: 2.4s; }

/* the call to action in the top bar — small, and deep rather than bright
   so it sits behind the headline instead of competing with it */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg,
              color-mix(in srgb, var(--accent) 58%, #100618),
              color-mix(in srgb, var(--accent-2) 58%, #100618));
  color: #fff;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 16px -10px #000;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.pill::before {
  content: "";
  width: 9px; height: 9px;
  background: currentColor;
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
}
.pill:hover { transform: translateY(-2px); filter: brightness(1.25); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s;
}
.btn--accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 26px -12px var(--accent);
}
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px var(--accent); }

/* outlined in the accent — still the primary action, just not a slab */
.btn--outline {
  gap: 10px;
  border-color: var(--accent);
  color: var(--accent);
  background: none;
}
.btn--outline:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn--outline span { transition: transform .22s var(--ease); }
.btn--outline:hover span { transform: translateX(3px); }

/* ------------------------------- nav ------------------------------ */
.nav {
  /* no background, no rule — it sits straight on the hero */
  position: relative; z-index: 60;
  background: none;
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px clamp(18px, 4vw, 36px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}

.nav__brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav__badge {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  /* the ring keeps the circle; the mark carries the colour */
  border: 1px solid var(--line-2);
  color: var(--accent);
}
.nav__badge svg { width: 62%; height: auto; }
.nav__badge img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.nav__name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }

/* the filters now live beside the "My Work" heading */
.menu {
  display: flex; align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: wrap;
}

.menu__item {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s var(--ease);
}
.menu__item:hover { color: var(--text); }
.menu__item[aria-pressed="true"] { color: var(--accent); }

.nav__right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn__glyph { font-size: 15px; line-height: 1; }
/* the language button carries letters, not a symbol */
.icon-btn--text { width: auto; min-width: 36px; padding: 0 11px; border-radius: var(--r-pill); }
.icon-btn--text .icon-btn__glyph { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }

/* ------------------------------ hero ------------------------------ */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  overflow: hidden;
}
/* a soft dot field rather than a hard engineering grid */
.hero__grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(currentColor 1.1px, transparent 1.1px);
  background-size: 26px 26px;
  color: var(--accent);
  mask-image: radial-gradient(74% 74% at 78% 38%, #000 6%, transparent 72%);
  opacity: .26;
}

.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 84px) clamp(18px, 4vw, 36px) clamp(50px, 8vw, 96px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
}

/* the greeting stays quiet so the name and the role carry the block */
.hero__hi {
  margin-top: 18px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
}
/* the name itself is set in the serif — the one elegant note against
   all the geometric sans */
.hero__hi span {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32em;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* the space is reserved for two lines, so the longest role in the
   list can type itself out without shunting the page around */
.hero__role {
  margin-top: 4px;
  font-size: clamp(27px, 4.1vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.14;
  color: var(--accent);
  min-height: 2.3em;
}
.caret {
  display: inline-block;
  width: 3px; height: .92em;
  margin-left: 6px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.hero__bio {
  margin-top: 20px;
  max-width: 48ch;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--muted);
}

.hero__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 30px; }

/* labelled pill — icon plus the name of the link */
.chip-link {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.chip-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chip-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.socials { display: flex; gap: 10px; }
.hero__links { display: flex; flex-wrap: wrap; gap: 10px; }
.social {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.social svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.social:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* portrait with rings */
.hero__photo { position: relative; display: grid; place-items: center; min-height: 340px; }
.hero__frame {
  position: relative; z-index: 2;
  width: min(360px, 78%);
  aspect-ratio: 4 / 5;
  border-radius: 180px 180px 22px 22px;
  background:
    radial-gradient(80% 60% at 50% 18%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2);
  background-size: cover;
  background-position: center top;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.hero__art { width: 84%; height: auto; color: var(--text); opacity: .9; }

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: .32;
}
.ring--a { width: 300px; height: 300px; top: 6%; right: 4%; }
.ring--b { width: 140px; height: 140px; bottom: 10%; left: 2%; border-width: 6px; opacity: .2; }

.dots {
  position: absolute; inset: 12% 6% 20% 10%;
  background-image: radial-gradient(currentColor 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  color: var(--accent);
  opacity: .18;
}

/* --------------------------- logo strip --------------------------- */
.strip { background: var(--bg-2); border-block: 1px solid var(--line); }
.strip__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 36px);
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(18px, 4vw, 46px);
  /* one line, always — it scrolls sideways rather than wrapping */
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.strip__inner::-webkit-scrollbar { display: none; }
.strip__item { flex: 0 0 auto; white-space: nowrap; }
.strip__item {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600;
  letter-spacing: .04em;
  color: var(--faint);
  opacity: .85;
  transition: color .2s var(--ease), opacity .2s var(--ease);
}
.strip__item:hover { color: var(--text); opacity: 1; }
/* logos arrive on white backgrounds, so give them a proper chip to sit in */
.strip__item img {
  height: 34px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  background: #fff;
}
.strip__icon {
  width: 20px; height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.6;
  flex: 0 0 auto;
}


/* -------------------------- between sections ----------------------
   A board trace, and a line of binary. Both are decoration: they are
   aria-hidden, they never wrap, and they print as nothing.        */
.rule {
  background: var(--bg-2);
  color: var(--accent);
  overflow: hidden;
  line-height: 0;
}
.rule svg { width: 100%; height: auto; display: block; opacity: .34; }
.rule--flip svg { transform: scaleX(-1); }

/* the two scenes are taller and quieter than a plain trace */
.rule--scene { background: var(--bg); }
.rule--scene svg { opacity: .26; }

/* the same section name the cards sit under, spelled out in ones and zeros */
.rule--bits {
  background: var(--bg);
  padding: 16px 0;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}
.rule--bits span {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--accent);
  opacity: .28;
}

/* ------------------------------ about ----------------------------- */
.about { position: relative; background: var(--bg); overflow: hidden; }

/* a dot field, fading out before it reaches the edges */
.about::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--accent);
  opacity: .13;
  mask-image: radial-gradient(64% 64% at 50% 42%, #000, transparent 74%);
  pointer-events: none;
}

/* the two marks every one of your files is full of */
.about__glyph {
  position: absolute;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(74px, 14vw, 190px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  opacity: .13;
  pointer-events: none;
  user-select: none;
}
.about__glyph--a { left: clamp(-14px, 1vw, 24px); bottom: -14px; }
.about__glyph--b { right: clamp(-10px, 1vw, 30px); top: -22px; }

.about__inner {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(50px, 8vw, 100px) clamp(18px, 4vw, 36px);
  text-align: center;
}
.about__copy { max-width: 780px; margin: 0 auto; }

.about__title {
  margin-top: 16px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 54px);
  letter-spacing: -0.015em;
  line-height: 1.12;
}
.about__text {
  margin: 18px auto 0;
  max-width: 62ch;
  font-size: 14px; font-weight: 300; line-height: 1.9;
  color: var(--muted);
}

/* ------------------------------ work ------------------------------ */
.work { background: var(--bg-2); overflow: hidden; }
.work__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(50px, 8vw, 100px) clamp(18px, 4vw, 36px);
}

/* the heading again in outline, set enormous and left to fade out */
.work__ghost {
  position: absolute;
  top: clamp(16px, 3vw, 44px);
  right: clamp(18px, 4vw, 36px);
  font-family: var(--serif);
  font-size: clamp(56px, 11vw, 148px);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--accent);
  opacity: .17;
  pointer-events: none;
  user-select: none;
}

/* the heading and the filters share one line */
.work__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
}
.work__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.015em;
  scroll-margin-top: 24px;
}

/* the second row of filters, under the menu */
.submenu {
  display: flex; justify-content: flex-end; flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.submenu[hidden] { display: none; }
.submenu__item {
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: none;
  font-size: 11.5px; font-weight: 500;
  color: var(--faint);
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.submenu__item:hover { color: var(--text); border-color: var(--line-2); }
.submenu__item[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.grid {
  margin-top: clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

/* ---- icon tiles, for categories that ask for them ---- */
.grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.tile {
  display: grid; justify-items: center; gap: 11px;
  padding: 24px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  text-align: center;
  animation: pop .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.tile:hover {
  border-color: color-mix(in srgb, var(--card-accent) 65%, transparent);
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .9);
}
.tile svg { width: 34px; height: 34px; transition: transform .25s var(--ease); }
/* a line drawing takes the category colour; a brand mark keeps its own */
.tile__glyph { stroke: var(--card-accent); fill: none; stroke-width: 1.5; }
.tile:hover svg { transform: scale(1.1); }
.tile__name { font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.tile--opens { cursor: pointer; }

/* ---- the chip cloud, for categories that ask for it ---- */
.grid--cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.chip {
  padding: 10px 21px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  animation: pop .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), transform .2s var(--ease);
}
.chip:hover {
  color: var(--card-accent);
  border-color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 12%, transparent);
  transform: translateY(-2px);
}
.chip--opens { cursor: pointer; }

.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  animation: pop .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--card-accent) 60%, transparent);
  box-shadow: 0 22px 46px -22px rgba(0, 0, 0, .8);
}
.card--opens { cursor: pointer; }

/* the thumbnail, or a generated one when there's no image */
.card__art {
  width: 100%;
  border-bottom: 1px solid var(--line);
}
/* a real image keeps its own proportions: whole picture, edge to edge,
   nothing cropped and no bars down the sides */
img.card__art:not(.card__art--logo) { height: auto; }

/* logos share one height whatever their proportions. The tile is white,
   which is the logos' own background, so the fit is invisible — no frame,
   no cropping, and a wide mark sits the same height as a square one. */
.card__art--logo {
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: contain;
  background: #fff;
}

/* the generated panel has no proportions of its own, so it gets some */
.card__art--gen {
  aspect-ratio: 16 / 10;
  position: relative;
  background:
    radial-gradient(110% 90% at 18% 0%, color-mix(in srgb, var(--card-accent) 58%, transparent), transparent 68%),
    linear-gradient(140deg, color-mix(in srgb, var(--card-accent) 26%, var(--panel-2)), var(--panel));
}
.card__art--gen::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(160deg, #000, transparent 78%);
}

.card__body { padding: 20px 22px 4px; }

.card__type {
  display: inline-flex; align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--card-accent) 18%, transparent);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--card-accent);
}
.card__title { margin-top: 12px; font-size: 19px; font-weight: 600; }
.card__org { margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--card-accent); }
.card__summary { margin-top: 10px; font-size: 13.5px; font-weight: 300; line-height: 1.8; color: var(--muted); }

.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.card__tags li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 400;
  color: var(--faint);
}

.card__spacer { flex: 1; }

/* the footer row from the reference: label left, round arrow right */
.card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.card__kind { font-size: 13px; font-weight: 600; }
.card__go {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform .22s var(--ease);
}
.card:hover .card__go { transform: translateX(3px); }

/* --------------------------- detail panel -------------------------- */
.detail {
  width: min(780px, calc(100vw - 40px));
  max-height: calc(100vh - 72px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
}
.detail::backdrop { background: rgba(4, 10, 22, .76); }
.detail[open] { animation: pop .25s var(--ease) both; }

.detail__close {
  position: sticky; top: 14px; float: right; z-index: 2;
  margin: 14px 14px 0 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--panel);
  font-size: 19px; line-height: 1;
  cursor: pointer;
}
.detail__close:hover { border-color: var(--accent); color: var(--accent); }

.detail__banner { width: 100%; height: auto; }
/* documents and logos show whole, so they get a taller frame to sit in */
.detail__banner--logo { aspect-ratio: 16 / 10; object-fit: contain; padding: 26px 32px; background: #fff; }

.detail__inner { padding: 26px clamp(20px, 4vw, 38px) 36px; }
.detail__title {
  margin-top: 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 40px);
  letter-spacing: -0.015em;
}
.detail__org { margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--card-accent); }
.detail__lede { margin-top: 16px; font-size: 15px; font-weight: 300; line-height: 1.85; }
.detail__text p { margin-top: 16px; max-width: 68ch; font-size: 14px; font-weight: 300; line-height: 1.9; color: var(--muted); }

.detail__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.detail__media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #000;
}
.detail .btn { margin-top: 24px; }

/* ------------------------------ misc ------------------------------ */
.empty { margin: 56px auto; text-align: center; color: var(--muted); }
.linkish {
  border: 0; background: none; padding: 0;
  color: var(--accent); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ----------------------------- contact ---------------------------- */
.contact { background: var(--bg-2); border-top: 1px solid var(--line); }
.contact__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(50px, 8vw, 96px) clamp(18px, 4vw, 36px);
  text-align: center;
}
.contact__title {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.015em;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  margin-top: clamp(28px, 4vw, 48px);
  text-align: start;
}

/* ---- the form ---- */
.cform { display: flex; flex-direction: column; gap: 16px; }

.cform__field { display: flex; flex-direction: column; gap: 8px; }
.cform__field span {
  font-size: 13px; font-weight: 500;
  color: var(--muted);
}
.cform__field input,
.cform__field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cform__field textarea { resize: vertical; min-height: 120px; }
.cform__field input:focus,
.cform__field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.cform__agree {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 4px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--faint);
  cursor: pointer;
}
.cform__agree input {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.cform__send {
  margin-top: 6px;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 30px -12px var(--accent);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.cform__send:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -12px var(--accent); }
.cform__send:disabled { opacity: .6; cursor: progress; transform: none; }

.cform__note { min-height: 1.4em; font-size: 12.5px; color: var(--faint); }
.cform__note[data-state="warn"] { color: var(--accent-3); }
.cform__note[data-state="ok"]   { color: var(--accent-4); }

/* ---- the column beside it ---- */
.contact__aside {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  text-align: center;
}
.contact__text {
  max-width: 44ch;
  font-size: 14px; font-weight: 300; line-height: 1.9;
  color: var(--muted);
}

.globe { width: min(320px, 100%); height: auto; color: var(--accent); opacity: .85; }

.foot { background: var(--bg); border-top: 1px solid var(--line); }
.foot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 36px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}

.foot__name { font-size: 15px; font-weight: 700; }
.foot__meta { font-size: 12.5px; color: var(--faint); }

@keyframes pop {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@keyframes twinkle { 0%, 100% { opacity: .95; transform: scale(1) } 50% { opacity: .45; transform: scale(.82) } }

/* ------------------------- the other display ----------------------
   data.js picks the face. Fraunces is only fetched when it's asked
   for, and its two axes are what give it the softer, wonkier cut. */
[data-display="fraunces"] { --serif: "Fraunces", Georgia, "Times New Roman", serif; }
[data-display="fraunces"] .hero__hi span,
[data-display="fraunces"] .about__title,
[data-display="fraunces"] .work__title,
[data-display="fraunces"] .work__ghost,
[data-display="fraunces"] .contact__title,
[data-display="fraunces"] .detail__title {
  font-weight: 600;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  letter-spacing: -0.03em;
}

/* ------------------------------ Arabic ----------------------------
   Poppins and Instrument Serif have no Arabic, so the whole page
   changes face when the language does. Flex and grid mirror on their
   own; these are the handful of things that don't.               */
[dir="rtl"] body,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .hero__hi span,
[dir="rtl"] .about__title,
[dir="rtl"] .work__title,
[dir="rtl"] .detail__title { font-family: var(--font-ar); }

/* the serif sizes were set for latin letterforms */
[dir="rtl"] .hero__hi span { font-size: 1em; font-weight: 700; }
[dir="rtl"] .about__title,
[dir="rtl"] .work__title,
[dir="rtl"] .detail__title { font-weight: 700; letter-spacing: 0; }

/* Arabic reads better with a touch more line height and no tracking */
[dir="rtl"] .eyebrow,
[dir="rtl"] .menu__item,
[dir="rtl"] .card__type { letter-spacing: 0; }
[dir="rtl"] .hero__bio,
[dir="rtl"] .about__text,
[dir="rtl"] .card__summary,
[dir="rtl"] .detail__text p { line-height: 2; }

[dir="rtl"] .caret { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .detail__close { float: left; margin: 14px 0 0 14px; }
[dir="rtl"] .card__goGlyph { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .card:hover .card__go { transform: translateX(-3px); }
[dir="rtl"] .menu,
[dir="rtl"] .submenu { justify-content: flex-start; }
[dir="rtl"] .work__ghost { right: auto; left: clamp(18px, 4vw, 36px); letter-spacing: 0; }
[dir="rtl"] .tile__name { direction: ltr; }

/* --------------------------- responsive --------------------------- */
@media (max-width: 980px) {
  .hero__inner, .about__inner { grid-template-columns: 1fr; }
  .hero__photo { order: -1; min-height: 300px; }
  .menu, .submenu { justify-content: flex-start; }
  .nav__inner { flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .strip__inner { justify-content: flex-start; }
  /* the top bar is tight enough on a phone without it */
  .pill { display: none; }
  .work__ghost { opacity: .1; }
  /* the drawings get too fine to read at this width */
  .rule svg { opacity: .22; }
  .rule--scene svg { opacity: .3; }
  .rule--bits span { letter-spacing: .18em; font-size: 9.5px; }
  .about__glyph { opacity: .1; }
}

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

@media print {
  .nav, .hero__grid, .strip, .ring, .dots, .spark,
  .work__ghost, .rule, .about__glyph { display: none !important; }
  .about::before { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; break-inside: avoid; }
}
