/* =========================================================
   Mikaela C. Maac — Portfolio
   A minimalist, interactive, responsive single-page site.

   Contents
   01  Design tokens & themes
   02  Reset & base
   03  Layout primitives
   04  Typography & section headers
   05  Buttons, chips, tags, links
   06  Navigation
   07  Hero
   08  Stats
   09  About
   10  Expertise (filters + cards)
   11  Experience timeline (accordion)
   12  Credentials
   13  Contact & form
   14  Footer & floating controls
   15  Reveal animations
   16  Responsive breakpoints
   17  Accessibility & print
   ========================================================= */

/* ---------------------------------------------------------
   01  Design tokens & themes
   --------------------------------------------------------- */
:root {
  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;

  /* Fluid scale */
  --fs-xs:    0.76rem;
  --fs-sm:    0.86rem;
  --fs-base:  clamp(0.97rem, 0.94rem + 0.18vw, 1.06rem);
  --fs-lead:  clamp(1.04rem, 0.99rem + 0.32vw, 1.19rem);
  --fs-h3:    clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-h2:    clamp(1.7rem, 1.35rem + 1.7vw, 2.9rem);
  --fs-h1:    clamp(2.3rem, 1.5rem + 4.4vw, 4.6rem);

  /* Rhythm */
  --shell:      1140px;
  --gutter:     clamp(1.15rem, 4vw, 2.75rem);
  --section-y:  clamp(4.25rem, 9vw, 8.5rem);
  --radius:     14px;
  --radius-lg:  22px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  .45s;

  color-scheme: light;
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  --bg:          #f8f8f6;
  --bg-elev:     #ffffff;
  --tint:        #f1f1ed;
  --ink:         #15181d;
  --ink-soft:    #3b424d;
  --muted:       #5e6672;
  --line:        #e3e3dd;
  --line-strong: #cfcfc7;
  --accent:      #1a4d7a;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(26, 77, 122, .09);
  --accent-glow: rgba(26, 77, 122, .16);
  --live:        #0f7a52;
  --live-soft:   rgba(15, 122, 82, .12);
  --shadow-sm:   0 1px 2px rgba(18, 22, 28, .05), 0 4px 14px rgba(18, 22, 28, .05);
  --shadow-md:   0 2px 6px rgba(18, 22, 28, .06), 0 18px 46px rgba(18, 22, 28, .09);
  --grain:       rgba(21, 24, 29, .035);
  color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
  --bg:          #0c0e12;
  --bg-elev:     #14171e;
  --tint:        #101319;
  --ink:         #edeef1;
  --ink-soft:    #c6cad2;
  --muted:       #939aa6;
  --line:        #23272f;
  --line-strong: #333944;
  --accent:      #74b3e6;
  --accent-ink:  #07121c;
  --accent-soft: rgba(116, 179, 230, .13);
  --accent-glow: rgba(116, 179, 230, .18);
  --live:        #4ecf9c;
  --live-soft:   rgba(78, 207, 156, .14);
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md:   0 2px 8px rgba(0, 0, 0, .45), 0 24px 60px rgba(0, 0, 0, .5);
  --grain:       rgba(255, 255, 255, .04);
  color-scheme: dark;
}

/* ---------------------------------------------------------
   02  Reset & base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

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

img { height: auto; }

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

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; }

ul, ol { list-style: none; padding: 0; }

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

/* Shared inline icon sizing — strokes inherit text colour */
.icon,
.skill-card__icon svg,
.tl-chevron svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------
   03  Layout primitives
   --------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

.section--tint {
  background: var(--tint);
  border-block: 1px solid var(--line);
}

/* ---------------------------------------------------------
   04  Typography & section headers
   --------------------------------------------------------- */
.section__head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }

.section__kicker {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .85rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.section__sub {
  margin-top: .85rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--live);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%   { transform: scale(.6); opacity: .9; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------------------------------------------------------
   05  Buttons, chips, tags, links
   --------------------------------------------------------- */
.btn {
  --btn-py: .82rem;
  --btn-px: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: var(--btn-py) var(--btn-px);
  font-size: var(--fs-sm);
  font-weight: 550;
  letter-spacing: .01em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform .2s var(--ease), background-color .25s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}

.btn--sm { --btn-py: .58rem; --btn-px: 1.05rem; font-size: var(--fs-xs); }

.btn--block { width: 100%; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

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

.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn:active { transform: translateY(0); }

.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(2px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--fs-xs);
  font-weight: 550;
  letter-spacing: .02em;
  padding: .32rem .7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--bg-elev);
  white-space: nowrap;
}

.chip--solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.chip--live { color: var(--live); border-color: transparent; background: var(--live-soft); }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }

.tags li {
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  padding: .32rem .68rem;
  border-radius: 8px;
  background: var(--accent-soft);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

.skill-card:hover .tags li { background: var(--accent); color: var(--accent-ink); }

.tags--sm { margin-top: 1.25rem; }

.tags--sm li { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--accent);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), gap .25s var(--ease);
}

.link-arrow:hover { border-color: currentColor; gap: .6rem; }

/* Hero headline sweep underline.
   Drawn as an animated background rather than a nowrap pseudo-element so the
   phrase can wrap freely on narrow screens without widening its grid track. */
.underline-sweep {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 .075em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  animation: sweep 1.1s .8s var(--ease) forwards;
}

@keyframes sweep { to { background-size: 100% .075em; } }

/* ---------------------------------------------------------
   06  Navigation
   --------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .1s linear;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .nav { background: var(--bg); }
}

.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.brand { display: inline-flex; align-items: center; gap: .7rem; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: .04em;
  flex: none;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.22; }
.brand__text strong { font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.005em; }
.brand__text small { font-size: var(--fs-xs); color: var(--muted); }

.nav__links { display: flex; align-items: center; gap: .2rem; }

.nav__link {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  padding: .5rem .8rem;
  border-radius: var(--radius-pill);
  transition: color .25s var(--ease), background-color .25s var(--ease);
}

.nav__link:hover { color: var(--ink); background: var(--accent-soft); }

.nav__link.is-active { color: var(--accent); background: var(--accent-soft); }

.nav__actions { display: flex; align-items: center; gap: .55rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-elev);
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: rotate(-12deg); }

.icon-btn .icon { width: 1.05rem; height: 1.05rem; }

[data-theme="light"] .icon--moon,
[data-theme="dark"]  .icon--sun { display: none; }

.burger {
  display: none;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: .62rem .55rem;
}

.burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}

.burger span + span { margin-top: 4px; }

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------------------------------------------------------
   07  Hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 7rem);
  overflow: hidden;
}

/* Cursor-following soft light, desktop only (toggled in JS) */
.hero__glow {
  position: absolute;
  width: 46rem;
  height: 46rem;
  left: var(--mx, 50%);
  top: var(--my, 30%);
  translate: -50% -50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 62%);
  opacity: 0;
  transition: opacity .6s var(--ease);
  pointer-events: none;
  filter: blur(8px);
}

.hero.has-glow .hero__glow { opacity: 1; }

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, .88fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

/* min-width:0 stops long words from inflating an auto-sized grid track */
.hero__content,
.hero__portrait { min-width: 0; }

.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.022em;
  margin-top: 1.5rem;
  text-wrap: balance;
}

.hero__title em { font-style: italic; color: var(--muted); }

.hero__role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  margin-top: 1.5rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero__role-static { color: var(--muted); }

.typewriter { color: var(--accent); display: inline-flex; align-items: baseline; min-height: 1.4em; }

.caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-left: 3px;
  background: var(--accent);
  translate: 0 .1em;
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero__lede {
  max-width: 56ch;
  margin-top: 1.35rem;
  font-size: var(--fs-lead);
  color: var(--ink-soft);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.15rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-top: 2.35rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.hero__meta li { display: inline-flex; align-items: center; gap: .5rem; }

.hero__meta .icon { color: var(--accent); }

.hero__meta a { border-bottom: 1px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease); }
.hero__meta a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* Portrait */
.hero__portrait { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }

.portrait-frame {
  position: relative;
  width: min(100%, 24rem);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--tint);
  box-shadow: var(--shadow-md);
  transition: transform .6s var(--ease);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--line-strong);
  pointer-events: none;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease), filter .5s var(--ease);
}

.portrait-frame:hover { transform: translateY(-5px); }
.portrait-frame:hover img { transform: scale(1.035); }

.portrait-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  translate: -50% 0;
  width: 1.5rem;
  height: 2.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  display: grid;
  place-items: start center;
  padding-top: 6px;
}

.scroll-cue span {
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  animation: cue 1.8s var(--ease) infinite;
}

@keyframes cue {
  0%   { transform: translateY(0);    opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translateY(13px); opacity: 0; }
}

/* ---------------------------------------------------------
   08  Stats
   --------------------------------------------------------- */
.stats {
  background: var(--tint);
  border-block: 1px solid var(--line);
  padding-block: clamp(2.25rem, 4.5vw, 3.5rem);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.stat { display: flex; flex-direction: column; gap: .45rem; }

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.1rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat__num i { font-style: normal; font-size: .46em; margin-left: .12em; color: var(--muted); }

.stat__label { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }

/* ---------------------------------------------------------
   09  About
   --------------------------------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.about__body > * + * { margin-top: 1.1rem; }
.about__body p { color: var(--ink-soft); }
.about__body strong { color: var(--ink); font-weight: 600; }

.how__list { display: grid; gap: .75rem; }

.how {
  position: relative;
  padding: 1.4rem 1.5rem 1.4rem 4.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}

.how:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-sm); }

.how__step {
  position: absolute;
  left: 1.45rem;
  top: 1.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent);
  opacity: .55;
}

.how h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; margin-bottom: .3rem; }

.how p { font-size: var(--fs-sm); color: var(--muted); }

/* ---------------------------------------------------------
   10  Expertise
   --------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.filter {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  padding: .5rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background-color .25s var(--ease), transform .2s var(--ease);
}

.filter:hover { color: var(--ink); border-color: var(--accent); }

.filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: 1rem;
}

.skill-card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: transform .35s var(--ease), border-color .35s var(--ease),
              box-shadow .35s var(--ease), opacity .3s var(--ease);
}

.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-md); }

.skill-card.is-hidden {
  display: none;
}

.skill-card__top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }

.skill-card__icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.skill-card__icon svg { width: 1.2rem; height: 1.2rem; }

.skill-card h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }

/* ---------------------------------------------------------
   11  Experience timeline
   --------------------------------------------------------- */
.timeline { position: relative; display: grid; gap: .9rem; }

.tl-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.tl-item:hover { border-color: var(--line-strong); }

.tl-item.is-open { border-color: var(--accent); box-shadow: var(--shadow-sm); }

.tl-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.5rem clamp(1.15rem, 3vw, 1.85rem);
  text-align: left;
}

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}

.tl-item.is-open .tl-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.tl-head__text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }

.tl-role {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -.012em;
  line-height: 1.3;
}

.tl-org { font-size: var(--fs-sm); color: var(--muted); }

.tl-chevron { color: var(--muted); display: grid; place-items: center; transition: transform .35s var(--ease), color .3s var(--ease); }
.tl-chevron svg { width: 1.15rem; height: 1.15rem; }

.tl-item.is-open .tl-chevron { transform: rotate(180deg); color: var(--accent); }

.tl-body {
  overflow: hidden;
  height: 0;
  transition: height .42s var(--ease);
}

.tl-body__inner {
  padding: 0 clamp(1.15rem, 3vw, 1.85rem) 1.75rem clamp(2.5rem, 4.5vw, 3.4rem);
}

.bullets { display: grid; gap: .72rem; }

.bullets li {
  position: relative;
  padding-left: 1.15rem;
  font-size: var(--fs-sm);
  line-height: 1.62;
  color: var(--ink-soft);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .65;
}

.bullets strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------
   12  Credentials
   --------------------------------------------------------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1rem;
}

.cert {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}

.cert:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-md); }

.cert__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }

.cert__issuer {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}

.cert__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -.01em;
  margin-top: .3rem;
}

.cert__dates { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

.cert .link-arrow { margin-top: auto; padding-top: .85rem; align-self: flex-start; }

.cert--edu { background: var(--accent-soft); border-color: transparent; }

/* ---------------------------------------------------------
   13  Contact & form
   --------------------------------------------------------- */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: start;
}

.contact__intro .lede { margin-top: 1.15rem; max-width: 52ch; }

.contact__list {
  display: grid;
  gap: .1rem;
  margin-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.contact__list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}

.contact__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  min-width: 0;
}

.contact__value a { word-break: break-word; border-bottom: 1px solid var(--line-strong); transition: color .2s var(--ease), border-color .2s var(--ease); }
.contact__value a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--muted);
  padding: .26rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.copy-btn.is-copied { color: var(--live); border-color: var(--live); }

.copy-btn .icon { width: .92rem; height: .92rem; }

/* Form */
.contact__form {
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}

.form__title { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }

.form__note { font-size: var(--fs-xs); color: var(--muted); margin-top: .4rem; line-height: 1.5; }

.field { display: grid; gap: .4rem; margin-top: 1.25rem; }

.field label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.field .opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .75; }

.field input,
.field textarea {
  width: 100%;
  padding: .8rem .95rem;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}

.field textarea { resize: vertical; min-height: 6.5rem; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: .62; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field__error { font-size: var(--fs-xs); color: #c0392b; min-height: 0; }

[data-theme="dark"] .field__error { color: #ff9b8f; }

.field.has-error input,
.field.has-error textarea { border-color: #c0392b; }

.contact__form .btn { margin-top: 1.6rem; }

/* ---------------------------------------------------------
   14  Footer & floating controls
   --------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--tint);
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
  text-align: center;
}

.footer__inner { display: grid; gap: .55rem; justify-items: center; }

.footer__name { font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -.01em; }

.footer__meta { font-size: var(--fs-sm); color: var(--muted); }

.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.35rem; margin-top: .85rem; }

.footer__links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.footer__links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer__fine { font-size: var(--fs-xs); color: var(--muted); margin-top: 1.1rem; }

/* Visitor counter — deliberately quiet, sits above the fine print.
   [hidden] until the count resolves, so it never flashes a zero. */
.visits {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1.25rem;
  padding: .34rem .8rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
}

.visits[hidden] { display: none; }

.visits strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.visits__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 45;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.to-top:hover { color: var(--accent); border-color: var(--accent); }

.to-top .icon { width: 1.1rem; height: 1.1rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  translate: -50% 0;
  z-index: 70;
  max-width: calc(100vw - 2rem);
  padding: .7rem 1.2rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s var(--ease);
}

[data-theme="dark"] .toast { color: var(--bg); background: var(--ink); }

.toast.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------------------------------------------------------
   15  Reveal animations
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.reveal.is-in { opacity: 1; transform: none; }

/* If JS never runs, content must still be visible */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------------------------------------------------------
   16  Responsive breakpoints
   --------------------------------------------------------- */
@media (max-width: 1080px) {
  .stats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
}

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }

  .hero__content { order: 2; }

  .hero__portrait { order: 1; align-items: flex-start; }

  .portrait-frame { width: min(58vw, 15rem); }

  .portrait-badges { justify-content: flex-start; }

  .about__grid,
  .contact__grid { grid-template-columns: minmax(0, 1fr); }

  .scroll-cue { display: none; }
}

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    inset: 4.4rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s var(--ease);
  }

  .nav__links.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

  .nav__link { padding: .85rem 1rem; font-size: 1rem; border-radius: 10px; }

  .burger { display: block; }

  .brand__text small { display: none; }

  .tl-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: .65rem;
    padding-block: 1.25rem;
  }

  .tl-when { grid-column: 2 / 3; grid-row: 2; }

  .tl-chevron { grid-column: 3; grid-row: 1; align-self: start; }
}

@media (max-width: 640px) {
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .stat:last-child { grid-column: span 2; }

  .hero__meta { gap: .75rem; flex-direction: column; align-items: flex-start; }

  .contact__list li { grid-template-columns: minmax(0, 1fr); gap: .3rem; }

  .footer__links { gap: 1rem; }

  .btn { width: 100%; }

  .hero__cta { flex-direction: column; align-items: stretch; }

  .nav__actions .btn--sm { display: none; }
}

@media (max-width: 400px) {
  .stats__grid { grid-template-columns: 1fr; }
  .stat:last-child { grid-column: auto; }
}

/* Large screens: a touch more air */
@media (min-width: 1400px) {
  :root { --shell: 1220px; }
}

/* ---------------------------------------------------------
   17  Accessibility & print
   --------------------------------------------------------- */
.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;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100%;
  translate: -50% 0;
  z-index: 100;
  padding: .7rem 1.2rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 0 0 10px 10px;
  transition: top .25s var(--ease);
}

.skip-link:focus { top: 0; }

/* Honour reduced-motion preferences across the board */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

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

  .underline-sweep { background-size: 100% .075em; }

  .hero__glow { display: none; }
}

@media print {
  .nav, .to-top, .toast, .scroll-progress, .scroll-cue,
  .filters, .contact__form, .hero__glow, .hero__cta { display: none !important; }

  body { background: #fff; color: #000; font-size: 10.5pt; }

  .section { padding-block: 1.25rem; break-inside: avoid; }

  .tl-body { height: auto !important; }

  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
}
