html {
  font-size: 16px; /* sole px anchor — do not change */
}

:root {
  /* Colour */
  --ink:    #1A1A14;
  --ground: #F5F2EE;
  --stone:  #8A8678;
  --amber:  #C8882A;
  --forest: #1E4A35;
  --rule:   #D6D0C4;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Type scale — rem */
  --text-display:           6rem;
  --text-display-mobile:    3.25rem;
  --text-post-title:        3rem;
  --text-post-title-mobile: 2rem;
  --text-section-label:     0.8125rem;
  --text-section-heading:   1.0625rem;
  --text-writing-title:     1.375rem;
  --text-h2:                1.625rem;
  --text-body-lg:           1.125rem;
  --text-body:              1rem;
  --text-meta:              0.6875rem;
  --text-xs:                0.6875rem;
  --text-cta:               0.75rem;
  --text-logo:              1.35rem;
  --text-logo-sep:          1.2rem;
  --text-logo-initials:     0.825rem;

  /* Spacing — rem */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-6:  3rem;
  --space-8:  4rem;
  --space-10: 5rem;
  --space-lg: 3rem;
  --space-md: 1.5rem;
  --space-xl: 4rem;

  /* Layout */
  --container-max:      76rem;
  --container-readable: 44rem;
  --margin-outer:       clamp(1.25rem, 4vw, 4rem);
  --hero-portrait-max:  18.48rem;
}

/* ============================================================= */
/* Container shells — backgrounds full-bleed, content contained  */
/* ============================================================= */
.page-shell {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--margin-outer);
}

.article-shell {
  max-width: var(--container-readable);
  margin-inline: auto;
  padding-inline: var(--margin-outer);
}

.wide-figure {
  max-width: var(--container-max);
  margin-inline: auto;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

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

/* Dark mode — minimal swap */
body.dark {
  --ground: #1A1A14;
  --ink:    #F5F2EE;
}

/* ============================================================= */
/* Shared section primitives                                     */
/* ============================================================= */
.section {
  padding-block: var(--space-8);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-section-heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Inline text CTAs — amber throughout */
.text-cta {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

@media (prefers-reduced-motion: no-preference) {
  .text-cta { transition: color 150ms ease; }
}

.text-cta:hover {
  color: var(--ink);
}

/* Section break between major home sections — line aligns with content */
.section-rule {
  margin-block: var(--space-4);
}

.section-rule__line {
  display: block;
  height: 1px;
  background: var(--ink);
  opacity: 0.15;
}

/* ============================================================= */
/* Navigation                                                    */
/* ============================================================= */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.nav__logo {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.nav__logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-logo);
  color: var(--ink);
}

.nav__logo-sep {
  font-family: var(--font-body);
  font-size: var(--text-logo-sep);
  color: var(--stone);
  margin: 0 0.3em;
}

.nav__logo-initials {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-logo-initials);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  padding-bottom: 0.25em;
  border-bottom: 1px solid transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .nav__link { transition: color 150ms ease; }
}

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

.nav__link.is-active {
  color: var(--ink);
  border-bottom: 1px solid var(--amber);
}

.nav__toggle {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--stone);
  cursor: pointer;
  padding: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nav__toggle { transition: color 150ms ease; }
}

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

/* Hamburger — hidden on desktop */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.5rem;
  height: 1rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 0;
  border-top: 1px solid var(--ink);
}

/* ============================================================= */
/* Buttons                                                       */
/* ============================================================= */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.875em 1.75em;
  border-radius: 0;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 150ms ease, color 150ms ease; }
}

.btn--primary {
  background: var(--amber);
  color: var(--ground);
  border: none;
}

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

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

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

/* ============================================================= */
/* Hero                                                          */
/* ============================================================= */
.hero {
  display: grid;
  grid-template-columns: 58fr 42fr;
  align-items: start;
  gap: var(--space-8);
  padding-bottom: 0;
}

.hero__left {
  padding-block: var(--space-10) 0;
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(var(--text-display-mobile), 6vw + 1rem, var(--text-display));
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.hero__rule {
  width: 3rem;
  height: 2px;
  background: var(--amber);
  border: none;
  margin: var(--space-3) 0;
}

.hero__role {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-section-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 var(--space-3);
}

.hero__tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 var(--space-3);
  max-width: 28rem;
}

.hero__body {
  font-size: var(--text-body);
  color: var(--stone);
  line-height: 1.65;
  max-width: 30rem;
  margin: 0 0 var(--space-4);
}

.hero__body p {
  margin: 0 0 var(--space-3);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero__career-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero__about {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding-top: var(--space-10);
}

/* Border lives on the frame wrapper, padded off the image — never on the img */
.hero__portrait-frame {
  display: block;
  width: 100%;
  max-width: var(--hero-portrait-max);
  aspect-ratio: 3 / 4;
  padding: var(--space-2);
  border: 1px solid var(--rule);
}

.hero__portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ============================================================= */
/* Journey-principles (merged journey band + guiding principles) */
/* ============================================================= */
.journey-principles {
  padding-block: 0;
}

.journey-principles__header {
  margin-bottom: var(--space-6);
}

.journey-principles__arc {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--text-body-lg);
  color: var(--stone);
  margin-top: var(--space-1);
}

.journey-principles__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.journey-principles__item {
  display: flex;
  flex-direction: column;
}

.journey-principles__img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.journey-principles__principle {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-section-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: var(--space-3);
}

.journey-principles__description {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  color: var(--stone);
  line-height: 1.5;
  margin: var(--space-sm) 0 0;
}

.journey-principles__place {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: var(--space-xs);
}

/* ============================================================= */
/* Recent writing                                                */
/* ============================================================= */
.writing {
  padding-top: 0;
}

.writing-row {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--rule);
  border-left: 2px solid transparent;
}

.writing .writing-row:last-of-type {
  border-bottom: 1px solid var(--rule);
}

@media (prefers-reduced-motion: no-preference) {
  .writing-row { transition: border-color 150ms ease; }
  .writing-row__title { transition: color 150ms ease; }
}

.writing-row:hover {
  border-left: 2px solid var(--forest);
}

.writing-row:hover .writing-row__title {
  color: var(--forest);
}

.writing-row__date {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--stone);
}

.writing-row__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-writing-title);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 var(--space-1);
}

.writing-row__abstract {
  font-size: var(--text-body);
  color: var(--stone);
  margin: 0;
  max-width: 44rem;
}

.writing-row__cta {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .writing-row__cta { transition: color 150ms ease; }
}

.writing-row:hover .writing-row__cta {
  color: var(--ink);
}

/* ============================================================= */
/* Things I build                                                */
/* ============================================================= */
.things-i-build {
  padding-top: 0;
}

.things-i-build-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-xl);
}

.things-i-build-card {
  min-width: 0;
}

.things-i-build-card__rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--stone);
  opacity: 0.3;
  margin-bottom: var(--space-sm);
}

.things-i-build-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.things-i-build-card__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-section-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: var(--space-md) 0 0;
}

.things-i-build-card__description {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--stone);
  margin: var(--space-sm) 0 0;
}

.things-i-build-card__links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.things-i-build-card__links a {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

@media (prefers-reduced-motion: no-preference) {
  .things-i-build-card__links a { transition: color 150ms ease; }
}

.things-i-build-card__links a:hover {
  color: var(--ink);
}

/* ============================================================= */
/* Experience                                                    */
/* ============================================================= */
/* Career highlights — brand names only, no dates, no titles */
.career-highlights {
  margin-top: var(--space-4);
}

.career-highlights__group {
  margin-bottom: var(--space-4);
}

.career-highlights__label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: var(--space-1);
}

.career-highlights__current {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-body);
  color: var(--ink);
}

.career-highlights__list {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  color: var(--stone);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================= */
/* Footer                                                        */
/* ============================================================= */
.footer {
  background: var(--ink);
}

.footer__inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
  flex-wrap: wrap;
}

.footer__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-logo);
  color: var(--ground);
}

.footer__copy {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem;
  color: rgba(242, 237, 228, 0.5);
}

.footer__links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(242, 237, 228, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  .footer__link { transition: color 150ms ease; }
}

.footer__link:hover {
  color: var(--ground);
}

/* ============================================================= */
/* Post layout                                                   */
/* ============================================================= */
.post {
  padding-block: var(--space-8);
}

.post-header {
  margin-bottom: var(--space-6);
}

.post-back {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: var(--space-4);
}

@media (prefers-reduced-motion: no-preference) {
  .post-back { transition: color 150ms ease; }
}

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

.post-header__date {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--stone);
  display: block;
  margin-bottom: var(--space-2);
}

.post-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-post-title);
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

.post-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-body-lg);
  color: var(--stone);
  margin: 0 0 var(--space-4);
}

.post-header__rule {
  width: 2rem;
  height: 1px;
  background: var(--rule);
  border: none;
  margin: var(--space-4) 0;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 0.8;
  float: left;
  margin-right: 0.1em;
  color: var(--ink);
}

.post-body p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  color: var(--ink);
  line-height: 1.75;
  margin: 0 0 var(--space-3);
}

.post-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  color: var(--ink);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.post-body h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-body-lg);
  color: var(--ink);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.post-body a {
  color: var(--amber);
}

@media (prefers-reduced-motion: no-preference) {
  .post-body a { transition: color 150ms ease; }
}

.post-body a:hover {
  color: var(--ink);
}

.post-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-6) 0;
}

.post-body blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-3);
  border-left: 1px solid var(--rule);
  font-style: italic;
  color: var(--stone);
}

.post-diagram {
  border: 1px solid var(--rule);
  padding: var(--space-4);
  margin: var(--space-6) 0;
}

/* Post footer — prev/next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: var(--space-8);
  border-top: 1px solid var(--rule);
}

.post-nav__item {
  padding: var(--space-4) var(--space-4);
}

.post-nav__item--next {
  border-left: 1px solid var(--rule);
  text-align: right;
}

.post-nav__label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-cta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: var(--space-1);
}

.post-nav__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .post-nav__title { transition: color 150ms ease; }
}

.post-nav__item:hover .post-nav__title {
  color: var(--amber);
}

/* ============================================================= */
/* Responsive — Tablet (48rem–74.9rem)                           */
/* ============================================================= */
@media (max-width: 74.9375rem) {
  .hero__left,
  .hero__about {
    padding-block: var(--space-8) 0;
  }

  /* Journey-principles: two columns, two rows */
  .journey-principles__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================= */
/* Responsive — Mobile (<48rem)                                  */
/* ============================================================= */
@media (max-width: 47.9375rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-bottom: 0;
  }

  .hero__name {
    letter-spacing: 0;
  }

  /* Collapse the hero: tighter vertical rhythm on small screens */
  .hero__left {
    padding-block: var(--space-4) 0;
  }

  .hero__about {
    padding-top: 0;
  }

  /* Mobile nav: hamburger toggles the link list */
  .nav__hamburger {
    display: flex;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 3.5rem;
    right: var(--margin-outer);
    left: var(--margin-outer);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    background: var(--ground);
    padding: var(--space-3);
    border: 1px solid var(--rule);
    z-index: 10;
  }

  .nav__links.is-open {
    display: flex;
  }

  .nav {
    position: relative;
  }

  /* Writing rows stack */
  .writing-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .writing-row__cta {
    justify-self: start;
  }

  .things-i-build-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-lg);
  }

  /* Journey-principles: single column stacked */
  .journey-principles__grid {
    grid-template-columns: 1fr;
  }

  .journey-principles {
    padding-block: 0;
  }

  /* Post prev/next stack */
  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__item--next {
    border-left: none;
    border-top: 1px solid var(--rule);
    text-align: left;
  }

  /* Footer stacks */
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
