/* Layout and components. Values come from tokens.css; avoid raw colors here. */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }

p { margin: 0 0 var(--space-4); max-width: var(--measure); }

a { color: var(--color-accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent-hover); text-decoration-thickness: 2px; }

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

/* Section targets clear the sticky header when jumped to */
:target, section[id] { scroll-margin-top: 8rem; }      /* header wraps to 3 lines on phones */
@media (min-width: 48rem) {
  :target, section[id] { scroll-margin-top: var(--space-8); }
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Skip link: hidden until focused */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-4); }
.skip-link:focus-visible { outline-color: var(--color-focus); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-3);
}
.site-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  text-decoration: none;
}
.site-name:hover { color: var(--color-text); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding-block: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--color-accent); text-decoration: underline; }

/* Hero: full-screen split on wider screens. Left: eyebrow, name, intro,
   buttons. Right: headshot behind a thin vertical divider. */
.hero { padding-block: var(--space-7) var(--space-8); }
.hero__inner { display: grid; gap: var(--space-6); align-items: center; }
.hero__tagline {
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-highlight);
}
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: var(--space-5);
}
.hero__lead { font-size: var(--text-lg); }

/* Headshot: small and above the intro on phones, beside it on wider screens.
   Framed with a thin Pine border and a Paper gap. */
.hero__photo { margin: 0; order: -1; }
.hero__photo img {
  display: block;
  width: 100%;
  max-width: 8rem;
  height: auto;                          /* keeps the photo's own proportions */
  padding: 4px;                          /* Paper "mat" between photo and border */
  background: var(--color-bg);
  border: 2px solid var(--color-accent); /* thin Pine frame */
  border-radius: calc(var(--radius) + 4px);
}
@media (min-width: 48rem) {
  .hero {
    display: grid;
    align-items: center;
    min-height: calc(100svh - 4rem);    /* fills the first screen under the header */
    padding-block: var(--space-8);
  }
  .hero__inner:has(.hero__photo) { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); }
  .hero__photo {
    order: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    padding-left: var(--space-8);
    border-left: 1px solid var(--color-border);   /* the vertical divider */
  }
  .hero__photo img { max-width: 14rem; }
}

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;       /* 44px touch target */
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.button:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-on-accent);
}
.button--secondary { background: transparent; color: var(--color-accent); }
.button--secondary:hover { background: var(--color-surface); color: var(--color-accent-hover); }

/* Sections: hairline rule, small Brick numeral beside the title, and on
   wide screens the content sits in a right-hand column under the title. */
.section {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-border);
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.section__head h2 { margin: 0; font-size: var(--text-xl-plus); font-weight: 700; }
.section__num {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-highlight);
}
@media (min-width: 64rem) {
  .section { padding-block: var(--space-9); }
  .section .wrap:has(.section__body) {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
  }
  .section__head { grid-column: 1 / -1; }
  .section__body { grid-column: 2; }
}

/* Experience: large Brick drop cap on the opening letter */
.section--experience .section__body > p:first-child::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  font-family: var(--font-heading);
  font-size: 3.6em;
  font-weight: 700;
  line-height: 0.8;
  color: var(--color-highlight);
}

/* Venture cards: Sage panel with a Brick rule across the top */
.ventures { display: grid; gap: var(--space-5); }
@media (min-width: 48rem) {
  .ventures { grid-template-columns: 1fr 1fr; }
}
.venture {
  padding: var(--space-5) var(--space-5) var(--space-6);
  background: var(--color-surface);
  border-top: 2px solid var(--color-highlight);
  border-radius: 0 0 var(--radius) var(--radius);
}
.venture p:last-child { margin-bottom: 0; }

/* Contact: dark full-width block that runs into the footer */
.section--contact {
  border-top: 0;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
}
.section--contact a { color: var(--color-footer-text); }
.section--contact a:hover { color: var(--color-footer-text); }
.section--contact :focus-visible { outline-color: var(--color-footer-text); }
.contact { display: grid; gap: var(--space-5); }
.contact h2 { margin: 0; font-size: var(--text-2xl); font-weight: 700; }
.section--contact .button {
  background: transparent;
  border-color: var(--color-footer-text);
  color: var(--color-footer-text);
}
.section--contact .button:hover {
  background: var(--color-footer-text);
  color: var(--color-footer-bg);
}
@media (min-width: 48rem) {
  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--space-8); }
}

/* Footer */
.site-footer {
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-accent);    /* hairline between contact and footer */
  background: var(--color-footer-bg);
  font-size: var(--text-sm);
  color: var(--color-footer-text);
}
.site-footer p { margin: 0; }
.site-footer :focus-visible { outline-color: var(--color-footer-text); }

/* 404 */
.notfound { padding-block: var(--space-9); }
