/* =========================================================================
   Ali Ramezani — Academic & Medical Innovation Portfolio
   Design system: "The Signal"
   Hand-crafted CSS, no framework. Navy / charcoal / clinical-teal.
   ========================================================================= */

/* ----------------------------------------------------------------------- */
/* Tokens                                                                  */
/* ----------------------------------------------------------------------- */
:root {
  /* Color */
  --paper:        #F6F7F9;
  --paper-raised: #FFFFFF;
  --paper-tint:   #EFF2F6;
  --ink:          #0E1A2B;
  --navy:         #16273F;
  --navy-700:     #20395A;
  --slate:        #51647B;
  --slate-light:  #7E8EA1;
  --line:         #E4E8EE;
  --line-strong:  #D3DAE3;
  --teal:         #15707E;
  --teal-bright:  #1B8B9B;
  --teal-tint:    #E7F1F2;
  --burgundy:     #7C2D3A;

  /* Type */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --maxw:      1140px;
  --maxw-text: 720px;
  --gutter:    clamp(1.25rem, 5vw, 3rem);
  --nav-h:     72px;

  /* Radius / shadow / motion */
  --radius:    14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14,26,43,.04), 0 2px 8px rgba(14,26,43,.04);
  --shadow-md: 0 4px 14px rgba(14,26,43,.06), 0 18px 40px rgba(14,26,43,.07);
  --ease:      cubic-bezier(.22,.61,.36,1);
  --t-fast:    .18s var(--ease);
  --t-mid:     .32s var(--ease);
}

/* ----------------------------------------------------------------------- */
/* Reset / base                                                            */
/* ----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: clip; /* clip (not hidden) so position: sticky header still pins */
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--teal); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--teal-bright); }

::selection { background: rgba(21,112,126,.16); color: var(--ink); }

:focus-visible {
  outline: 2.5px solid var(--teal-bright);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: .65rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 200;
  font: 500 .9rem/1 var(--font-sans); transition: top var(--t-fast);
}
.skip-link:focus { top: 0; color: #fff; }

/* ----------------------------------------------------------------------- */
/* Typography                                                              */
/* ----------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.012em;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.45rem, 6vw, 4.05rem);
  font-weight: 460;
  line-height: 1.04;
  letter-spacing: -.022em;
}
h2.section-title { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 480; }
h3 { font-size: 1.32rem; font-weight: 540; letter-spacing: -.008em; }

.lead {
  font-size: clamp(1.12rem, 1.8vw, 1.33rem);
  line-height: 1.55;
  color: var(--slate);
  font-weight: 400;
}

p { text-wrap: pretty; }
p + p { margin-top: 1.05em; }

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* Mono eyebrow — the "instrument label" */
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono);
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--teal); opacity: .6;
}
.eyebrow.center::before { display: none; }

/* ----------------------------------------------------------------------- */
/* Layout primitives                                                       */
/* ----------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.measure { max-width: var(--maxw-text); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head .lead { margin-top: 1rem; max-width: 60ch; }

.divider { height: 1px; background: var(--line); border: 0; }

/* ----------------------------------------------------------------------- */
/* Header / navigation                                                     */
/* ----------------------------------------------------------------------- */
/* Mount wrapper must not create a layout box, or it constrains the sticky header */
#site-header { display: contents; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: padding var(--t-mid), background var(--t-mid);
}
.nav {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  transition: max-width var(--t-mid), height var(--t-mid), background var(--t-mid),
              box-shadow var(--t-mid), border-radius var(--t-mid), border-color var(--t-mid),
              padding var(--t-mid);
  border: 1px solid transparent;
}
/* Floating pill on scroll (desktop) */
.site-header.is-scrolled { padding-top: 11px; }
.site-header.is-scrolled .nav {
  height: 60px; max-width: 1000px;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-color: var(--line);
  border-radius: 100px;
  box-shadow: 0 8px 30px rgba(14,26,43,.10);
  padding-inline: 1.5rem;
}
@media (max-width: 880px) {
  /* On mobile keep full-width bar (no narrowing) so the dropdown anchors correctly */
  .site-header.is-scrolled { padding-top: 0; }
  .site-header.is-scrolled .nav {
    height: var(--nav-h); max-width: none; border-radius: 0;
    padding-inline: var(--gutter); border-color: transparent;
    border-bottom: 1px solid var(--line); box-shadow: none;
  }
}
.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-display); font-size: 1.18rem; font-weight: 560;
  color: var(--ink); letter-spacing: -.01em; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 30px; height: 30px; flex: 0 0 auto; }

.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; }
.nav-links a {
  position: relative; display: inline-block;
  padding: .5rem .72rem; border-radius: var(--radius-sm);
  font-size: .94rem; font-weight: 450; color: var(--slate);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover { color: var(--ink); background: var(--paper-tint); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 540; }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: .72rem; right: .72rem; bottom: .12rem;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--burgundy));
}

.nav-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .58rem 1.05rem; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: .9rem; font-weight: 500;
  border: 1px solid var(--navy);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.nav-cta:hover { background: var(--navy-700); color: #fff; box-shadow: var(--shadow-sm); }
.nav-cta svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong);
  background: var(--paper-raised); border-radius: var(--radius-sm); cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 1rem var(--gutter) 1.6rem;
    flex-direction: column; align-items: stretch; gap: .25rem;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity var(--t-mid), transform var(--t-mid), visibility var(--t-mid);
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links { flex-direction: column; align-items: stretch; gap: .1rem; width: 100%; }
  .nav-links a { padding: .85rem .5rem; font-size: 1.05rem; border-radius: var(--radius-sm); }
  .nav-links a[aria-current="page"]::after { left: .5rem; right: auto; width: 22px; }
  .nav-cta { margin-top: .85rem; justify-content: center; padding: .8rem 1.05rem; }
}

/* ----------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .82rem 1.4rem; border-radius: 999px;
  font-family: var(--font-sans); font-size: .96rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-700); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--slate); background: var(--paper-raised); transform: translateY(-1px); }
.btn-accent { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-accent:hover { background: var(--teal-bright); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; }

.text-link {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 500;
  border-bottom: 1px solid transparent; transition: border-color var(--t-fast), gap var(--t-fast);
}
.text-link svg { width: 15px; height: 15px; transition: transform var(--t-fast); }
.text-link:hover { border-bottom-color: currentColor; }
.text-link:hover svg { transform: translateX(2px); }

/* ----------------------------------------------------------------------- */
/* Hero                                                                    */
/* ----------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: 1.32fr .9fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy .display { margin-top: 1.3rem; }
.hero-thesis {
  margin-top: 1.5rem; max-width: 32ch;
  font-size: clamp(1.16rem, 1.9vw, 1.42rem); line-height: 1.5; color: var(--slate);
}
.hero-thesis b { color: var(--ink); font-weight: 600; }
.hero-meta {
  margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .55rem .9rem;
  font-family: var(--font-mono); font-size: .8rem; color: var(--slate); letter-spacing: .01em;
}
.hero-meta span { display: inline-flex; align-items: center; gap: .5rem; }
.hero-meta span:not(:last-child)::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); margin-left: .35rem; }
.hero .btn-row { margin-top: 2.1rem; }

/* Portrait */
.hero-portrait { position: relative; z-index: 2; justify-self: end; width: 100%; max-width: 380px; }
.portrait-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--navy); box-shadow: var(--shadow-md);
  aspect-ratio: 1122 / 1402;
}
.portrait-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.96) contrast(1.02);
}
.portrait-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,39,63,0) 55%, rgba(14,26,43,.28));
  mix-blend-mode: multiply;
}
.portrait-tag {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .7rem; border-radius: 999px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--navy); box-shadow: var(--shadow-sm);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--burgundy); position: relative; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--burgundy); opacity: 0; animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(.7); opacity: .7; } 80%,100% { transform: scale(2.1); opacity: 0; } }

/* Waveform signature */
.hero-wave { position: absolute; inset: auto 0 0 0; width: 100%; height: 180px; z-index: 1; pointer-events: none; opacity: .9; }
.hero-wave .trace { fill: none; stroke: var(--teal); stroke-width: 1.4; opacity: .55;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3.4s var(--ease) forwards; }
.hero-wave .trace-soft { fill: none; stroke: var(--slate-light); stroke-width: 1; opacity: .25; }
.wave-pulse { fill: var(--burgundy); }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 2.5rem 3.5rem; }
  .hero-portrait { justify-self: start; max-width: 300px; order: -1; }
}

/* ----------------------------------------------------------------------- */
/* Stat strip                                                              */
/* ----------------------------------------------------------------------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-block: 1px solid var(--line);
}
.stat {
  background: var(--paper); padding: 1.6rem var(--gutter);
  display: flex; flex-direction: column; gap: .25rem;
}
.stat .num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 520; color: var(--navy); letter-spacing: -.02em; }
.stat .lbl { font-family: var(--font-mono); font-size: .73rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); }
@media (max-width: 720px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } .stat { padding: 1.3rem var(--gutter); } }

/* ----------------------------------------------------------------------- */
/* Cards (research / generic)                                              */
/* ----------------------------------------------------------------------- */
.card-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.card {
  position: relative; background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.7rem 1.6rem; transition: border-color var(--t-mid), box-shadow var(--t-mid), transform var(--t-mid);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card .card-icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 1.1rem;
  display: grid; place-items: center; color: var(--teal);
  background: var(--teal-tint); border: 1px solid rgba(21,112,126,.14);
}
.card .card-icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .96rem; color: var(--slate); }
.card .card-tag { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-light); }

/* ----------------------------------------------------------------------- */
/* Project blocks                                                          */
/* ----------------------------------------------------------------------- */
.project {
  display: grid; grid-template-columns: 56px 1fr; gap: 1.5rem;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
}
.project:first-child { border-top: 0; }
.project-index {
  font-family: var(--font-mono); font-size: .82rem; color: var(--teal);
  padding-top: .4rem; letter-spacing: .04em;
}
.project h3 { font-size: clamp(1.35rem, 2.4vw, 1.72rem); font-weight: 500; }
.project .project-sub { color: var(--slate); margin-top: .55rem; max-width: 62ch; font-size: 1.04rem; }
.project-detail {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem 1.6rem;
  margin-top: 1.5rem;
}
.project-detail .dt {
  font-family: var(--font-mono); font-size: .71rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate-light); margin-bottom: .35rem;
}
.project-detail .dd { font-size: .95rem; color: var(--ink); line-height: 1.55; }
.project-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.4rem; }
.tag {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em;
  color: var(--slate); background: var(--paper-tint);
  border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem;
}
@media (max-width: 720px) {
  .project { grid-template-columns: 1fr; gap: .7rem; }
  .project-index { padding-top: 0; }
  .project-detail { grid-template-columns: 1fr; gap: 1rem; }
}

/* ----------------------------------------------------------------------- */
/* Publications                                                            */
/* ----------------------------------------------------------------------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.pub-filter {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .05em;
  padding: .5rem .95rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--slate); border: 1px solid var(--line-strong);
  transition: all var(--t-fast);
}
.pub-filter:hover { color: var(--ink); border-color: var(--slate); }
.pub-filter[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.pub-group { margin-bottom: 2.6rem; }
.pub-group-title {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 1.1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.pub-group-title .count { color: var(--slate-light); }

.pub {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.pub-year {
  font-family: var(--font-mono); font-size: .82rem; color: var(--slate); padding-top: .15rem;
  min-width: 3ch;
}
.pub-body p.pub-title { font-size: 1.04rem; line-height: 1.45; color: var(--ink); font-weight: 500; }
.pub-authors { font-size: .92rem; color: var(--slate); margin-top: .35rem; }
/* .me self-highlight defined globally below */
.pub-venue { font-style: italic; color: var(--slate); }
.pub-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; align-items: center; }
.pub-badge {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .22rem .6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--slate);
}
.pub-badge.first { color: var(--burgundy); border-color: rgba(124,45,58,.3); background: rgba(124,45,58,.05); }
.pub-badge.doi { color: var(--teal); border-color: rgba(21,112,126,.3); }
.pub-badge.doi:hover { background: var(--teal-tint); }
.is-hidden { display: none !important; }

/* ----------------------------------------------------------------------- */
/* Timeline (patents / conferences / experience)                          */
/* ----------------------------------------------------------------------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(180deg, var(--teal) 0%, var(--line-strong) 14%, var(--line-strong) 86%, transparent);
}
.tl-item { position: relative; padding: 0 0 2rem 2.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.tl-item:hover::before { border-color: var(--teal); }
.tl-item.is-key::before { border-color: var(--burgundy); background: var(--burgundy); box-shadow: 0 0 0 4px rgba(124,45,58,.1); }
.tl-date { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; color: var(--teal); text-transform: uppercase; }
.tl-item h3 { font-size: 1.12rem; font-weight: 540; margin-top: .35rem; font-family: var(--font-display); }
.tl-item h3.sans { font-family: var(--font-sans); font-size: 1.04rem; font-weight: 600; }
.tl-item p { font-size: .94rem; color: var(--slate); margin-top: .3rem; }
.tl-item .tl-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--slate-light); margin-top: .35rem; }

.year-head {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 520; color: var(--navy);
  margin: 2.4rem 0 1.3rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: .8rem;
}
.year-head:first-child { margin-top: 0; }
.year-head .yr-count { font-family: var(--font-mono); font-size: .76rem; color: var(--slate-light); letter-spacing: .08em; }

/* ----------------------------------------------------------------------- */
/* Definition rows (awards, memberships, experience compact)              */
/* ----------------------------------------------------------------------- */
.def-list { display: grid; gap: 0; }
.def-row {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.5rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.def-row:last-child { border-bottom: 0; }
.def-row .def-main { }
.def-row .def-title { font-weight: 560; color: var(--ink); font-size: 1.04rem; }
.def-row .def-sub { color: var(--slate); font-size: .94rem; margin-top: .2rem; }
.def-row .def-aside { font-family: var(--font-mono); font-size: .82rem; color: var(--teal); white-space: nowrap; }
@media (max-width: 600px) {
  .def-row { grid-template-columns: 1fr; gap: .3rem; }
  .def-row .def-aside { order: -1; }
}

/* ----------------------------------------------------------------------- */
/* Experience cards                                                        */
/* ----------------------------------------------------------------------- */
.xp { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.xp:last-child { border-bottom: 0; }
.xp-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1.5rem; align-items: baseline; }
.xp-role { font-family: var(--font-display); font-size: 1.22rem; font-weight: 540; }
.xp-date { font-family: var(--font-mono); font-size: .8rem; color: var(--teal); }
.xp-org { color: var(--slate); font-weight: 500; margin-top: .15rem; }
.xp p { color: var(--slate); font-size: .96rem; margin-top: .5rem; max-width: 78ch; }
.xp-role.sans-title { font-family: var(--font-sans); font-size: 1.04rem; font-weight: 600; letter-spacing: 0; max-width: 60ch; line-height: 1.4; }

/* Author self-highlight (used across pubs, patents, conferences) */
.me { color: var(--ink); font-weight: 600; box-shadow: inset 0 -1.5px 0 var(--teal); }

/* ----------------------------------------------------------------------- */
/* CV page sub-nav                                                         */
/* ----------------------------------------------------------------------- */
.subnav {
  position: sticky; top: var(--nav-h); z-index: 40;
  background: rgba(246,247,249,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); margin-bottom: 2.5rem;
}
.subnav-inner { display: flex; gap: .3rem; overflow-x: auto; padding: .6rem 0; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  white-space: nowrap; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--slate); padding: .45rem .8rem; border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.subnav a:hover { color: var(--ink); background: var(--paper-tint); }
.subnav a.is-active { color: var(--teal); background: var(--teal-tint); }

.cv-section { scroll-margin-top: calc(var(--nav-h) + 70px); padding-block: clamp(2rem, 4vw, 3rem); }
.cv-section + .cv-section { border-top: 1px solid var(--line); }

/* ----------------------------------------------------------------------- */
/* Skills                                                                  */
/* ----------------------------------------------------------------------- */
.skill-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.skill-cat { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.skill-cat h4 { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: .9rem; }
.skill-chips { display: flex; flex-wrap: wrap; gap: .45rem; }

/* ----------------------------------------------------------------------- */
/* About / portrait split                                                  */
/* ----------------------------------------------------------------------- */
.about-split { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-aside { position: sticky; top: calc(var(--nav-h) + 2rem); }
.about-aside .portrait-frame { max-width: 320px; }
.about-facts { margin-top: 1.6rem; display: grid; gap: 0; }
.about-facts .fact { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.about-facts .fact:last-child { border-bottom: 0; }
.about-facts .fk { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-light); }
.about-facts .fv { color: var(--ink); font-size: .98rem; margin-top: .15rem; }
.about-body p { color: var(--slate); font-size: 1.08rem; }
.about-body p strong { color: var(--ink); }
@media (max-width: 820px) {
  .about-split { grid-template-columns: 1fr; }
  .about-aside { position: static; }
  .about-aside .portrait-frame { max-width: 260px; }
}

/* ----------------------------------------------------------------------- */
/* Contact                                                                 */
/* ----------------------------------------------------------------------- */
.contact-split { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .contact-split { grid-template-columns: 1fr; } }

.contact-channels { display: grid; gap: 0; }
.channel {
  display: flex; align-items: center; gap: 1rem; padding: 1.05rem 0;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.channel:last-child { border-bottom: 0; }
.channel:hover { color: var(--ink); }
.channel:hover .channel-ico { border-color: var(--teal); color: var(--teal); background: var(--teal-tint); }
.channel-ico {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--slate); transition: all var(--t-fast);
}
.channel-ico svg { width: 20px; height: 20px; }
.channel .ck { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-light); }
.channel .cv2 { font-weight: 500; margin-top: .1rem; }

.form { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.2rem); }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-size: .86rem; font-weight: 500; color: var(--ink); margin-bottom: .45rem; }
.field label .req { color: var(--burgundy); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .75rem .9rem; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); background: var(--paper-raised);
  box-shadow: 0 0 0 3px rgba(21,112,126,.12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--slate-light); }
.form-note { font-size: .82rem; color: var(--slate-light); margin-top: .9rem; }
.form-status { margin-top: 1rem; font-size: .92rem; padding: .8rem 1rem; border-radius: var(--radius-sm); display: none; }
.form-status.ok { display: block; background: var(--teal-tint); color: var(--teal); border: 1px solid rgba(21,112,126,.25); }
.form-status.err { display: block; background: rgba(124,45,58,.06); color: var(--burgundy); border: 1px solid rgba(124,45,58,.25); }

/* ----------------------------------------------------------------------- */
/* CTA banner                                                              */
/* ----------------------------------------------------------------------- */
.cta-banner {
  position: relative; overflow: hidden; background: var(--navy); color: #fff;
  border-radius: var(--radius); padding: clamp(2.2rem, 5vw, 3.4rem);
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
.cta-banner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-banner p { color: rgba(255,255,255,.72); margin-top: .6rem; max-width: 46ch; }
.cta-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.cta-banner .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); color: #fff; }
.cta-banner .wave-bg { position: absolute; right: 0; top: 0; height: 100%; width: 50%; opacity: .14; pointer-events: none; }
.cta-banner .wave-bg path { fill: none; stroke: #fff; stroke-width: 1.2; }
@media (max-width: 720px) { .cta-banner { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------------- */
/* Footer                                                                  */
/* ----------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.66); padding-block: clamp(3rem, 5vw, 4rem) 2rem; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem 2rem; }
.footer-brand .fbname { font-family: var(--font-display); font-size: 1.35rem; color: #fff; font-weight: 540; }
.footer-brand p { margin-top: .7rem; font-size: .94rem; max-width: 36ch; color: rgba(255,255,255,.6); }
.footer-col h4 { color: #fff; font-family: var(--font-mono); font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.footer-col a { color: rgba(255,255,255,.66); font-size: .94rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-family: var(--font-mono); font-size: .76rem; color: rgba(255,255,255,.5); letter-spacing: .03em;
}
.footer-bottom a { color: rgba(255,255,255,.6); }
.footer-bottom a:hover { color: #fff; }
@media (max-width: 720px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ----------------------------------------------------------------------- */
/* Page hero (interior pages)                                              */
/* ----------------------------------------------------------------------- */
.page-hero { padding-block: clamp(3rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.page-hero .display { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-top: 1.1rem; }
.page-hero .lead { margin-top: 1.2rem; max-width: 62ch; }

/* ----------------------------------------------------------------------- */
/* Scroll reveal                                                           */
/* ----------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-wave .trace { animation: none; stroke-dashoffset: 0; }
  .pulse-dot::after { animation: none; }
}

/* ----------------------------------------------------------------------- */
/* Utilities                                                               */
/* ----------------------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--slate); }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------------- */
/* Additions: solo hero, section tones, project media, feature, news       */
/* ----------------------------------------------------------------------- */

/* Solo hero (no portrait) */
.hero--solo {
  background:
    linear-gradient(90deg, rgba(246,247,249,.95) 0%, rgba(246,247,249,.90) 34%, rgba(246,247,249,.72) 58%, rgba(246,247,249,.42) 100%),
    url('img/background.jpg') center right / cover no-repeat;
  background-color: var(--paper);
}
.hero--solo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246,247,249,.08) 0%, rgba(246,247,249,.22) 100%);
  pointer-events: none;
}
.hero--solo .hero-inner { grid-template-columns: 1fr; padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.hero--solo .hero-copy { max-width: 820px; }
.hero--solo .hero-thesis { max-width: 40ch; font-size: clamp(1.2rem, 2.1vw, 1.55rem); }
.hero--solo .hero-wave { height: 220px; }

/* Alternating section tones for rhythm */
.section--white { background: var(--paper-raised); }
.section--tint  { background: var(--paper-tint); }
.section--white + .section, .section + .section--white,
.section--tint + .section, .section + .section--tint { border-top: 0; }

/* Project with media image */
.project--media > div:nth-child(2) {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(1.5rem, 3.5vw, 2.8rem); align-items: center;
}
.project-figure {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-tint); box-shadow: var(--shadow-sm);
}
.project-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-figure figcaption {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); padding: .65rem .85rem; background: var(--paper-raised); border-top: 1px solid var(--line);
}
.project--media .project-detail { grid-template-columns: 1fr; gap: .9rem; }
@media (max-width: 760px) {
  .project--media > div:nth-child(2) { grid-template-columns: 1fr; }
  .project--media .project-figure { order: -1; }
}

/* Feature split (home: device showcase) */
.feature-split {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.feature-figure {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-md); background: var(--navy);
}
.feature-figure img { width: 100%; display: block; }
.feature-copy .eyebrow { margin-bottom: 1rem; }
.feature-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.4rem; }
@media (max-width: 820px) {
  .feature-split { grid-template-columns: 1fr; }
  .feature-figure { order: -1; }
}

/* Atmospheric full-width banded image */
.band-figure {
  margin: 0; border-radius: var(--radius); overflow: hidden; position: relative;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.band-figure img { width: 100%; display: block; aspect-ratio: 21/9; object-fit: cover; }
.band-figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1.6rem;
  background: linear-gradient(0deg, rgba(14,26,43,.78), rgba(14,26,43,0));
  color: #fff; font-size: .96rem; font-weight: 500;
}

/* News / Updates empty state */
.news-empty {
  text-align: center; max-width: 540px; margin-inline: auto;
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}
.news-empty .news-ico {
  width: 60px; height: 60px; margin: 0 auto 1.6rem; border-radius: 16px;
  display: grid; place-items: center; color: var(--teal);
  background: var(--teal-tint); border: 1px solid rgba(21,112,126,.16);
}
.news-empty .news-ico svg { width: 30px; height: 30px; }
.news-empty h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.news-empty p { color: var(--slate); margin-top: .9rem; }
.news-empty .news-rule {
  width: 60px; height: 2px; margin: 1.8rem auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--burgundy));
}
