/* =============================================================================
   andradei.com — design system
   -----------------------------------------------------------------------------
   1.  Fonts
   2.  Tokens (color, type, space) + theme switching
   3.  Reset & base
   4.  Layout primitives
   5.  Header / nav / theme toggle
   6.  Buttons & links
   7.  Sections
   8.  Cards
   9.  Timeline
   10. Gallery
   11. Footer
   12. Blog
   13. Resume
   14. Utilities
   15. Print
   ========================================================================== */

/* 1. Fonts ----------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("font/inter/InterVariable.woff2") format("woff2");
}

@font-face {
  font-family: "Google Sans Code";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("font/google-sans-code/GoogleSansCode-VariableFont_wght.ttf")
    format("truetype");
}

/* 2. Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* palette — light */
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --bg-inset: #eef0f4;
  --surface: #ffffff;
  --ink: #16191f;
  --ink-muted: #545d6c;
  --ink-faint: #838d9c;
  --rule: #e4e7ec;
  --rule-strong: #d3d8e0;
  --accent: #a8501d;
  --accent-strong: #8c4115;
  --accent-soft: #fdf1e8;
  --accent-ink: #8c4115;
  --shadow-sm: 0 1px 2px rgb(16 20 28 / 0.05);
  --shadow-md: 0 1px 3px rgb(16 20 28 / 0.06), 0 8px 24px rgb(16 20 28 / 0.05);
  --shadow-lg: 0 2px 6px rgb(16 20 28 / 0.06), 0 18px 48px rgb(16 20 28 / 0.1);
  --selection: #f6dcc8;

  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Google Sans Code", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.83rem);
  --step-0: clamp(0.94rem, 0.91rem + 0.15vw, 1rem);
  --step-1: clamp(1.06rem, 1rem + 0.28vw, 1.19rem);
  --step-2: clamp(1.25rem, 1.16rem + 0.44vw, 1.5rem);
  --step-3: clamp(1.5rem, 1.34rem + 0.78vw, 2rem);
  --step-4: clamp(1.85rem, 1.55rem + 1.45vw, 2.75rem);
  --step-5: clamp(2.3rem, 1.75rem + 2.7vw, 3.9rem);

  /* space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --measure: 68ch;
  --page: 74rem;
  --radius: 10px;
  --radius-lg: 16px;
  --header-h: 4rem;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1116;
  --bg-subtle: #14181f;
  --bg-inset: #1a1f28;
  --surface: #151a21;
  --ink: #e7eaef;
  --ink-muted: #9aa4b2;
  --ink-faint: #737e8d;
  --rule: #232932;
  --rule-strong: #2f3641;
  --accent: #e08b52;
  --accent-strong: #efa26b;
  --accent-soft: #241a12;
  --accent-ink: #e9a274;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.45), 0 18px 48px rgb(0 0 0 / 0.5);
  --selection: #4a2d18;
}

/* 3. Reset & base ---------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "cv08" 1, "ss03" 1;
  text-rendering: optimizeLegibility;
}

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

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

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

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--sp-4);
}

/* 4. Layout primitives ----------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

main {
  display: block;
}

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

/* 5. Header / nav / theme toggle ------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin-right: auto;
  text-decoration: none;
  color: inherit;
  line-height: 1.2;
}

.brand__name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand__role {
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__link {
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav__link:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.nav__link[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* theme toggle ------------------------------------------------------------ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.theme-toggle__btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle__btn:hover {
  color: var(--ink);
}

.theme-toggle__btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.theme-toggle__btn svg {
  width: 15px;
  height: 15px;
}

/* mobile menu ------------------------------------------------------------- */

.menu-btn {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.menu-btn svg {
  width: 18px;
  height: 18px;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--rule);
  background: var(--bg);
  padding: var(--sp-3) 0 var(--sp-4);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
}

.mobile-nav__link {
  display: block;
  padding: 0.6rem 0.25rem;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.mobile-nav__list li:last-child .mobile-nav__link {
  border-bottom: 0;
}

@media (max-width: 719px) {
  .nav {
    display: none;
  }
  .menu-btn {
    display: grid;
  }
  .brand__role {
    display: none;
  }
}

/* 6. Buttons & links ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.15s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
}

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

.btn--ghost {
  background: var(--surface);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink-faint);
  background: var(--bg-subtle);
}

.btn svg {
  width: 1em;
  height: 1em;
}

a {
  color: var(--accent-ink);
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

.link-plain {
  color: inherit;
  text-decoration: none;
}

.link-plain:hover {
  color: var(--accent-ink);
}

/* 7. Sections ------------------------------------------------------------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

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

.section--flush {
  padding-block: 0;
}

.section__head {
  max-width: var(--measure);
  margin-bottom: var(--sp-6);
}

.eyebrow {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section__title {
  font-size: var(--step-3);
}

.section__intro {
  margin-top: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--step-1);
  line-height: 1.6;
}

/* 8. Cards ---------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__title {
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}

.card__body {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.card__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.card__list li {
  position: relative;
  padding-left: 1.05rem;
}

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

.card__foot {
  margin-top: auto;
  padding-top: var(--sp-2);
  font-size: 0.88rem;
  font-weight: 550;
}

.card__foot::after {
  content: " →";
}

/* 9. Timeline ------------------------------------------------------------- */

.roles {
  display: grid;
  gap: var(--sp-6);
  list-style: none;
  padding: 0;
}

.job {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: var(--sp-5);
}

@media (max-width: 800px) {
  .job {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }
}

.job__when {
  color: var(--ink-faint);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  padding-top: 0.2rem;
}

.job__when span {
  display: block;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

.job__role {
  font-size: var(--step-2);
  letter-spacing: -0.015em;
}

.job__org {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.job__points {
  margin-top: var(--sp-4);
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.job__points li {
  position: relative;
  padding-left: 1.05rem;
}

.job__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--rule-strong);
}

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

/* 10. Gallery ------------------------------------------------------------- */
/* The "not software" gallery was removed — the site is about the software
   career only. The images are kept outside the publish directory in
   docs/images/ in case the section ever comes back. */

/* 11. Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-subtle);
  padding-block: var(--sp-6);
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-left: auto;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* 12. Blog ---------------------------------------------------------------- */

.post-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--sp-4);
}

.post {
  display: grid;
  gap: 0.35rem;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
}

.post:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.post__meta {
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.post__title {
  font-size: var(--step-2);
}

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

.post__title a:hover {
  color: var(--accent-ink);
}

.post__excerpt {
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: var(--measure);
}

.empty-state {
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-muted);
}

.empty-state strong {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--ink);
  font-size: var(--step-1);
}

.prose {
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2em;
  font-size: var(--step-2);
}

.prose h3 {
  margin-top: 1.6em;
  font-size: var(--step-1);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose blockquote {
  padding-left: 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--ink-muted);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-inset);
  padding: 0.12em 0.36em;
  border-radius: 4px;
}

.prose pre {
  overflow-x: auto;
  padding: var(--sp-4);
  background: var(--bg-inset);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.86rem;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

.prose hr {
  height: 1px;
  border: 0;
  background: var(--rule);
  margin-block: 2.5em;
}

/* A post's banner, from the "image:" key in the post's front matter. It
 * spans the article column and dissolves into the page at the bottom, so
 * the content reads as a continuation of the image rather than something
 * that starts underneath it. */
.article-banner {
  max-width: var(--measure);
  margin-bottom: var(--sp-4);
  /* --measure is 68ch, and ch is resolved against the element's own
   * font-size. The banner inherits the body's type size, so its 68ch
   * would be narrower than the prose's. Setting the prose's size here
   * makes the three widths one number. The banner holds only an image,
   * so the font size has no other effect. */
  font-size: var(--step-1);
}

.article-banner img {
  width: 100%;
  height: auto;
  /* No frame, and no radius at the bottom: the top corners are rounded
   * like the cards, and the bottom edge fades away instead of ending. */
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  /* The fade is a mask, not a coloured overlay, so the photo dissolves
   * into whatever the page background is — light or dark, no extra rule.
   * It finishes before the image's own edge, so there is no hard cut
   * where the bitmap ends. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0 64%, transparent 93%);
  mask-image: linear-gradient(to bottom, #000 0 64%, transparent 93%);
}

/* The title rises into the tail of the fade, so the content starts where
 * the image has already dissolved rather than below a gap. */
.article-banner + .article-head {
  margin-top: -1.5rem;
}

.article-head {
  max-width: var(--measure);
  margin-bottom: var(--sp-6);
  /* Same as the banner: the measure is in ch, so the head has to measure
   * it against the prose's font size to come out the same width. The
   * title sets its own size, and the meta below is pinned to the body
   * size, so nothing about the text changes. */
  font-size: var(--step-1);
}

.article-head__title {
  font-size: var(--step-4);
}

.article-head__meta {
  margin-top: var(--sp-3);
  color: var(--ink-faint);
  font-size: 0.88rem;
}

/* The tags sit under the date, on their own line. */
.article-head__tags {
  margin-top: var(--sp-2);
  color: var(--ink-faint);
  font-size: 0.88rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--sp-5);
  color: var(--ink-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

/* The arrow on the back link. It is sized in em, so it tracks the text,
 * and it is kept from shrinking in the flex row. */
.back-link__icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.back-link:hover {
  color: var(--accent-ink);
}

/* 13. Resume -------------------------------------------------------------- */

.resume-layout {
  display: grid;
  gap: var(--sp-6);
  align-items: start;
}

.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  color: var(--ink-muted);
  font-size: 0.88rem;
}

/* The published toolbar holds only the two buttons. It is sized and centred
 * on the same column as the page below it, so the buttons sit in the middle
 * of the resume rather than drifting to the edge of the wide container. */
.resume-toolbar--actions {
  width: 8.5in;
  max-width: 100%;
  margin-inline: auto;
  justify-content: center;
}

/* The same two buttons again, under the resume, so the actions are still
 * reachable once the reader has scrolled past them. */
.resume-toolbar--footer {
  margin-top: var(--sp-5);
  margin-bottom: 0;
}

.page {
  width: 8.5in;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.62in 0.7in;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  line-height: 1.55;
}

.page h1 {
  font-size: 23px;
  margin-bottom: 0.15rem;
}

.page h1 + p {
  margin-bottom: 0.4rem;
}

.page h2 {
  margin: 1.05rem 0 0.45rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page h3 {
  margin: 1rem 0 0.1rem;
  font-size: 15px;
}

.page h3 + p {
  margin-bottom: 0.45rem;
}

.page h3 + p em {
  color: var(--ink-muted);
  font-style: normal;
  font-size: 12.5px;
}

.page p {
  margin-bottom: 0.5rem;
}

.page hr {
  height: 1px;
  border: 0;
  background: var(--rule);
  margin: 1rem 0;
}

.page ul {
  margin: 0.15rem 0 0.7rem;
  padding-left: 1.1rem;
}

.page li {
  margin-bottom: 0.3rem;
}

.page li::marker {
  color: var(--accent);
}

.page strong {
  font-weight: 650;
}

.page a {
  color: var(--accent-ink);
  text-decoration: none;
}

.page a:hover {
  text-decoration: underline;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.page th,
.page td {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  text-align: left;
}

.page th {
  background: var(--bg-subtle);
}

/* On a phone the paper needs to give the text back its width: the print
   padding (0.7in a side) would leave a 256px column on a 390px screen. */
@media (max-width: 700px) {
  .page {
    padding: 1.5rem 1.25rem;
    font-size: 14.5px;
  }
  .page h1 {
    font-size: 21px;
  }
  .page h2 {
    font-size: 11px;
  }
  .page h3 {
    font-size: 14.5px;
  }
}

/* 14. Utilities ----------------------------------------------------------- */

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

.stack > * + * {
  margin-top: var(--sp-4);
}

.muted {
  color: var(--ink-muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 9vw, 7rem) clamp(2.5rem, 6vw, 5rem);
}

.hero__portrait {
  margin: 0;
  min-width: 0; /* a grid item's default min-width is its content size */
  justify-self: end;
}

.hero__portrait img {
  width: 100%;
  height: auto; /* the width/height attributes must not fix the height */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .hero__portrait {
    order: -1;
    justify-self: center;
    width: 160px;
  }
  .hero__portrait img {
    aspect-ratio: 1 / 1;
    object-position: 50% 0%; /* square crop from the top: head and shoulders */
    border-radius: var(--radius-lg); /* rounded square, not a circle */
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-bottom: var(--sp-4);
}

.hero__eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  font-size: var(--step-5);
  letter-spacing: -0.035em;
}

.hero__role {
  margin-top: var(--sp-3);
  color: var(--ink);
  font-size: var(--step-2);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.hero__intro {
  margin-top: var(--sp-4);
  max-width: 56ch;
  color: var(--ink-muted);
  font-size: var(--step-1);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.hero__meta a {
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero__meta a:hover {
  color: var(--accent-ink);
}

.hero__meta svg {
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
}

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

.contact-panel {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-align: center;
  justify-items: center;
}

.contact-panel__email {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.015em;
  word-break: break-word;
}

/* 15. Print ---------------------------------------------------------------- */

@media print {
  /* Paper is paper: neutralise the dark theme so a dark-mode page still
     prints as dark ink on white. */
  :root,
  [data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-subtle: #ffffff;
    --bg-inset: #f4f5f7;
    --surface: #ffffff;
    --ink: #16191f;
    --ink-muted: #454c57;
    --ink-faint: #6b7381;
    --rule: #d9dde5;
    --rule-strong: #c3c9d3;
    --accent: #8c4115;
    --accent-strong: #8c4115;
    --accent-soft: #faf3ee;
    --accent-ink: #8c4115;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  .site-header,
  .site-footer,
  .resume-toolbar,
  .skip-link,
  .mobile-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
