/* ---------------------------------------------------------------
   site.css  ·  shared foundation for alirezachegini.com

   Design tokens, reset, typography, layout container, site nav,
   buttons, footer and the scroll-reveal motion system. Everything
   here is identical across pages; page-specific sections stay in
   each page's own <style> block, which loads after this file and
   may therefore override it.
   --------------------------------------------------------------- */

:root {
    --paper: #F3F0E9;
    --paper-deep: #ECE8DF;
    --ink: #1A1815;
    --ink-soft: #4A463F;
    --grey: #6E6960;
    --line: #DAD5C9;
    --terra: #B0472E;
    --serif: "IBM Plex Serif", Georgia, serif;
    --sans: "IBM Plex Sans", -apple-system, sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --measure: 62ch;
  }

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

  html { scroll-behavior: smooth; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

  a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; transition: color .18s ease, text-decoration-color .18s ease; }

  a:hover { color: var(--terra); text-decoration-color: var(--terra); }

  a:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; border-radius: 2px; }

  .wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 clamp(22px, 5vw, 48px);
  }

  section { border-top: 1px solid var(--line); }

  .eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--terra);
    margin-bottom: 34px;
  }

  /* ---------- Site nav ---------- */

  .sitenav { border-bottom: 1px solid var(--line); }

  .sitenav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-wrap: wrap;
  }

  .sitenav .wordmark {
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .sitenav ul { list-style: none; display: flex; gap: clamp(18px, 3vw, 32px); }

  .sitenav a.navlink {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--grey);
  }

  .sitenav a.navlink:hover { color: var(--terra); }

  .sitenav a.navlink[aria-current="page"] { color: var(--ink); }

  .hero-portrait {
    width: 100%;
    /* height:auto is load-bearing: without it the img's HTML height attribute
       supplies the used height and aspect-ratio is ignored, which stretches the
       box and makes object-fit:cover crop the subject out of frame. */
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    filter: grayscale(1);
    display: block;
    border: 1px solid var(--line);
  }

  /* ---------- About ---------- */

  .about { padding: 110px 0; }

  .about p { color: var(--ink-soft); max-width: var(--measure); }

  .about p + p { margin-top: 26px; }

  /* ---------- Buttons ---------- */

  .btn {
    display: inline-block;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    padding: 15px 26px;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    transition: background .18s ease, color .18s ease, border-color .18s ease;
  }

  .btn:hover { background: var(--terra); border-color: var(--terra); color: var(--paper); }

  .btn:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }

  .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; align-items: center; }

  .cta-note { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--grey); }

  .arrow { color: var(--terra); }

  /* ---------- Contact ---------- */

  .contact { padding: 110px 0 90px; }

  /* ---------- Footer (shared by every page) ---------- */

  .site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line);
    background: var(--paper-deep);
    padding: 56px 0 36px;
    color: var(--grey);
    font-size: 14px;
  }
  .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 36px 64px;
  }
  .site-footer .wordmark {
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
  }
  .footer-id p { margin-top: 10px; max-width: 34ch; }
  .footer-nav { display: flex; gap: 56px; }
  .footer-nav ul { list-style: none; margin: 0; padding: 0; }
  .footer-nav li + li { margin-top: 10px; }
  .footer-nav a {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-decoration: none;
  }
  .footer-nav a:hover, .footer-nav a:focus-visible { color: var(--terra); }
  .footer-base {
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .08em;
  }
  .footer-base span:not(:first-child) { text-transform: uppercase; }
  .footer-base a { color: var(--ink-soft); }
  .footer-base a:hover { color: var(--terra); }
  @media (max-width: 760px) {
    .footer-nav { gap: 40px; }
    .footer-base { flex-direction: column; }
    /* keep the last line clear of the chat launcher in the bottom-right corner */
    .site-footer { padding-bottom: 96px; }
  }

  /* ---------- Motion system ---------- */

  /* System-field canvases sit behind content and never take pointer input */
  .field {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }

  /* Scroll reveal. Opacity + transform only, so nothing reflows. */
  html.js [data-anim] > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .75s cubic-bezier(.2,.7,.2,1), transform .75s cubic-bezier(.2,.7,.2,1);
  }

  html.js [data-anim].is-in > * { opacity: 1; transform: none; }

  html.anim-off [data-anim] > * { opacity: 1; transform: none; transition: none; }

  html.js [data-anim] > *:nth-child(1)  { transition-delay: .00s; }

  html.js [data-anim] > *:nth-child(2)  { transition-delay: .07s; }

  html.js [data-anim] > *:nth-child(3)  { transition-delay: .14s; }

  html.js [data-anim] > *:nth-child(4)  { transition-delay: .21s; }

  html.js [data-anim] > *:nth-child(5)  { transition-delay: .28s; }

  html.js [data-anim] > *:nth-child(6)  { transition-delay: .35s; }

  html.js [data-anim] > *:nth-child(7)  { transition-delay: .42s; }

  html.js [data-anim] > *:nth-child(8)  { transition-delay: .49s; }

  html.js [data-anim] > *:nth-child(n+9){ transition-delay: .56s; }

  /* Eyebrow rule draws itself in */
  .eyebrow { display: flex; align-items: center; gap: 14px; }

  .eyebrow::before {
    content: "";
    flex: none;
    width: 28px;
    height: 1px;
    background: var(--terra);
    transform-origin: left center;
    transition: transform .7s cubic-bezier(.2,.7,.2,1) .15s;
  }

  html.js .eyebrow::before { transform: scaleX(0); }

  html.js [data-anim].is-in .eyebrow::before { transform: scaleX(1); }

  html.anim-off .eyebrow::before { transform: scaleX(1); transition: none; }

  /* Buttons: terra wipes in from the left rather than snapping */
  .btn { position: relative; overflow: hidden; isolation: isolate; }

  .btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--terra);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .38s cubic-bezier(.2,.7,.2,1);
  }

  .btn:hover::before { transform: scaleX(1); }

  .btn:hover { background: var(--ink); border-color: var(--terra); color: var(--paper); }

  .btn-ghost:hover { background: transparent; color: var(--paper); border-color: var(--terra); }

  .btn .arrow { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1); }

  .btn:hover .arrow { transform: translateX(4px); }

  /* Sticky nav, settling into a rule once the page moves */
  .sitenav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243,240,233,.78);
    -webkit-backdrop-filter: blur(10px) saturate(1.08);
    backdrop-filter: blur(10px) saturate(1.08);
    border-bottom: 1px solid transparent;
    transition: background .35s ease, border-color .35s ease;
  }

  .sitenav.is-stuck { background: rgba(243,240,233,.93); border-bottom-color: var(--line); }

  /* Paper grain: gives the flat palette a little tooth */
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: .04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  @media (prefers-reduced-motion: reduce) {
    html.js [data-anim] > * { opacity: 1; transform: none; transition: none; }
    html.js .eyebrow::before { transform: scaleX(1); transition: none; }
    .btn::before, .btn .arrow, .sitenav { transition: none; }
  }

  .hero-portrait { transition: filter .8s ease; }

  .hero:hover .hero-portrait { filter: grayscale(.84); }

/* ---------- Module grid ----------
   A bordered grid of cards. Used for the workshop programme on the
   homepage and for the framework set on the speaking page. */

.programme { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.programme.three-up { grid-template-columns: repeat(3, 1fr); }
.module { background: var(--paper); padding: 34px 32px; position: relative; }
.module-num { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; color: var(--terra); display: block; margin-bottom: 16px; text-transform: uppercase; }
.module h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.3; margin-bottom: 12px; transition: color .25s ease; }
.module p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.module:hover h3 { color: var(--terra); }

.module::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--terra);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.module:hover::after { transform: scaleX(1); }

/* ---------- Definition grid ----------
   Label-over-value rows. Programme facts, booking facts. */

.programme-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 26px 34px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); }
.programme-meta div { font-size: 15.5px; color: var(--ink-soft); line-height: 1.5; }
.programme-meta .label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--grey); margin-bottom: 7px; }

@media (max-width: 760px) {
  .programme, .programme.three-up { grid-template-columns: 1fr; }
  .module { padding: 30px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .module::after, .module h3 { transition: none; }
}

/* ---------- Artefact pages ----------
   Framework and evidence pages read as documents rather than brochure:
   plainer type, real tables, no canvas field. The shift in register is
   deliberate, since the argument on these pages is that they are working
   references and not marketing. */

.artefact { padding: 64px 0 96px; }
.artefact .wrap { max-width: 820px; }

.crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 30px;
}
.crumb a { color: var(--grey); text-decoration-color: var(--line); }
.crumb a:hover { color: var(--terra); }
.crumb .sep { margin: 0 8px; color: var(--line); }

.artefact h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.1;
  letter-spacing: -.015em;
  max-width: 20ch;
}
.artefact .standfirst {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 22px;
}
.artefact h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.3;
  margin: 56px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.artefact h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.35;
  margin: 32px 0 10px;
}
.artefact p { max-width: var(--measure); color: var(--ink-soft); }
.artefact p + p { margin-top: 18px; }
.artefact p.lead { color: var(--ink); }

.artefact ul, .artefact ol { margin: 18px 0 0 20px; max-width: var(--measure); color: var(--ink-soft); }
.artefact li + li { margin-top: 10px; }

.pull {
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.35;
  color: var(--ink);
  max-width: 24ch;
  margin: 40px 0;
  padding-left: 22px;
  border-left: 2px solid var(--terra);
}

.artefact table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  font-size: 15.5px;
}
.artefact th, .artefact td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.55;
}
.artefact th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
  font-weight: 500;
  border-bottom-color: var(--ink);
}
.artefact td:first-child { color: var(--ink); padding-right: 24px; }

.table-scroll { overflow-x: auto; }

/* Framework diagrams. Inline SVG drawn on a 720-unit grid; below that width
   they scroll sideways rather than shrink text past legibility. */
.fig { margin: 34px 0 8px; }
.fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fig svg { display: block; width: 100%; min-width: 600px; height: auto; }
.fig figcaption {
  margin-top: 12px;
  max-width: var(--measure);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.6;
  color: var(--grey);
}
.fig text { font-family: var(--sans); font-size: 13px; fill: var(--ink-soft); }
.fig .t-mono { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.fig .t-head { font-family: var(--serif); font-size: 17px; font-weight: 600; fill: var(--ink); }
.fig .t-ink { fill: var(--ink); }
.fig .t-terra { fill: var(--terra); }
.fig .t-grey { fill: var(--grey); }
.fig .t-small { font-size: 11.5px; }
.fig .box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.fig .box-soft { fill: var(--paper-deep); stroke: var(--line); stroke-width: 1; }
.fig .box-terra { fill: var(--paper); stroke: var(--terra); stroke-width: 1.6; }
.fig .fill-terra { fill: var(--terra); }
.fig .fill-wash { fill: var(--terra); fill-opacity: .1; }
.fig .ln { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.fig .ln-soft { stroke: var(--line); stroke-width: 1; fill: none; }
.fig .ln-grey { stroke: var(--grey); stroke-width: 1; fill: none; }
.fig .ln-terra { stroke: var(--terra); stroke-width: 1.8; fill: none; }
.fig .dash { stroke-dasharray: 4 4; }

/* Inline provenance label. Marks a claim with where it came from and how far
   it can be pushed, in the same vocabulary used on stage. */
.claim {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  line-height: 1.7;
  color: var(--grey);
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  max-width: 56ch;
}

.revisions {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.revisions h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--grey);
  font-weight: 500;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.revisions ul { list-style: none; margin: 0; font-size: 14.5px; }
.revisions li { display: flex; gap: 16px; padding: 7px 0; }
.revisions time { font-family: var(--mono); font-size: 12px; color: var(--grey); flex: 0 0 8.5em; }

@media (max-width: 620px) {
  .revisions li { display: block; }
  .revisions time { display: block; margin-bottom: 3px; }

  /* Stack tables into labelled blocks. A four-column table on a phone either
     overflows or squeezes each column to two words per line, and both make a
     reference document unusable. Each cell carries its column name in
     data-label, set by the page markup. */
  .artefact table, .artefact tbody, .artefact tr, .artefact td { display: block; width: 100%; }
  .artefact thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .artefact tr {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }
  .artefact tr:first-child { border-top: 1px solid var(--ink); }
  .artefact td {
    border: 0;
    padding: 0 0 12px;
  }
  .artefact td:last-child { padding-bottom: 0; }
  .artefact td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 4px;
  }
  .artefact td:first-child {
    font-family: var(--serif);
    font-size: 19px;
    padding-right: 0;
  }
  .table-scroll { overflow-x: visible; }
}

/* This audience prints things and pastes them into decks. */
@media print {
  .sitenav, .field, .crisp-client, .cta-row, footer { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .artefact { padding: 0; }
  .artefact h2 { page-break-after: avoid; }
  .artefact table, .pull, .fig { page-break-inside: avoid; }
  .fig svg { min-width: 0; }
  a { text-decoration: none; color: #000; }
  .artefact .wrap { max-width: none; }
}
