/* ── Jamal Nader - portfolio + signature verifier ─────────────────────
 * Palette and typography ported from the 2026 UI redesign.
 * Machine voice = JetBrains Mono. Human voice = Space Grotesk.
 */

:root{
  /* surfaces */
  --bg: #0d1214;
  --bg-soft: rgba(233,231,225,.02);
  --bg-card: rgba(233,231,225,.025);
  --bg-sunken: rgba(0,0,0,.28);

  /* type */
  --text: #e9e7e1;
  --text-bright: #f4f2ec;
  --text-soft: #dcdad4;
  --text-muted: #a9b6b3;
  --text-dim: #9aa8a6;
  --text-faint: #7e8d8b;

  /* accents */
  --accent: #74b0a6;
  --accent-soft: #8ec4b8;
  --accent-bright: #cfe9e2;
  --accent-ink: #08120f;
  --gold: #c3a17a;

  /* verification states */
  --ok: #8ec4b8;
  --warn: #c3a17a;
  --pending: #8fa9c4;
  --fail: #d98d7f;

  /* lines */
  --line: rgba(233,231,225,.08);
  --line-2: rgba(233,231,225,.11);
  --accent-line: rgba(116,176,166,.32);
  --accent-wash: rgba(116,176,166,.06);

  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --maxw: 1240px;
  --gutter: 48px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a{ color: var(--accent-soft); text-decoration: none; }
a:hover{ color: var(--accent-bright); }
::selection{ background: rgba(116,176,166,.3); }

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

.mono{ font-family: var(--font-mono); }

.visually-hidden{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Keyframes ────────────────────────────────────────────────────── */

@keyframes blink{ 0%,49%{ opacity:1 } 50%,100%{ opacity:0 } }
@keyframes pulseRing{ 0%{ transform:scale(1); opacity:.5 } 70%,100%{ transform:scale(2.6); opacity:0 } }
@keyframes floatY{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-8px) } }
@keyframes marq{ 0%{ transform:translateX(0) } 100%{ transform:translateX(-50%) } }
@keyframes shimmer{ 0%{ background-position:-200% 0 } 100%{ background-position:200% 0 } }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(22px) } to{ opacity:1; transform:none } }
@keyframes nudge{ 0%,100%{ transform:translateX(0) } 25%{ transform:translateX(-4px) } 75%{ transform:translateX(4px) } }

/* Scoped to .js: with scripting off nothing ever adds .is-in, so the
   content must not start hidden. */
.js .reveal{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-in{ opacity: 1; transform: none; }

/* ── Background rain ──────────────────────────────────────────────── */

canvas[data-rain]{ display: block; }

canvas.rain-fixed{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Shared controls ──────────────────────────────────────────────── */

.btn{
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover{ transform: translateY(-2px); }
.btn:disabled{ opacity: .45; cursor: not-allowed; transform: none; }

.btn--fill{ background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--fill:hover{ background: var(--accent-soft); color: var(--accent-ink); }

.btn--ghost{ border-color: rgba(233,231,225,.2); color: var(--text); }
.btn--ghost:hover{ border-color: var(--accent-line); color: var(--accent-bright); background: var(--accent-wash); }

.btn--small{ font-size: 13.5px; padding: 10px 16px; gap: 8px; }

.lnk{ position: relative; transition: color .2s ease; }
.lnk::after{
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width .25s ease;
}
.lnk:hover{ color: var(--text); }
.lnk:hover::after{ width: 100%; }

/* ── Page frame ───────────────────────────────────────────────────── */

.shell{
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

.progress-bar{
  position: fixed;
  left: 0; top: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  z-index: 60;
}

/* ── Header ───────────────────────────────────────────────────────── */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px var(--gutter);
  background: rgba(13,18,20,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand{
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .06em;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover{ color: var(--text); }
.brand span{ color: var(--accent); animation: blink 1.2s steps(1) infinite; }

/* The <nav> is the shrinkable, scrollable rail; .nav is its content. */
.site-header > nav{
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-header > nav::-webkit-scrollbar{ display: none; }

.nav{
  display: flex;
  gap: 30px;
  width: max-content;
  font-size: 14.5px;
  color: var(--text-dim);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav li{ flex-shrink: 0; }
.nav a{ color: var(--text-dim); }
.nav a.is-current{ color: var(--accent-soft); }

.status{
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--accent-soft);
  flex-shrink: 0;
}
.status-dot{
  position: relative;
  display: inline-flex;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.status-dot::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseRing 2.4s ease-out infinite;
}

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

.hero{
  position: relative;
  min-height: calc(100vh - 57px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .5;
}
.hero-mask{ position: absolute; inset: 0; pointer-events: none; }
.hero-mask--radial{
  background: radial-gradient(70% 65% at 30% 50%,
    rgba(13,18,20,.96) 0%, rgba(13,18,20,.8) 42%, rgba(13,18,20,.35) 75%, transparent 100%);
}
.hero-mask--fade{ background: linear-gradient(180deg, transparent 55%, var(--bg) 100%); }

.hero-inner{ position: relative; z-index: 2; }

.prompt{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 26px;
  min-height: 1.6em;
}
.prompt .caret{ animation: blink 1s steps(1) infinite; }

.hero-title{
  margin: 0;
  font-size: clamp(56px, 7.6vw, 104px);
  line-height: .94;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text-bright);
}

.tag-row{ display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.tag{
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--accent-soft);
  transition: all .22s var(--ease);
}
.tag:hover{
  background: rgba(116,176,166,.12);
  border-color: rgba(116,176,166,.55);
  color: var(--accent-bright);
  transform: translateY(-2px);
}

.hero-lede{
  margin: 0;
  max-width: 620px;
  font-size: 20px;
  line-height: 1.62;
  color: #c2cdca;
  text-wrap: pretty;
}

.cta-row{ display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }

.scroll-hint{
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--text-faint);
  animation: floatY 3.4s ease-in-out infinite;
}

/* ── Ticker ───────────────────────────────────────────────────────── */

.ticker{
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(116,176,166,.04);
  padding: 13px 0;
}
.ticker-track{
  display: flex;
  gap: 30px;
  width: max-content;
  animation: marq 34s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: #8b9a97;
  white-space: nowrap;
}

/* ── Sections ─────────────────────────────────────────────────────── */

.section{ padding: 104px 0 0; }
.section:last-of-type{ padding-bottom: 90px; }

.section-head{
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 34px;
}
.section-label{
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--accent);
  margin: 0;
}
.section-rule{ flex: 1; height: 1px; background: rgba(233,231,225,.1); }

.display{
  margin: 0;
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 600;
  color: var(--text-bright);
}

/* ── About ────────────────────────────────────────────────────────── */

.about-grid{
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 64px;
  align-items: start;
}
.about-lead{
  margin: 0;
  font-size: 21px;
  line-height: 1.68;
  color: var(--text-soft);
  text-wrap: pretty;
}
.about-lead strong{ color: var(--text-bright); font-weight: 600; }
.about-body{
  margin: 22px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  text-wrap: pretty;
}
.about-body em{ color: var(--accent-soft); font-style: normal; }

.stat-stack{ display: grid; gap: 12px; }
.stat-card{
  padding: 20px 22px;
  border: 1px solid rgba(233,231,225,.1);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: transform .3s var(--ease), border-color .3s ease, background .3s ease;
}
.stat-card:hover{
  transform: translateY(-4px);
  border-color: rgba(116,176,166,.4);
  background: rgba(116,176,166,.045);
}
.stat-num{
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1.2;
}
.stat-card--gold .stat-num{ color: var(--gold); }
.stat-label{ font-size: 14.5px; color: var(--text-dim); margin-top: 4px; }

/* ── Proof (home) ─────────────────────────────────────────────────── */

.proof-grid{
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
/* Grid items default to min-width:auto, so the nowrap permalink would
   otherwise force the console track wider than the page. */
.proof-grid > *,
.about-grid > *{ min-width: 0; }
/* Class-scoped, not `.proof-copy p` - a descendant selector would
   outrank .display and shrink the heading. */
.proof-lede{
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 460px;
  text-wrap: pretty;
}
.proof-actions{ display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }

.console{
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: #93a4a1;
}
.console-dots{ display: flex; gap: 7px; margin-bottom: 18px; }
.console-dots i{ width: 9px; height: 9px; border-radius: 50%; background: #2d3a3a; display: block; }
.console-dots i:last-child{ background: var(--accent); }

.console-row{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
  color: #5c6a68;
  transition: color .3s ease;
}
.console-row.is-active{ color: var(--text); }
.console-row.is-done{ color: var(--accent-soft); }
.console-row.is-failed{ color: var(--fail); }

.console-result{
  margin-top: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  background: rgba(233,231,225,.05);
  color: #8b9a97;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background .3s ease, color .3s ease;
  overflow-wrap: anywhere;
}
.console-result.is-ok{ background: rgba(116,176,166,.14); color: #a8dbcf; }
.console-result.is-fail{ background: rgba(217,141,127,.14); color: var(--fail); }

.console-permalink{
  display: none;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-faint);
}
.console-permalink.is-shown{ display: flex; }
/* The token is hundreds of characters - show one clipped line. */
.console-permalink a{
  color: var(--accent-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-shimmer{
  margin-top: 14px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 3.2s linear infinite;
  opacity: .55;
}

/* ── Skills ───────────────────────────────────────────────────────── */

.filter-row{ display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.filter{
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid rgba(233,231,225,.14);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .22s var(--ease);
}
.filter:hover{ transform: translateY(-2px); color: var(--accent-bright); }
.filter[aria-pressed="true"]{
  background: rgba(116,176,166,.16);
  border-color: rgba(116,176,166,.55);
  color: var(--accent-bright);
}

.skill-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 96px;
  align-items: flex-start;
  align-content: flex-start;
}
.skill{
  font-size: 15px;
  padding: 10px 17px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(233,231,225,.13);
  color: #c2cdca;
  background: var(--bg-soft);
  transition: all .22s var(--ease);
}
.skill:hover{
  background: rgba(116,176,166,.12);
  border-color: rgba(116,176,166,.55);
  color: var(--accent-bright);
  transform: translateY(-2px);
}
.skill[hidden]{ display: none; }
.skill.is-entering{ animation: fadeUp .4s ease both; }

/* ── Experience ───────────────────────────────────────────────────── */

.section-hint{ font-size: 13.5px; color: var(--text-faint); margin: 0 0 10px; }

.job{ border-bottom: 1px solid var(--line); border-left: 2px solid transparent; transition: border-color .3s ease; }
.job.is-open{ border-left-color: var(--accent); }

.job-head{
  display: grid;
  grid-template-columns: 180px 1fr 28px;
  gap: 28px;
  align-items: start;
  width: 100%;
  padding: 24px 18px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: background .25s ease;
}
.job-head:hover{ background: rgba(116,176,166,.05); }

.job-date{
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--text-faint);
  padding-top: 4px;
}
.job.is-current .job-date{ color: var(--accent-soft); }

.job-title{ font-size: 21px; font-weight: 600; color: var(--text-bright); letter-spacing: -.01em; }

.job-toggle{
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  text-align: right;
  transition: transform .3s ease;
}
.job.is-open .job-toggle{ transform: rotate(45deg); }

/* Left padding lines the body up under the title: row padding (18)
   + date column (180) + grid gap (28). */
.job-body{
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease), opacity .35s ease;
  opacity: 0;
  padding: 0 18px 0 226px;
}
.job.is-open .job-body{ grid-template-rows: 1fr; opacity: 1; padding-bottom: 24px; }
.job-body > div{ overflow: hidden; }
.job-body p{
  margin: 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 740px;
}

/* ── Work: flagship projects ──────────────────────────────────────── */

.section-lede{
  margin: 0 0 26px;
  max-width: 760px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}
.section-lede .mono{ font-size: .92em; color: var(--accent-soft); }

/* Mirrors .job: same open/close mechanics, denser head. */
.project{ border-bottom: 1px solid var(--line); border-left: 2px solid transparent; transition: border-color .3s ease; }
.project.is-open{ border-left-color: var(--accent); }

.project-head{
  display: grid;
  grid-template-columns: 1fr auto 28px;
  gap: 6px 20px;
  align-items: center;
  width: 100%;
  padding: 22px 18px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: background .25s ease;
}
.project-head:hover{ background: rgba(116,176,166,.05); }

.project-stack{ grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }

.project-id{ display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.project-name{ font-size: 21px; font-weight: 600; color: var(--text-bright); letter-spacing: -.01em; }
.project-tagline{ font-size: 15px; color: var(--text-muted); }

.project-toggle{
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  text-align: right;
  transition: transform .3s ease;
}
.project.is-open .project-toggle{ transform: rotate(45deg); }

.project-body{
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease), opacity .35s ease;
  opacity: 0;
  padding: 0 18px;
}
.project.is-open .project-body{ grid-template-rows: 1fr; opacity: 1; padding-bottom: 26px; }
.project-body-inner{ overflow: hidden; }

/* Label column is mono so PROBLEM/APPROACH/ROLE read as machine voice. */
.project-dl{
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px 24px;
  margin: 0;
  max-width: 860px;
}
.project-dl dt{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--text-faint);
  padding-top: 4px;
}
.project-dl dd{
  margin: 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}

.project-links{ display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0 0; padding-left: 128px; font-size: 14.5px; }

.badge{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-faint);
  white-space: nowrap;
}
.badge--client,
.badge--architecture{
  color: var(--gold);
  border-color: rgba(195,161,122,.34);
  background: rgba(195,161,122,.07);
}

.stack-chip{
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-faint);
}

/* ── Work: compact tools strip ────────────────────────────────────── */

.tools-strip{ list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tool{
  display: grid;
  grid-template-columns: 210px 1fr auto;
  gap: 6px 24px;
  align-items: baseline;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.tool-name{ font-size: 16px; font-weight: 600; color: var(--text-soft); }
.tool-note{ font-size: 15px; line-height: 1.6; color: var(--text-faint); text-wrap: pretty; }
.tool-stack{ display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Open source: repo listing ────────────────────────────────────── */

.repo-console{ position: relative; overflow: hidden; }
.repo-prompt{ margin: 0 0 14px; color: var(--text-faint); }
.repo-prompt::before{ content: ''; }

.repo-list{ list-style: none; margin: 0; padding: 0; }

/* Each row is its own grid (the whole row is one link), so the name column is
   a fixed width rather than max-content - otherwise the longest repo name
   widens only its own row and the descriptions stop lining up. */
.repo-row{
  display: grid;
  grid-template-columns: 4.5rem 5.5rem 13rem 1fr;
  gap: 4px 18px;
  align-items: baseline;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  color: inherit;
  transition: background .2s ease;
}
.repo-row:hover{ background: rgba(116,176,166,.07); color: inherit; }

.repo-lang{ color: var(--accent); }
.repo-license{ color: var(--text-faint); }
.repo-name{ color: var(--text-bright); font-weight: 500; }
.repo-note{ color: #7f8e8c; line-height: 1.6; text-wrap: pretty; }
.repo-row:hover .repo-name{ color: var(--accent-bright); }

/* Contributions: wider name column (it carries an `owner/` prefix) and a role
   column in place of the licence. */
.repo-row--contrib{ grid-template-columns: 4.5rem 6.5rem 17rem 1fr; }
.repo-role{ color: var(--gold); }
.repo-owner{ color: var(--text-faint); font-weight: 400; }

.repo-foot{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
}
.repo-foot--note{ display: block; }

/* ── Education ────────────────────────────────────────────────────── */

.edu-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 34px; }
.card{
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-soft);
  transition: transform .3s var(--ease), border-color .3s ease, background .3s ease;
}
.card:hover{
  transform: translateY(-4px);
  border-color: rgba(116,176,166,.4);
  background: rgba(116,176,166,.045);
}
.card-date{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gold);
  margin-bottom: 12px;
}
.card-title{ font-size: 22px; font-weight: 600; color: var(--text-bright); margin-bottom: 8px; letter-spacing: -.01em; }
.card-meta{ font-size: 16px; line-height: 1.6; color: var(--text-muted); }

.subhead{
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.subhead--group{
  font-size: 10.5px;
  opacity: .78;
  margin: 28px 0 12px;
}
.subhead + .subhead--group{ margin-top: 0; }

.cert-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.cert{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(233,231,225,.1);
  border-radius: 10px;
  background: rgba(233,231,225,.015);
  transition: transform .3s var(--ease), border-color .3s ease, background .3s ease;
}
.cert:hover{
  transform: translateY(-4px);
  border-color: rgba(116,176,166,.4);
  background: rgba(116,176,166,.045);
}
.cert-name{ font-size: 15px; color: var(--text-soft); }
.cert-by{ font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

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

.contact-panel{
  position: relative;
  border: 1px solid rgba(116,176,166,.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(116,176,166,.09), rgba(195,161,122,.05) 60%, transparent);
  padding: 64px 56px;
  overflow: hidden;
}
.contact-glow{
  position: absolute;
  right: -60px; top: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(116,176,166,.14), transparent 70%);
  animation: floatY 8s ease-in-out infinite;
  pointer-events: none;
}
.contact-inner{ position: relative; }
.contact-panel .section-label{ margin-bottom: 20px; }
.contact-panel .display{ font-size: 52px; letter-spacing: -.035em; }
.contact-lede{ margin: 18px 0 0; font-size: 19px; line-height: 1.65; color: #b3bfbc; max-width: 520px; }

.contact-mail{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.2vw, 30px);
  color: var(--text-bright);
  border-bottom: 1px solid rgba(116,176,166,.5);
  padding-bottom: 6px;
  transition: transform .2s ease, color .25s ease;
  overflow-wrap: anywhere;
}
.contact-mail:hover{ transform: translateY(-2px); color: var(--accent-bright); }

.contact-links{ display: flex; gap: 12px; margin-top: 38px; flex-wrap: wrap; }
.contact-links .btn{ padding: 13px 22px; font-size: 15px; }

.lang-line{
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid rgba(233,231,225,.1);
  font-size: 15px;
  color: #8b9a97;
}

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

.site-footer{
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 26px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ── /verify - the standalone tool ────────────────────────────────── */

.page{ position: relative; z-index: 2; padding: 80px 0 60px; }

.panel{
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(13,18,20,.86);
  backdrop-filter: blur(6px);
  padding: 40px;
}

.panel-lede{
  font-size: 17px;
  line-height: 1.72;
  color: var(--text-muted);
  max-width: 760px;
  text-wrap: pretty;
}
.panel-lede code{
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--accent-soft);
  background: rgba(116,176,166,.09);
  border: 1px solid rgba(116,176,166,.18);
  border-radius: 5px;
  padding: 1px 6px;
}

textarea#payload{
  width: 100%;
  min-height: 220px;
  margin-top: 24px;
  background: var(--bg-sunken);
  color: var(--accent-bright);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  padding: 18px;
  resize: vertical;
  transition: border-color .25s ease;
}
textarea#payload:focus{ border-color: var(--accent-line); }

.verify-controls{ display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.term-output{
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  min-height: 20px;
}
.term-output .term-line{ color: var(--text-faint); margin: 2px 0; }
.term-output .term-line.hit{ color: var(--accent-soft); }
.term-output .term-line.miss{ color: var(--fail); }

.verify-result{
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 14px;
  display: none;
}
.verify-result.ok{
  display: block;
  color: var(--ok);
  border: 1px solid rgba(116,176,166,.5);
  background: rgba(116,176,166,.12);
}
.verify-result.fail{
  display: block;
  color: var(--fail);
  border: 1px solid rgba(217,141,127,.5);
  background: rgba(217,141,127,.1);
  animation: nudge .4s linear;
}

.statement-card{
  margin-top: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 15px;
  background: var(--bg-card);
  display: none;
}
.statement-card.show{ display: block; }
.statement-card div{ margin: 6px 0; color: var(--text-soft); overflow-wrap: anywhere; }
.statement-card span.k{
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-right: 6px;
}

.permalink{
  display: none;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: rgba(116,176,166,.06);
}
.permalink.show{ display: block; }
.permalink-label{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 10px;
}
.permalink-row{ display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.permalink-row a{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-soft);
  overflow-wrap: anywhere;
  flex: 1 1 260px;
  min-width: 0;
}
.permalink-note{ margin: 10px 0 0; font-size: 13.5px; color: var(--text-faint); }

details.howworks{
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 15px;
}
details.howworks summary{
  cursor: pointer;
  font-family: var(--font-mono);
  color: var(--accent-soft);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
details.howworks p{ margin-top: 12px; color: var(--text-muted); line-height: 1.7; max-width: 760px; }

/* ── /val/{token} - focused result card ───────────────────────────── */

.verify-wrap{
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 24px;
}
.verify-card{
  width: 100%;
  max-width: 680px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(13,18,20,.9);
  backdrop-filter: blur(8px);
  padding: 40px;
}
.verify-card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.verify-token{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.verify-result-page{
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .03em;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}
.verify-result-page.verified{ color: var(--ok); border: 1px solid rgba(116,176,166,.5); background: rgba(116,176,166,.12); }
.verify-result-page.failed{ color: var(--fail); border: 1px solid rgba(217,141,127,.5); background: rgba(217,141,127,.1); }
.verify-result-page.not-found{ color: var(--text-dim); border: 1px solid var(--line-2); background: rgba(233,231,225,.03); }
.verify-result-page.expired{ color: var(--warn); border: 1px solid rgba(195,161,122,.5); background: rgba(195,161,122,.1); }
.verify-result-page.pending{ color: var(--pending); border: 1px solid rgba(143,169,196,.5); background: rgba(143,169,196,.1); }

.verify-details{ margin-top: 22px; }
.verify-details .row{
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.verify-details .row:last-child{ border-bottom: none; }
.verify-details .label{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-faint);
  min-width: 96px;
  flex-shrink: 0;
  padding-top: 3px;
}
.verify-details .value{ color: var(--text-soft); overflow-wrap: anywhere; }

.verify-key-id{
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  overflow-wrap: anywhere;
}
.verify-timestamp{
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}
.verify-actions{
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.verify-foot{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1100px){
  .about-grid{ grid-template-columns: 1fr; gap: 40px; }
  .stat-stack{ grid-template-columns: repeat(3, 1fr); }
  .proof-grid{ grid-template-columns: 1fr; gap: 36px; }
  .proof-copy p{ max-width: none; }
  .edu-grid{ grid-template-columns: 1fr; }
  .contact-panel{ padding: 48px 40px; }
}

@media (max-width: 860px){
  :root{ --gutter: 24px; }

  .site-header{ padding: 14px var(--gutter); gap: 14px; }
  .status{ display: none; }

  /* .nav is width:max-content and never wraps, so with eight sections it runs
     past a phone viewport and body{overflow-x:hidden} silently clips the last
     links. Let the nav scroll on its own instead, scrollbar hidden - the same
     treatment .ticker already gets. */
  .site-header > nav{
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-header > nav::-webkit-scrollbar{ display: none; }
  .nav{ gap: 20px; font-size: 13.5px; }
  .nav li{ flex: 0 0 auto; }
  .nav .lnk{ white-space: nowrap; }

  .hero{ min-height: calc(100vh - 53px); padding: 80px 0; }
  .hero-lede{ font-size: 18px; }
  .hero-mask--radial{
    background: radial-gradient(90% 70% at 50% 45%,
      rgba(13,18,20,.96) 0%, rgba(13,18,20,.85) 45%, rgba(13,18,20,.45) 78%, transparent 100%);
  }
  .scroll-hint{ display: none; }

  .section{ padding-top: 72px; }
  .display{ font-size: 34px; }
  .about-lead{ font-size: 19px; }
  .about-body{ font-size: 17px; }
  .stat-stack{ grid-template-columns: 1fr; }

  .job-head{ grid-template-columns: 1fr 28px; gap: 8px 16px; padding: 20px 14px; }
  .job-date{ grid-column: 1 / -1; padding-top: 0; }
  .job-body{ padding: 0 14px; }
  .job.is-open .job-body{ padding-bottom: 20px; }

  /* Two columns on narrow screens: the badge drops onto its own row rather
     than squeezing the tagline, which otherwise wraps around it. */
  .project-head{ grid-template-columns: 1fr 28px; padding: 20px 14px; gap: 10px 14px; }
  .project-stack{ grid-column: 1 / -1; }
  .project-id{ grid-column: 1; }
  .badge{ grid-column: 1; justify-self: start; }
  .project-toggle{ grid-column: 2; grid-row: 2; align-self: start; }

  .project-body{ padding: 0 14px; }
  .project-dl{ grid-template-columns: 1fr; gap: 4px; }
  .project-dl dt{ padding-top: 12px; }
  .project-dl dt:first-child{ padding-top: 0; }
  .project-links{ padding-left: 0; }

  .tool{ grid-template-columns: 1fr; padding: 14px; }

  /* The four-column listing collapses to name + note, with language and
     licence demoted to a meta line, so no row can overflow its container. */
  .repo-row{
    grid-template-columns: auto auto 1fr;
    gap: 2px 12px;
    padding: 12px 10px;
  }
  .repo-name{ grid-column: 1 / -1; order: -1; font-size: 15px; }
  .repo-note{ grid-column: 1 / -1; order: 1; }
  .repo-lang, .repo-license, .repo-role{ font-size: 11.5px; order: 2; }

  .contact-panel{ padding: 40px 26px; }
  .contact-panel .display{ font-size: 36px; }
  .contact-lede{ font-size: 17px; }

  .page{ padding: 56px 0 40px; }
  .panel{ padding: 26px 20px; }
  .verify-card{ padding: 28px 20px; }
  .site-footer{ padding: 22px var(--gutter); font-size: 11.5px; }
}

@media (max-width: 560px){
  .hero-title{ letter-spacing: -.03em; }
  .section{ padding-top: 60px; }
  .contact-panel{ padding: 32px 20px; }
  .contact-mail{ font-size: 17px; }
  .cert{ flex-direction: column; gap: 4px; }
  .cert-by{ white-space: normal; }
  .verify-details .row{ flex-direction: column; gap: 4px; }
  .verify-details .label{ padding-top: 0; }
  .verify-controls .btn{ flex: 1 1 auto; justify-content: center; }
}

/* ── Reduced motion ───────────────────────────────────────────────── */

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

  .js .reveal{ opacity: 1; transform: none; transition: none; }

  .brand span,
  .status-dot::after,
  .prompt .caret,
  .scroll-hint,
  .contact-glow,
  .console-shimmer,
  .skill.is-entering,
  .verify-result.fail{
    animation: none;
  }

  .ticker-track{ animation: none; }
  .ticker{ overflow-x: auto; scrollbar-width: none; }
  .ticker::-webkit-scrollbar{ display: none; }

  .btn:hover, .tag:hover, .filter:hover, .skill:hover,
  .stat-card:hover, .card:hover, .cert:hover, .contact-mail:hover{
    transform: none;
  }

  .job-body{ transition: none; }
  .job-toggle{ transition: none; }
  .project-body{ transition: none; }
  .project-toggle{ transition: none; }
}
