/* ==========================================================================
   nirhason.com
   Visual language borrowed from a packet-capture / SIEM table: tinted data
   rows with a monospace left gutter, on a cool light ground. Deliberately
   not the black-terminal-green cliché — real analysis tooling is a table.
   ========================================================================== */

/* ── Fonts ─────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('/fonts/public-sans-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ────────────────────────────────────────────────────────────── */

:root {
  --navy:      #16233B;
  --ink:       #0B1220;
  --teal:      #17BEB0;   /* on dark grounds only */
  --teal-ink:  #0B6F66;   /* accessible teal for text on light grounds */
  --paper:     #EDF1F5;
  --slate:     #54657B;   /* 4.87:1 on the alternating row tint — AA on both */
  --amber:     #C9962F;   /* decorative only: the note's left border */
  --amber-ink: #96690D;   /* amber that is legible as text on a light ground */

  --surface:   #F7F9FB;   /* raised row */
  --surface-2: #E3E9F0;   /* alternating row tint */
  --line:      #CAD5E0;
  --line-soft: #DCE4EC;
  --on-navy:   #E8EEF4;
  --on-navy-2: #9FB1C6;

  --display: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --body:    'Public Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 72rem;
  --gutter-w: 9.5rem;
  --pad-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy:      #14213A;
    --ink:       #E7EDF4;
    --teal-ink:  #3FD5C6;
    --paper:     #080D16;
    --slate:     #94A7BE;
    --amber-ink: #D8A63E;   /* the light-ground amber is unreadable on dark */

    --surface:   #101A2C;
    --surface-2: #16233B;
    --line:      #27364E;
    --line-soft: #1C283C;
  }
}

/* ── Reset & base ──────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; }
p  { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

::selection { background: var(--teal); color: var(--navy); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 0.75rem 1.25rem;
  background: var(--navy);
  color: var(--on-navy);
  font: 500 0.875rem var(--mono);
}
.skip:focus { left: 0; }

/* ── Top bar ───────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1.25rem, 5vw, 3.5rem);
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-navy-2);
}
.topbar__name { color: var(--on-navy); font-weight: 500; }
.topbar__meta { text-align: right; }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  background: var(--navy);
  color: var(--on-navy);
  padding-block: clamp(3.5rem, 10vw, 7rem) clamp(4rem, 11vw, 8rem);
  position: relative;
  overflow: hidden;
}

/* faint capture-grid, the only ornament on the page */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 2.75rem
  );
  mask-image: linear-gradient(to bottom, transparent, #000 55%, transparent);
}

.hero .wrap { position: relative; z-index: 1; }

.hero__name {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 122%;
  font-size: clamp(3.25rem, 13vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: -0.035em;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.hero__role {
  font-family: var(--mono);
  font-size: clamp(0.8125rem, 1.6vw, 0.9375rem);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal);
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hero__lede {
  margin-top: 1.75rem;
  max-width: 34ch;
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  line-height: 1.45;
  color: var(--on-navy);
  text-wrap: balance;
}

.hero__cta { margin-top: clamp(2rem, 4vw, 2.75rem); }

/* ── Mail link ─────────────────────────────────────────────────────────── */

.mail {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--navy);
  background: var(--teal);
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mail:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23, 190, 176, 0.28);
}

.mail--big {
  font-size: clamp(1rem, 3.2vw, 1.5rem);
  padding: 0.85rem 1.5rem;
}

/* ── Shared section furniture ──────────────────────────────────────────── */

.band { padding-block: var(--pad-y); }
.band--alt {
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-ink);
  margin-bottom: 0.9rem;
}
.eyebrow::before { content: '— '; }
.eyebrow--invert { color: var(--teal); }

.section__title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(1.75rem, 4.2vw, 2.875rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section__lede {
  margin-top: 1rem;
  max-width: 52ch;
  color: var(--slate);
  font-size: 1.0625rem;
}

/* ── The capture row: the signature element ────────────────────────────── */

.rows { margin-top: clamp(2.25rem, 5vw, 3.25rem); }

.row {
  display: grid;
  grid-template-columns: var(--gutter-w) minmax(0, 1fr);
  gap: 0 1.75rem;
  padding: 1.6rem clamp(1rem, 2.5vw, 1.5rem);
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.rows .row:first-child { border-top: 1px solid var(--line-soft); }
.rows .row:nth-child(even) { background: var(--surface-2); }
.rows .row:hover { border-left-color: var(--teal-ink); }

.row__gutter { padding-top: 0.2rem; }

.stamp {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--slate);
  white-space: nowrap;
}

.row__title {
  font-family: var(--display);
  font-stretch: 108%;
  font-weight: 600;
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  letter-spacing: -0.012em;
}

.row__org {
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--teal-ink);
}

.bullets { margin-top: 0.9rem; display: grid; gap: 0.55rem; }
.bullets li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--slate);
  max-width: 68ch;
}
.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--teal-ink);
}

/* solo row (selected work) needs its own frame — no list siblings */
.row--solo {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}

/* ── The note / wink ───────────────────────────────────────────────────── */

/* Sits between the navy hero and the first band — enough air to read as an
   aside, not so much that it looks orphaned. */
.note { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2.25rem); }

.row--note {
  grid-template-columns: var(--gutter-w) minmax(0, 1fr) auto;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.5rem clamp(1rem, 2.5vw, 1.75rem);
}
.row--note .row__title {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate);
  margin-bottom: 0.6rem;
}
.row--note .row__body p { max-width: 58ch; }
.row--note .stamp { color: var(--amber-ink); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  white-space: nowrap;
}
.tag--amber {
  color: var(--amber-ink);
  border: 1px solid currentColor;
}

/* ── Tracks ────────────────────────────────────────────────────────────── */

.tracks {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.track {
  background: var(--paper);
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
}
.track p { color: var(--slate); max-width: 46ch; }

.track__name {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.02em;
}
.track__sub {
  margin-top: 0.35rem;
  margin-bottom: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal-ink);
}

/* ── Toolbox ───────────────────────────────────────────────────────────── */

.tools {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  border-top: 1px solid var(--line-soft);
}

.tool {
  display: grid;
  grid-template-columns: var(--gutter-w) minmax(0, 1fr);
  gap: 0 1.75rem;
  padding: 1.1rem clamp(1rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.tool:nth-child(even) { background: var(--surface-2); }
.tool:hover { border-left-color: var(--teal-ink); }

.tool dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.tool dd {
  margin: 0;
  color: var(--slate);
  font-size: 0.9375rem;
}

/* ── Credentials ───────────────────────────────────────────────────────── */

.creds {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}
.cred h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-ink);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.cred li {
  padding-block: 0.3rem;
  color: var(--slate);
}

/* ── Contact ───────────────────────────────────────────────────────────── */

.contact {
  background: var(--navy);
  color: var(--on-navy);
  padding-block: var(--pad-y);
}
.contact__title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  letter-spacing: -0.02em;
  max-width: 24ch;
  text-wrap: balance;
}
.contact__line { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.contact__note {
  margin-top: 1.5rem;
  color: var(--on-navy-2);
  font-size: 0.9375rem;
  max-width: 44ch;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer {
  background: var(--navy);
  color: var(--on-navy-2);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-block: 2.5rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer__joke {
  flex: 1 1 28rem;
  max-width: 52ch;
  font-size: 0.875rem;
  line-height: 1.6;
}
.footer__meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.footer__sep { padding-inline: 0.4rem; }

/* ── Focus: visible, always ────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}
.contact :focus-visible,
.hero :focus-visible { outline-color: #fff; }

/* ── Reveal (progressive enhancement — visible without JS) ─────────────── */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ── Responsive: rows collapse, gutter becomes a header stamp ──────────── */

@media (max-width: 46rem) {
  .row,
  .tool {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }
  .row--note { grid-template-columns: minmax(0, 1fr); }
  .row--note .row__flag { order: -1; }
  .row__gutter { padding-top: 0; }
  .tool { padding-block: 1rem; }
  .topbar__meta { display: none; }
  .footer__inner { align-items: start; }
}

/* ── Motion & contrast preferences ─────────────────────────────────────── */

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .mail:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --slate: #33465c; --line: #7d8ea3; --line-soft: #9aa9bb; }
}

@media print {
  .topbar, .hero::after, .note, .footer__joke { display: none; }
  body { background: #fff; color: #000; }
  .hero, .contact { background: #fff; color: #000; }
}
