/* =========================================================
   Upendra Sharma — Portfolio
   Swiss / International Typographic style
   Plain CSS. No build step. No dependencies.

   Contents
   01 Tokens
   02 Reset & base
   03 Layout primitives
   04 Typography helpers
   05 Buttons
   06 Header & navigation
   07 Hero
   08 Section chrome
   09 About
   10 Skills
   11 Experience
   12 Projects
   13 Education & certifications
   14 Contact
   15 Footer
   16 Motion
   17 Responsive
   18 Print
   ========================================================= */


/* ---------------------------------------------------------
   00 FONTS — self-hosted, no third-party requests
   Inter and JetBrains Mono, both SIL Open Font License.
   Licences are in assets/fonts/. font-display: swap renders
   text in the fallback immediately rather than blocking.
   --------------------------------------------------------- */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../assets/fonts/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}


/* ---------------------------------------------------------
   01 TOKENS
   --------------------------------------------------------- */
:root {
  /* Palette — light */
  --paper:        #FBFBF9;
  --paper-2:      #F2F2EE;
  --ink:          #14140F;
  --ink-2:        #4A4A44;
  --ink-3:        #78786F;
  --rule:         #DEDED7;
  --rule-strong:  #C6C6BD;
  --accent:       #C8321E;
  --accent-soft:  rgba(200, 50, 30, 0.09);
  --selection:    rgba(200, 50, 30, 0.16);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-micro: 0.6875rem;
  --fs-small: 0.8125rem;
  --fs-body:  1.0625rem;
  --fs-lead:  clamp(1.125rem, 1.6vw, 1.375rem);
  --fs-h3:    clamp(1.0625rem, 1.5vw, 1.25rem);
  --fs-h2:    clamp(1.875rem, 4.2vw, 3.25rem);
  --fs-hero:  clamp(2.625rem, 9.5vw, 7.5rem);

  --tracking-label: 0.14em;

  /* Space */
  --gutter: 1.5rem;
  --wrap-max: 1320px;
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.42s;

  color-scheme: light;
}

[data-theme="dark"] {
  --paper:        #0E0E0C;
  --paper-2:      #171714;
  --ink:          #F1F1EA;
  --ink-2:        #B4B4AB;
  --ink-3:        #85857B;
  --rule:         #2A2A25;
  --rule-strong:  #3D3D36;
  --accent:       #FF5C42;
  --accent-soft:  rgba(255, 92, 66, 0.13);
  --selection:    rgba(255, 92, 66, 0.24);

  color-scheme: dark;
}


/* ---------------------------------------------------------
   02 RESET & BASE
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1, 'cv05' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

::selection { background: var(--selection); }

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

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-size: var(--fs-small);
}
.skip-link:focus { left: 0; }

.noscript {
  padding: clamp(3rem, 8vw, 6rem) 0;
  border-bottom: 1px solid var(--rule);
}
.noscript h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.noscript p { color: var(--ink-2); max-width: 52ch; margin-bottom: 1.5rem; }
.noscript ul { display: grid; gap: 0.6rem; }
.noscript a {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  border-bottom: 1px solid var(--accent);
}


/* ---------------------------------------------------------
   03 LAYOUT PRIMITIVES
   --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--rule);
}

.section-body { margin-top: clamp(2rem, 4vw, 3.25rem); }


/* ---------------------------------------------------------
   04 TYPOGRAPHY HELPERS
   --------------------------------------------------------- */
.tick,
.sub-label,
.section-num,
.nav-list a,
.hero-eyebrow,
.detail-list dt,
.exp-period,
.proj-index,
.skill-group h3,
.footer-meta,
.cert-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.sub-label {
  color: var(--ink-3);
  padding-bottom: 0.875rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}


/* ---------------------------------------------------------
   05 BUTTONS
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--ink);
  transition: background-color 0.2s var(--ease),
              color 0.2s var(--ease),
              border-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: square;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

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


/* ---------------------------------------------------------
   06 HEADER & NAVIGATION
   --------------------------------------------------------- */
/* Opaque by default; the translucent blur is layered on only where the
   browser can actually blur, so older browsers never smear text. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.5rem;
}

.header-rule {
  height: 1px;
  background: var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}
.wordmark-mark {
  width: 11px; height: 11px;
  background: var(--accent);
  flex: none;
  transition: transform 0.3s var(--ease);
}
.wordmark:hover .wordmark-mark { transform: rotate(45deg); }

.nav-list { display: flex; gap: 2rem; }

.nav-list a {
  position: relative;
  color: var(--ink-3);
  font-weight: 500;
  padding-block: 0.35rem;
  transition: color 0.2s var(--ease);
}
.nav-list a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav-list a:hover { color: var(--ink); }
.nav-list a.is-active { color: var(--ink); }
.nav-list a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.375rem; height: 2.375rem;
  border: 1px solid var(--rule-strong);
  color: var(--ink-2);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round;
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.menu-toggle {
  display: none;
  width: 2.375rem; height: 2.375rem;
  place-items: center;
  border: 1px solid var(--rule-strong);
}
.menu-toggle span {
  display: block;
  width: 17px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle span + span { margin-top: 4px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(2.75px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child  { transform: translateY(-2.75px) rotate(-45deg); }


/* ---------------------------------------------------------
   07 HERO
   --------------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 8vw, 7rem) clamp(2.5rem, 5vw, 4rem); }

.hero-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 15rem;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
/* Explicit placement rather than relying on source order. */
.hero-meta  { grid-column: 1; }
.hero-body  { grid-column: 2; }
.hero-facts { grid-column: 3; }

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--ink-3);
  padding-top: 0.9rem;
  border-top: 2px solid var(--ink);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}

.hero-name {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 1.125rem;
}

.hero-role {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-lead);
  font-weight: 500;
  color: var(--ink-2);
  min-height: 1.9em;
  margin-bottom: 1.5rem;
}
.hero-cursor {
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  animation: blink 1.05s steps(2, start) infinite;
}

.hero-summary {
  max-width: 54ch;
  color: var(--ink-2);
  font-size: var(--fs-lead);
  line-height: 1.55;
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.875rem; }

.hero-facts { padding-top: 0.9rem; border-top: 2px solid var(--ink); }
.hero-facts dl { display: grid; gap: 1.375rem; }
.hero-facts dt {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}
.hero-facts dd { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.25rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--ink-3);
  transition: color 0.2s var(--ease);
}
.hero-links a::before { content: '↗'; color: var(--accent); font-size: 0.9em; }
.hero-links a:hover { color: var(--ink); }


/* ---------------------------------------------------------
   08 SECTION CHROME
   --------------------------------------------------------- */
.section-head {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: baseline;
}

.section-num {
  color: var(--accent);
  font-weight: 500;
  padding-top: 0.75rem;
  border-top: 2px solid var(--accent);
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.02;
}


/* ---------------------------------------------------------
   09 ABOUT
   --------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 19rem;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.about-grid > .about-prose { grid-column: 2; }

.about-prose p {
  font-size: var(--fs-lead);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 62ch;
}
.about-prose p + p { margin-top: 1.4rem; }
.about-prose strong { color: var(--ink); font-weight: 600; }

.portrait { margin-bottom: 1.75rem; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.portrait-fallback {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-align: center;
  padding: 1rem;
}

.detail-list { display: grid; gap: 1.125rem; }
.detail-list > div { padding-bottom: 1.125rem; border-bottom: 1px solid var(--rule); }
.detail-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-list dt { color: var(--ink-3); margin-bottom: 0.25rem; }
.detail-list dd { font-size: 0.9375rem; font-weight: 500; }
.detail-list a { border-bottom: 1px solid var(--rule-strong); }
.detail-list a:hover { color: var(--accent); border-color: var(--accent); }


/* ---------------------------------------------------------
   10 SKILLS
   --------------------------------------------------------- */
/* Fixed 3 columns rather than auto-fit: the 1px gap shows the container
   background, so a half-filled final row would render as empty dark cells.
   Three columns keeps any multiple of 3 groups perfectly filled. */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.skill-group {
  background: var(--paper);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  transition: background-color 0.25s var(--ease);
}
.skill-group:hover { background: var(--paper-2); }

/* A group left alone on the final row stretches across it, so group counts
   that are not a multiple of the column count still leave no empty cells. */
.skill-group:last-child:nth-child(3n+2) { grid-column: span 2; }
.skill-group:last-child:nth-child(3n+1) { grid-column: span 3; }
@media (max-width: 900px) {
  .skill-group:last-child:nth-child(n)   { grid-column: auto; }
  .skill-group:last-child:nth-child(odd) { grid-column: span 2; }
}
@media (max-width: 560px) {
  .skill-group:last-child:nth-child(odd) { grid-column: auto; }
}

.skill-group h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 1.375rem;
}
.skill-group h3::before {
  content: attr(data-num);
  color: var(--accent);
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tags li {
  padding: 0.4rem 0.75rem;
  font-size: var(--fs-small);
  font-weight: 500;
  border: 1px solid var(--rule-strong);
  transition: border-color 0.2s var(--ease),
              color 0.2s var(--ease),
              background-color 0.2s var(--ease);
}
.skill-tags li:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}


/* ---------------------------------------------------------
   11 EXPERIENCE
   --------------------------------------------------------- */
.exp-list { display: grid; }

.exp-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 19rem;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-block: clamp(1.75rem, 3vw, 2.75rem);
  border-top: 1px solid var(--rule);
  transition: background-color 0.25s var(--ease);
}
.exp-item:first-child { border-top: 0; }
.exp-item:hover { background: var(--paper-2); }

.exp-period { color: var(--ink-3); font-weight: 500; padding-top: 0.4rem; }

.exp-role {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.012em;
  margin-bottom: 0.35rem;
}
.exp-company {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.125rem;
}
.exp-company .exp-location { color: var(--ink-3); font-weight: 400; }

.exp-points { display: grid; gap: 0.6rem; max-width: 62ch; }
.exp-points li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--ink-2);
  font-size: 0.9688rem;
  line-height: 1.58;
}
.exp-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.68em;
  width: 8px; height: 1px;
  background: var(--rule-strong);
}

/* align-items/content keep the pills at their natural height — without them
   the flex items stretch to fill the grid cell and render as tall boxes. */
.exp-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.4rem;
  padding-top: 0.4rem;
}
.exp-stack li {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 0.28rem 0.55rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.exp-item:hover .exp-stack li { background: var(--paper); }


/* ---------------------------------------------------------
   12 PROJECTS
   --------------------------------------------------------- */
/* Fixed 2 columns, same reasoning as the skills grid: auto-fit left empty
   dark cells whenever the card count did not fill the last row. An odd
   final card spans the full row. */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.proj-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  background: var(--paper);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  transition: background-color 0.25s var(--ease);
}
.proj-card:hover { background: var(--paper-2); }
.proj-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.proj-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--rule);
}
.proj-index { color: var(--accent); font-weight: 500; }
.proj-year { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--ink-3); }

.proj-name {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.012em;
}
.proj-desc {
  color: var(--ink-2);
  font-size: 0.9688rem;
  line-height: 1.58;
  flex: 1;
}
.proj-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.proj-stack li {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--rule);
}

.proj-links {
  display: flex;
  gap: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
}
.proj-links a {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.2s var(--ease);
}
.proj-links a:hover { color: var(--accent); }


/* ---------------------------------------------------------
   13 EDUCATION & CERTIFICATIONS
   --------------------------------------------------------- */
.edu-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3.5rem);
}
.edu-grid > div:first-child { grid-column: 2; }

.edu-list { display: grid; gap: 1.75rem; }
.edu-item { display: grid; gap: 0.3rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--rule); }
.edu-list .edu-item:last-child { border-bottom: 0; padding-bottom: 0; }
.edu-degree { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.edu-school { color: var(--ink-2); font-size: 0.9375rem; }
.edu-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.25rem;
}

.cert-list { display: grid; gap: 1rem; }
.cert-item {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  transition: background-color 0.25s var(--ease);
}
.cert-item:hover { background: var(--paper-2); }
.cert-name { font-weight: 600; font-size: 0.9688rem; }
.cert-meta { color: var(--ink-3); font-weight: 500; }
.cert-item a.cert-name:hover { color: var(--accent); }


/* ---------------------------------------------------------
   14 CONTACT
   --------------------------------------------------------- */
.section-contact { background: var(--paper-2); }

.contact-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 19rem;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.contact-grid > .contact-lead { grid-column: 2; }

.contact-pitch {
  font-size: var(--fs-lead);
  color: var(--ink-2);
  line-height: 1.58;
  max-width: 52ch;
  margin-bottom: 2rem;
}

.contact-email {
  display: inline-block;
  font-size: clamp(1.375rem, 3.6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.15;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--rule-strong);
  word-break: break-word;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }

.contact-note {
  margin-top: 1.125rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--ink-3);
}

/* ---- Contact form (rendered only when a Formspree ID is set) ---- */
.contact-form { display: grid; gap: 1.25rem; max-width: 34rem; }

.contact-form .field { display: grid; gap: 0.45rem; }

.contact-form label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 0.75rem 0.875rem;
  width: 100%;
  transition: border-color 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea { resize: vertical; min-height: 7rem; }

.contact-form input:hover,
.contact-form textarea:hover { border-color: var(--ink-3); }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); outline: none; }

.contact-form button { justify-self: start; }
.contact-form button[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.form-status {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  min-height: 1.25rem;
  margin: 0;
}
.form-status[data-state="pending"] { color: var(--ink-3); }
.form-status[data-state="ok"]      { color: var(--accent); }
.form-status[data-state="error"]   { color: var(--accent); }

.contact-links { display: grid; gap: 0; }
.contact-links li { border-bottom: 1px solid var(--rule); }
.contact-links li:first-child { border-top: 1px solid var(--rule); }
.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.95rem;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--ink-2);
  transition: color 0.2s var(--ease), padding-inline 0.25s var(--ease);
}
.contact-links a::after { content: '→'; color: var(--accent); }
.contact-links a:hover { color: var(--ink); padding-inline: 0.4rem 0; }


/* ---------------------------------------------------------
   15 FOOTER
   --------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2.25rem; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-name { font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; }
.footer-meta { color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0.04em; }
.footer-top {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.2s var(--ease);
}
.footer-top:hover { color: var(--accent); }


/* ---------------------------------------------------------
   16 MOTION
   --------------------------------------------------------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* ---------------------------------------------------------
   17 RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid,
  .about-grid,
  .exp-item,
  .contact-grid { grid-template-columns: 6rem minmax(0, 1fr); }

  .hero-facts,
  .about-side,
  .exp-stack { grid-column: 2; }

  .hero-facts,
  .about-side { border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 0.5rem; }
  .hero-facts dl { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }

  .about-side { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; align-items: start; }
  .portrait { margin-bottom: 0; }

  .edu-grid { grid-template-columns: 6rem minmax(0, 1fr); }
  .edu-grid > div { grid-column: 2; }
  .edu-grid > div + div { margin-top: 2.5rem; }
}

@media (max-width: 780px) {
  :root { --gutter: 1.25rem; }

  .nav {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s var(--ease);
  }
  .nav.is-open { max-height: 26rem; }
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
  }
  .nav-list li { border-bottom: 1px solid var(--rule); }
  .nav-list a { display: block; padding-block: 0.95rem; font-size: var(--fs-small); }
  .nav-list a::after { display: none; }
  .nav-list a.is-active { color: var(--accent); }

  .menu-toggle { display: grid; }

  .hero-grid,
  .section-head,
  .about-grid,
  .exp-item,
  .edu-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }

  .hero-meta { flex-direction: row; gap: 1.25rem; }
  .about-grid > .about-prose,
  .edu-grid > div,
  .contact-grid > .contact-lead,
  .hero-meta,
  .hero-body,
  .hero-facts,
  .about-side,
  .exp-stack { grid-column: 1; }

  .about-side { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 15rem; }

  .exp-item { gap: 0.875rem; }
  .exp-period { padding-top: 0; }

  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero-links { gap: 0 1.5rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

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

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


/* ---------------------------------------------------------
   18 PRINT
   --------------------------------------------------------- */
@media print {
  .site-header, .hero-actions, .theme-toggle, .menu-toggle,
  .footer-top, .skip-link, .portrait { display: none !important; }

  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section { padding-block: 1.25rem; break-inside: avoid; }
  .exp-item, .proj-card, .cert-item, .edu-item { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
  .contact-email { font-size: 14pt; }
}
