/* =========================================================================
   MOHAMED SOHAIL RAJAB — Portfolio
   System: Swiss/technical grid · IBM Plex Mono (structure) + Spectral (editorial)
   Palette: warm paper, near-black ink, oxblood accent
   ========================================================================= */

:root {
  /* paper & ink */
  --paper:      oklch(0.972 0.008 83);   /* warm off-white */
  --paper-2:    oklch(0.948 0.010 83);   /* slightly deeper panel */
  --ink:        oklch(0.205 0.012 60);   /* warm near-black */
  --ink-2:      oklch(0.205 0.012 60 / 0.62);
  --ink-3:      oklch(0.205 0.012 60 / 0.40);
  --hair:       oklch(0.205 0.012 60 / 0.16);
  --hair-2:     oklch(0.205 0.012 60 / 0.085);

  /* ink accent — oxblood (tweakable to teal / navy) */
  --accent:     oklch(0.455 0.135 24);   /* oxblood */
  --accent-ink: oklch(0.455 0.135 24);

  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Spectral", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 4.5vw, 80px);
  --maxw: 1480px;

  --label: 11px;
  --ls-label: 0.16em;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

a { color: inherit; text-decoration: none; }

/* ---- shared label / mono treatments ------------------------------------ */
.mono-label {
  font-family: var(--mono);
  font-size: var(--label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}
.accent { color: var(--accent); }
.italic { font-style: italic; }

/* =========================================================================
   LAYOUT — shell, grid, section frame
   ========================================================================= */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.rule { height: 1px; background: var(--hair); border: 0; margin: 0; }

section { position: relative; }

/* section header band: number / title / meta — Swiss index style */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 22px 0 30px;
}
.sec-head .top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.sec-head .idx {
  font-family: var(--mono); font-size: var(--label);
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.sec-head .title {
  font-family: var(--mono); font-size: var(--label);
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--ink-2); font-weight: 500;
}
/* live site quick-link in a section header */
.sec-head .sec-visit {
  font-family: var(--mono); font-size: var(--label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-2); font-weight: 500;
  display: inline-flex; align-items: center; gap: 9px;
  padding-bottom: 3px; border-bottom: 1px solid var(--hair);
  transition: color .25s ease, border-color .25s ease;
}
.sec-head .sec-visit .v-arr { color: var(--accent); transition: transform .3s var(--ease, ease); }
.sec-head .sec-visit:hover { color: var(--accent); border-bottom-color: var(--accent); }
.sec-head .sec-visit:hover .v-arr { transform: translate(3px, -3px); }

/* =========================================================================
   TOP NAV
   ========================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in oklch, var(--paper) 80%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .4s ease, background .4s ease;
}
.nav.scrolled { border-bottom-color: var(--hair); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { display: grid; grid-template-columns: repeat(3, 5px); grid-auto-rows: 5px; gap: 2px; }
.brand .mark i { background: var(--ink); display: block; }
.brand .mark i.a { background: var(--accent); }
.brand .name {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; font-weight: 600; white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 6px 11px; border-radius: 2px;
  display: flex; align-items: baseline; gap: 7px;
  transition: color .25s ease, background .25s ease;
}
.nav-links a .n { color: var(--ink-3); font-size: 10px; transition: color .25s; }
.nav-links a:hover { color: var(--ink); background: var(--hair-2); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active .n { color: var(--accent); }
.nav-cta {
  font-family: var(--mono); font-size: var(--label); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--paper); background: var(--ink);
  padding: 8px 14px; border-radius: 2px; transition: background .25s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero { padding-top: 116px; padding-bottom: 56px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: clamp(32px, 6vh, 64px);
}
.hero-eyebrow .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: pulse 3.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.hero-grid {
  display: block;
}
.hero-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(clamp(1.85rem, 4.2vw, 3.5rem) * var(--headline-scale, 1));
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}
.hero-headline em { font-style: italic; }
.hero-headline .ink-accent { color: var(--accent); }

.hero-sub {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 22px 0 0;
  max-width: 52ch;
  text-wrap: pretty;
}
.hero-sub strong { font-weight: 500; color: var(--ink); }
.hero-sub .accent { color: var(--accent); font-style: italic; }

.portrait-wrap { display: flex; flex-direction: column; gap: 10px; }
.portrait-wrap image-slot {
  width: 100%; aspect-ratio: 4/5; display: block;
  border: 1px solid var(--hair);
}
.portrait-cap { display: flex; justify-content: space-between; }

.hero-meta {
  margin-top: clamp(40px, 8vh, 88px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hair);
}
.hero-meta .cell {
  padding: 22px 26px 24px;
  border-right: 1px solid var(--hair);
}
.hero-meta .cell:first-child { padding-left: 0; }
.hero-meta .cell:last-child { border-right: 0; padding-right: 0; }
.hero-meta .k { display: block; margin-bottom: 9px; }
.hero-meta .v { font-family: var(--serif); font-size: 17px; line-height: 1.35; }
.hero-meta .v a { border-bottom: 1px solid var(--hair); transition: border-color .25s; }
.hero-meta .v a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .hero-meta .cell:nth-child(odd) { padding-left: 0; }
  .hero-meta .cell:nth-child(even) { border-right: 0; padding-right: 0; }
  .hero-meta .cell { border-bottom: 1px solid var(--hair); }
}

/* =========================================================================
   ABOUT
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0, 1.55fr);
  gap: clamp(28px, 6vw, 96px);
  padding-bottom: 88px;
}
.about-aside .photo-note { margin-top: 18px; }
.about-statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem); line-height: 1.34;
  letter-spacing: -0.01em; margin: 0 0 1.4em; text-wrap: pretty;
}
.about-statement em { font-style: italic; color: var(--accent); }
.about-body p {
  font-family: var(--serif); font-size: 18px; line-height: 1.62;
  color: var(--ink); margin: 0 0 1.15em; max-width: 56ch; text-wrap: pretty;
}
.about-body p .lead { }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-2);
  border: 1px solid var(--hair); padding: 7px 11px; border-radius: 2px;
  transition: border-color .25s, color .25s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   WORK / CV — table
   ========================================================================= */
.cv { padding-bottom: 88px; }
.cv-row {
  display: grid;
  grid-template-columns: 132px minmax(0,1.6fr) minmax(0,1fr) auto;
  gap: 24px; align-items: baseline;
  padding: 26px 0; border-top: 1px solid var(--hair);
  position: relative;
}
.cv-row:last-child { border-bottom: 1px solid var(--hair); }
.cv-row .yr { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2); padding-top: 6px; }
.cv-row .role { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.1; }
.cv-row .org { font-family: var(--mono); font-size: 13px; color: var(--ink-2); letter-spacing: 0.02em; }
.cv-row .org .place { display:block; color: var(--ink-3); font-size: 11px; margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }
.cv-row .note { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-2); max-width: 30ch; }
.cv-row .badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 2px; padding: 3px 7px;
  white-space: nowrap;
}
.cv-row:hover .role { color: var(--accent); }
.cv-row .role { transition: color .25s ease; }

@media (max-width: 820px) {
  .cv-row { grid-template-columns: 70px 1fr; row-gap: 8px; }
  .cv-row .org, .cv-row .note { grid-column: 2; }
  .cv-row .badge { grid-column: 2; justify-self: start; margin-top: 4px; }
}

/* =========================================================================
   MOSAIC SYSTEMS — feature
   ========================================================================= */
.mosaic {
  background: var(--ink); color: var(--paper);
  border-radius: 4px; overflow: hidden;
  margin: 8px 0 88px;
}
.mosaic ::selection { background: var(--accent); color: var(--paper); }
.mosaic-inner {
  display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,0.85fr);
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(34px, 5vw, 64px);
  align-items: stretch;
}
.mosaic .m-eyebrow { color: oklch(0.972 0.008 83 / 0.55); margin-bottom: 24px; display:flex; gap:12px; align-items:center; }
.mosaic .m-eyebrow .dot { width:6px;height:6px;background:var(--accent);border-radius:50%; animation: pulse 3.4s ease-in-out infinite; }
.mosaic .m-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.mosaic .m-logo .glyph { display: grid; grid-template-columns: repeat(3, 13px); grid-auto-rows: 13px; gap: 3px; flex: none; }
.mosaic .m-logo .glyph i { display:block; background: oklch(0.972 0.008 83 / 0.25); }
.mosaic .m-logo .glyph i.on { background: var(--accent); }
.mosaic .m-logo .glyph i.lit { background: var(--paper); }
.mosaic .m-name { font-family: var(--mono); font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.01em; font-weight: 600; white-space: nowrap; }
.mosaic .m-statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem); line-height: 1.18; letter-spacing: -0.015em;
  margin: 0; text-wrap: balance;
}
.mosaic .m-statement em { font-style: italic; color: oklch(0.72 0.13 26); }
.mosaic .m-copy {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.6;
  color: oklch(0.972 0.008 83 / 0.66); margin: 20px 0 0; max-width: 46ch; text-wrap: pretty;
}
.mosaic .m-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  font-family: var(--mono); font-size: var(--label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--paper);
  padding-bottom: 5px; border-bottom: 1px solid oklch(0.972 0.008 83 / 0.3);
  transition: color .25s ease, border-color .25s ease;
}
.mosaic .m-cta .v-arr { color: oklch(0.72 0.13 26); transition: transform .3s var(--ease-out); }
.mosaic .m-cta:hover { color: oklch(0.78 0.12 30); border-bottom-color: oklch(0.72 0.13 26); }
.mosaic .m-cta:hover .v-arr { transform: translate(3px, -3px); }

/* approach — vertical numbered list on the right */
.mosaic .m-approach {
  border-left: 1px solid oklch(0.972 0.008 83 / 0.16);
  padding-left: clamp(24px, 3vw, 40px);
  display: flex; flex-direction: column;
}
.mosaic .m-approach-label {
  font-family: var(--mono); font-size: var(--label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: oklch(0.972 0.008 83 / 0.5); margin-bottom: 20px;
}
.mosaic .m-approach ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.mosaic .m-approach li {
  display: grid; grid-template-columns: 30px 1fr; column-gap: 14px; row-gap: 2px;
  padding: 15px 0; border-top: 1px solid oklch(0.972 0.008 83 / 0.13);
  align-items: baseline;
}
.mosaic .m-approach li:first-child { border-top: 0; padding-top: 0; }
.mosaic .m-approach .s-n { font-family: var(--mono); font-size: 11px; color: oklch(0.72 0.13 26); letter-spacing: 0.1em; }
.mosaic .m-approach .s-t { font-family: var(--serif); font-size: 19px; color: var(--paper); }
.mosaic .m-approach .s-d { grid-column: 2; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: oklch(0.972 0.008 83 / 0.5); letter-spacing: 0.01em; }

/* pillars — five solution areas across the foot of the panel */
.mosaic .m-pillars {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid oklch(0.972 0.008 83 / 0.16);
}
.mosaic .m-pillar {
  padding: 26px clamp(18px, 2vw, 26px) 30px;
  border-right: 1px solid oklch(0.972 0.008 83 / 0.13);
  display: flex; flex-direction: column; gap: 10px;
  transition: background .35s var(--ease-out);
}
.mosaic .m-pillar:last-child { border-right: 0; }
.mosaic .m-pillar:hover { background: oklch(0.972 0.008 83 / 0.04); }
.mosaic .m-pillar .p-n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: oklch(0.972 0.008 83 / 0.4); }
.mosaic .m-pillar .p-name { font-family: var(--serif); font-size: 18px; line-height: 1.1; color: var(--paper); transition: color .3s ease; }
.mosaic .m-pillar:hover .p-name { color: oklch(0.78 0.12 30); }
.mosaic .m-pillar .p-tags { font-family: var(--mono); font-size: 10px; line-height: 1.6; letter-spacing: 0.02em; text-transform: uppercase; color: oklch(0.972 0.008 83 / 0.45); margin-top: auto; }
.mosaic .editable-hint { color: oklch(0.7 0.12 26); }

@media (max-width: 900px) {
  .mosaic-inner { grid-template-columns: 1fr; }
  .mosaic .m-approach { border-left: 0; padding-left: 0; border-top: 1px solid oklch(0.972 0.008 83 / 0.16); padding-top: 28px; }
  .mosaic .m-pillars { grid-template-columns: repeat(2, 1fr); }
  .mosaic .m-pillar:nth-child(2n) { border-right: 0; }
  .mosaic .m-pillar { border-bottom: 1px solid oklch(0.972 0.008 83 / 0.13); }
  .mosaic .m-pillar:nth-last-child(-n+1) { border-bottom: 0; }
}
@media (max-width: 540px) {
  .mosaic .m-pillars { grid-template-columns: 1fr; }
  .mosaic .m-pillar { border-right: 0; }
}

/* =========================================================================
   WRITING — index
   ========================================================================= */
.writing { padding-bottom: 80px; }
.article {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr) 150px 34px;
  gap: 24px; align-items: baseline;
  padding: 28px 4px; border-top: 1px solid var(--hair);
  transition: padding-left .35s cubic-bezier(.2,.7,.3,1), background .35s;
}
.writing .article:last-of-type { border-bottom: 1px solid var(--hair); }
.article .date { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.03em; padding-top: 4px; }
.article .head .t {
  font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.16;
  letter-spacing: -0.01em; display: block; transition: color .3s;
}
.article .head .d { font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--ink-2); margin-top: 8px; max-width: 60ch; display:block; }
.article .cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-top: 6px; }
.article .arrow { font-family: var(--mono); color: var(--ink-3); justify-self: end; padding-top: 2px; transition: transform .3s, color .3s; }
.article:hover { background: var(--paper-2); padding-left: 16px; }
.article:hover .head .t { color: var(--accent); }
.article:hover .arrow { color: var(--accent); transform: translate(4px, -4px); }

@media (max-width: 820px) {
  .article { grid-template-columns: 1fr 30px; row-gap: 8px; }
  .article .date { grid-column: 1; }
  .article .cat { grid-column: 1; }
  .article .arrow { grid-row: 1; grid-column: 2; }
}

/* =========================================================================
   COLLECTIONS — grace note
   ========================================================================= */
.collections { padding-bottom: 84px; }
.coll-intro {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.34;
  letter-spacing: -0.01em; max-width: 30ch; margin: 0 0 40px;
}
.coll-intro em { font-style: italic; color: var(--accent); }
.coll-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--hair);
}
.coll-cell {
  padding: 22px 20px 26px; border-right: 1px solid var(--hair);
  min-height: 240px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  transition: background .35s ease;
}
.coll-cell:last-child { border-right: 0; }
.coll-cell:hover { background: var(--paper-2); }
.coll-cell .num { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3); }
.coll-cell .ico { width: 30px; height: 30px; margin: 14px 0 auto; }
.coll-cell .ico svg { width: 100%; height: 100%; display:block; stroke: var(--ink); fill: none; stroke-width: 1.25; transition: stroke .35s; }
.coll-cell:hover .ico svg { stroke: var(--accent); }
.coll-cell .c-name { font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; margin-top: 16px; }
.coll-cell .c-desc { font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; letter-spacing: 0.01em; }

@media (max-width: 1000px) { .coll-grid { grid-template-columns: repeat(2, 1fr); }
  .coll-cell:nth-child(2n) { border-right: 0; }
  .coll-cell { border-bottom: 1px solid var(--hair); min-height: 200px; }
}
@media (max-width: 520px) { .coll-grid { grid-template-columns: 1fr; }
  .coll-cell { border-right: 0; }
}

/* =========================================================================
   PROJECTS — home lab
   ========================================================================= */
.projects { padding-bottom: 84px; }
.proj-intro {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.34;
  letter-spacing: -0.01em; max-width: 34ch; margin: 0 0 40px;
}
.proj-intro em { font-style: italic; color: var(--accent); }
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.proj-card {
  border: 1px solid var(--hair); display: flex; flex-direction: column;
  background: var(--paper); transition: border-color .35s ease, transform .35s ease;
}
.proj-card:hover { border-color: var(--accent); }
.proj-card image-slot { width: 100%; aspect-ratio: 16/9; display: block; border-bottom: 1px solid var(--hair); }
.proj-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.proj-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.proj-top .pid { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.proj-status {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 2px; padding: 3px 7px;
  display: inline-flex; align-items: center; gap: 6px;
}
.proj-status .led { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
.proj-card .p-title { font-family: var(--serif); font-size: clamp(1.35rem, 2.1vw, 1.8rem); line-height: 1.1; letter-spacing: -0.01em; transition: color .3s; }
.proj-card:hover .p-title { color: var(--accent); }
.proj-card .p-desc { font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--ink-2); margin: 12px 0 0; text-wrap: pretty; }
.proj-stack { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 22px; }
.proj-stack .chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--hair-2); background: var(--paper-2);
  padding: 5px 8px; border-radius: 2px; white-space: nowrap;
}

@media (max-width: 760px) { .proj-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   CONTACT + FOOTER
   ========================================================================= */
.contact { padding-bottom: 40px; }
.contact-grid {
  display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr);
  gap: clamp(28px, 6vw, 80px); align-items: end; padding: 16px 0 64px;
}
.contact-head {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0;
}
.contact-head em { font-style: italic; }
.contact-links { display: flex; flex-direction: column; }
.contact-links a {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: baseline;
  padding: 16px 2px; border-top: 1px solid var(--hair);
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em;
  transition: padding-left .3s, color .3s;
}
.contact-links a:last-child { border-bottom: 1px solid var(--hair); }
.contact-links a .n { color: var(--ink-3); font-size: 10px; }
.contact-links a .h { color: var(--ink-3); justify-self: end; transition: transform .3s, color .3s; }
.contact-links a:hover { color: var(--accent); padding-left: 12px; }
.contact-links a:hover .h { color: var(--accent); transform: translate(3px,-3px); }

footer.colophon {
  border-top: 1px solid var(--hair);
  padding: 30px 0 48px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.colophon .col { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-2); line-height: 1.7; }
.colophon .col .lab { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; display:block; margin-bottom: 6px; font-size: 10px; }
.colophon .col a:hover { color: var(--accent); }

@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   REVEAL ANIMATION
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .14s; }
.reveal[data-d="3"] { transition-delay: .21s; }
.reveal[data-d="4"] { transition-delay: .28s; }
.reveal[data-d="5"] { transition-delay: .35s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
body.no-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* section spacing rhythm */
.sec-pad { padding-top: clamp(56px, 9vh, 110px); }

/* =========================================================================
   MOTION SYSTEM — refined entrances, flow & micro-interactions
   ========================================================================= */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io:  cubic-bezier(.62, .04, .34, 1);
}

/* ---- scroll progress --------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--accent); z-index: 100; pointer-events: none;
  will-change: transform;
}

/* ---- nav entrance ------------------------------------------------------ */
.nav { transform: translateY(-100%); animation: navDrop .9s var(--ease-out) .15s forwards; }
@keyframes navDrop { to { transform: translateY(0); } }

/* ---- animated nav mark (builds tile by tile, accent tiles pulse) ------- */
.brand .mark.build i { opacity: 0; transform: scale(.25); }
.brand .mark.build.go i {
  opacity: 1; transform: none;
  transition: opacity .45s var(--ease-out), transform .6s var(--ease-out);
}
.brand .mark.build.go i:nth-child(1){transition-delay:.30s}
.brand .mark.build.go i:nth-child(2){transition-delay:.36s}
.brand .mark.build.go i:nth-child(3){transition-delay:.42s}
.brand .mark.build.go i:nth-child(4){transition-delay:.48s}
.brand .mark.build.go i:nth-child(5){transition-delay:.54s}
.brand .mark.build.go i:nth-child(6){transition-delay:.60s}
.brand .mark.build.go i:nth-child(7){transition-delay:.66s}
.brand .mark.build.go i:nth-child(8){transition-delay:.72s}
.brand .mark.build.go i:nth-child(9){transition-delay:.78s}
.brand .mark.live i.a { animation: markPulse 5s var(--ease-io) infinite; }
@keyframes markPulse { 0%,100%{opacity:1} 50%{opacity:.45} }
.brand:hover .mark i { transition: transform .4s var(--ease-out); }
.brand:hover .mark i.a { transform: scale(1.18); }

/* ---- mosaic logo glyph: builds tile-by-tile when scrolled into view ---- */
.mosaic .m-logo .glyph.build i { opacity: 0; transform: scale(.2); }
.mosaic .m-logo .glyph.build.go i {
  opacity: 1; transform: none;
  transition: opacity .42s var(--ease-out), transform .58s var(--ease-out);
}
.mosaic .m-logo .glyph.build.go i:nth-child(1){transition-delay:.04s}
.mosaic .m-logo .glyph.build.go i:nth-child(2){transition-delay:.10s}
.mosaic .m-logo .glyph.build.go i:nth-child(3){transition-delay:.16s}
.mosaic .m-logo .glyph.build.go i:nth-child(4){transition-delay:.22s}
.mosaic .m-logo .glyph.build.go i:nth-child(5){transition-delay:.28s}
.mosaic .m-logo .glyph.build.go i:nth-child(6){transition-delay:.34s}
.mosaic .m-logo .glyph.build.go i:nth-child(7){transition-delay:.40s}
.mosaic .m-logo .glyph.build.go i:nth-child(8){transition-delay:.46s}
.mosaic .m-logo .glyph.build.go i:nth-child(9){transition-delay:.52s}
.mosaic .m-logo .glyph.live i.on { animation: markPulse 5s var(--ease-io) infinite; }

/* ---- hero ground grid -------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--hair-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair-2) 1px, transparent 1px);
  background-size: clamp(54px, 6vw, 84px) clamp(54px, 6vw, 84px);
  background-position: right top;
  opacity: 0;
  -webkit-mask-image: radial-gradient(120% 80% at 82% 14%, #000 22%, transparent 72%);
  mask-image: radial-gradient(120% 80% at 82% 14%, #000 22%, transparent 72%);
  animation: heroGridIn 1.9s var(--ease-out) .45s forwards;
}
@keyframes heroGridIn { to { opacity: 1; } }
.hero-eyebrow, .hero-grid, .hero-meta { position: relative; z-index: 1; }

/* ---- hero headline word reveal ---------------------------------------- */
.hero-headline .word { display: inline-block; vertical-align: top; }
/* italic glyphs overhang their box — give the accented word breathing room (works in both motion & reduced-motion) */
.hero-headline em.ink-accent { margin-right: 0.1em; }
.hero-headline .word:has(em), .hero-headline .word-accent { margin-right: 0.08em; }
.hero-headline .word > span { display: inline-block; transform: translateY(40%); opacity: 0; transition: transform .9s var(--ease-out), opacity .9s var(--ease-out); }
.hero-headline.words-in .word > span { transform: none; opacity: 1; }

/* ---- generic staggered group ------------------------------------------ */
.stg {
  opacity: 0; transform: translateY(20px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
  transition-delay: calc(var(--si, 0) * 1ms);
  will-change: opacity, transform;
}
.stg.shown { opacity: 1; transform: none; }

/* ---- CV rows: accent edge + wash on hover ----------------------------- */
.cv-row { transition: background .45s var(--ease-out), padding-left .45s var(--ease-out); }
.cv-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--accent); transition: width .4s var(--ease-out);
}
.cv-row:hover { padding-left: 20px; background: linear-gradient(90deg, var(--paper-2), transparent 68%); }
.cv-row:hover::before { width: 3px; }
.cv-row .yr, .cv-row .role, .cv-row .org, .cv-row .note { transition: color .3s ease, transform .45s var(--ease-out); }
.cv-row:hover .yr { color: var(--accent); }

/* ---- article rows: accent edge ---------------------------------------- */
.article { position: relative; }
.article::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--accent); transition: width .4s var(--ease-out);
}
.article:hover::before { width: 3px; }

/* ---- project cards: lift ---------------------------------------------- */
.proj-card { transition: border-color .4s var(--ease-out), transform .45s var(--ease-out), box-shadow .45s var(--ease-out); will-change: transform; }
.proj-card:hover { transform: translateY(-5px); box-shadow: 0 22px 48px -28px oklch(0.205 0.012 60 / 0.45); }

/* ---- collection icons: draw strokes on reveal ------------------------- */
.coll-cell .ico svg > * {
  stroke-dasharray: 92; stroke-dashoffset: 92;
  transition: stroke-dashoffset 1.1s var(--ease-out) .15s, stroke .35s ease;
}
.coll-grid.drawn .coll-cell .ico svg > * { stroke-dashoffset: 0; }
.coll-cell .ico svg { transition: transform .45s var(--ease-out); }
.coll-cell:hover .ico svg { transform: translateY(-3px) scale(1.06); }
.coll-cell .c-name { transition: color .3s ease; }
.coll-cell:hover .c-name { color: var(--accent); }

/* ---- contact: bigger arrow travel ------------------------------------- */
.contact-links a { transition: padding-left .35s var(--ease-out), color .3s; }

/* ---- reduced motion & motion-off safeguards --------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .nav { transform: none; animation: none; }
  .hero-bg { opacity: 1; animation: none; }
  .hero-headline .word > span { transform: none; }
  .brand .mark.build i, .brand .mark.build.go i { opacity: 1; transform: none; transition: none; }
  .mosaic .m-logo .glyph.build i, .mosaic .m-logo .glyph.build.go i { opacity: 1; transform: none; transition: none; }
  .stg { opacity: 1; transform: none; transition: none; }
  .coll-cell .ico svg > * { stroke-dashoffset: 0; transition: stroke .35s ease; }
}
body.no-motion .scroll-progress { display: none; }
body.no-motion .nav { animation: none; transform: none; }
body.no-motion .hero-bg { opacity: 1; animation: none; }
body.no-motion .hero-headline .word > span { transform: none; transition: none; }
body.no-motion .mosaic .m-logo .glyph.build i, body.no-motion .mosaic .m-logo .glyph.build.go i { opacity: 1 !important; transform: none !important; transition: none !important; }
body.no-motion .stg { opacity: 1 !important; transform: none !important; transition: none !important; }
body.no-motion .coll-cell .ico svg > * { stroke-dashoffset: 0 !important; }
