/* ==========================================================
   Colors: pale sage paper, deep slate ink, pine-green accent.
   Change these variables to re-theme the whole site.
   ========================================================== */
:root {
  --paper: #edf1ea;        /* page background */
  --paper-deep: #e2e8de;   /* footer and subtle panels */
  --ink: #1f2a2e;          /* main text */
  --ink-soft: #56635f;     /* secondary text, dates */
  --accent: #2f5d50;       /* links, highlights */
  --accent-soft: #c9d8cf;  /* underlines, borders */
  --line: rgba(31, 42, 46, 0.14);

  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 42rem;        /* max content width (~65 characters of body text) */
  --gutter: 1.25rem;
}

/* Dark mode: follows the visitor's system setting */
/* @media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a18;
    --paper-deep: #1b2320;
    --ink: #e3e9e4;
    --ink-soft: #9aa8a2;
    --accent: #8fc7b3;
    --accent-soft: #35504a;
    --line: rgba(227, 233, 228, 0.14);
  }
} */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4.5rem; /* keep anchor targets clear of the pinned bar */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* ---------- Intro: the name is the one bold moment ---------- */
.intro {
  padding: clamp(3.5rem, 12vw, 7.5rem) 0 clamp(2.5rem, 7vw, 4.5rem);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  position: relative;
  isolation: isolate; /* keeps the dot layer above the band but below the text */
}

/* Dot grid that fades out behind the text, so it only shows toward the edges */
.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 40rem 22rem at center, transparent 45%, #000 100%);
          mask-image: radial-gradient(ellipse 40rem 22rem at center, transparent 45%, #000 100%);
}

.name {
  font-weight: 400;
  font-size: clamp(3rem, 12vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.tagline {
  font-size: clamp(1.125rem, 2.6vw, 1.375rem);
  color: var(--ink-soft);
  max-width: 40rem;
  text-wrap: pretty;
  margin-bottom: 1.75rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  font-weight: 500;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Pinned bar: slides in once the intro scrolls away ---------- */
.pinned {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0s 0.2s;
}
.pinned.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.2s ease;
}

.pinned-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.pinned-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 3.5rem; /* fixed row height so the name doesn't shift when the menu opens */
  color: var(--ink);
  text-decoration: none;
}
.pinned-home { font-size: 1.625rem; } /* desktop only; phones show the toggle instead */

/* keep the bar's links compact rather than inheriting the intro's larger .links size */
.pinned-links {
  font-size: 1.0625rem;
  gap: 0.5rem 1.5rem;
}

.pinned-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.pinned-toggle::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: 0.5em;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-0.2em) rotate(45deg);
  transition: transform 0.2s ease;
}
.pinned-toggle[aria-expanded="true"]::after {
  transform: translateY(0.05em) rotate(-135deg);
}

@media (max-width: 599px) {
  /* Text fills the width on phones, leaving no room for the dots */
  .intro::before { display: none; }

  .links {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 0.75rem 2rem;
  }

  .pinned-home { display: none; }
  .pinned-toggle { display: block; }

  .pinned-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem 0 1rem;
  }
  .pinned-toggle[aria-expanded="true"] ~ .pinned-links { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .pinned, .pinned.is-visible, .pinned-toggle::after { transition: none; }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(2.5rem, 7vw, 4rem) 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.25rem);
  margin-bottom: 1.5rem;
}

.now {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--paper-deep);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.now-label { font-weight: 600; color: var(--accent); }

/* ---------- Projects ---------- */
.project + .project {
  margin-top: 3rem;
}

.project-shot {
  display: block;
  margin-bottom: 1.25rem;
}
.project-shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.project h3 {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.status {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-left: 0.4rem;
}

/* Tech stack renders as a comma-separated line */
.stack {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.stack li { display: inline; }
.stack li:not(:last-child)::after { content: ", "; }

.project-links {
  display: flex;
  gap: 1.25rem;
  font-weight: 500;
}

/* ---------- Experience ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.timeline li + li { margin-top: 1.5rem; }

.role {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.35rem;
}
.role h3 { font-size: 1.25rem; }

.dates {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.education {
  color: var(--ink-soft);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.education-label { font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  background: var(--paper-deep);
  padding: clamp(3rem, 8vw, 4.5rem) 0 2rem;
}

.footer-heading {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 1rem;
}

.footer-email {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 400;
  word-break: break-word;
}

.fine-print {
  margin-top: 2.5rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ---------- Wider screens: screenshot beside project text ---------- */
@media (min-width: 760px) {
  .project {
    display: grid;
    grid-template-columns: 17rem 1fr;
    gap: 2rem;
    align-items: start;
  }
  .project-shot { margin-bottom: 0; }
}