/* Dark is the default. Light is opt-in via the toggle (data-theme="light"). */

:root {
  color-scheme: dark;
  --ground:      #0C0D0E;
  --ground-alt:  #121315;
  --panel:       #17181A;
  --ink:         #EDEAE4;
  --ink-soft:    #A8A399;
  --ink-faint:   #8A857B;
  --rule:        #262728;
  --accent:      #D9A25E;
  --accent-soft: rgba(217, 162, 94, 0.12);
  --field:       237, 234, 228;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 50px -22px rgba(0,0,0,.8);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --gut: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ground:      #F6F4F0;
  --ground-alt:  #EFECE6;
  --panel:       #FFFFFF;
  --ink:         #14120F;
  --ink-soft:    #4A453D;
  --ink-faint:   #767068;
  --rule:        #DED8CE;
  --accent:      #9A6B2F;
  --accent-soft: rgba(154, 107, 47, 0.10);
  --field:       20, 18, 15;
  --shadow: 0 1px 2px rgba(20,18,15,.04), 0 12px 40px -18px rgba(20,18,15,.22);
}

/* ------------------------------- base ------------------------------- */

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

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

a { color: inherit; }

::selection { background: var(--accent); color: var(--ground); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--ground);
  padding: .75rem 1.25rem; text-decoration: none;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ------------------------------ topbar ------------------------------ */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem var(--gut);
  transition: background-color .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--rule);
  padding-block: .7rem;
}

.mark {
  text-decoration: none;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .42rem .95rem;
  line-height: 1;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
@media (max-width: 400px) {
  .mark { font-size: .75rem; padding: .4rem .8rem; }
}
.mark:hover { border-color: var(--accent); color: var(--accent); }

.topnav {
  margin-left: auto;
  display: flex;
  gap: clamp(.9rem, 2.2vw, 2rem);
}
.topnav a {
  position: relative;
  font-size: .8125rem;
  font-weight: 450;
  letter-spacing: .01em;
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: .25rem;
  transition: color .3s var(--ease);
}
.topnav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.topnav a:hover, .topnav a.is-current { color: var(--ink); }
.topnav a.is-current::after, .topnav a:hover::after { transform: scaleX(1); }

@media (max-width: 760px) { .topnav { display: none; } }

.theme {
  margin-left: auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
@media (min-width: 761px) { .theme { margin-left: clamp(.9rem, 2.2vw, 2rem); } }
.theme:hover { border-color: var(--accent); transform: rotate(-25deg); }
.theme__dot {
  width: 13px; height: 13px; border-radius: 999px;
  background: var(--ink);
  box-shadow: inset -4px -3px 0 0 var(--ground);
}

/* ------------------------------- hero ------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: 6rem 3rem;
  overflow: hidden;
}

.field {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 8.6vw, 6.6rem);
  line-height: .92;
  letter-spacing: -0.028em;
}

.hero__facts {
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .5rem;
  max-width: 62ch;
}
.hero__facts li {
  position: relative;
  padding-left: 1.15rem;
  font-size: .9375rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.hero__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .68em;
  width: .5rem;
  height: 1px;
  background: var(--accent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: border-color .35s var(--ease), color .35s var(--ease),
              transform .35s var(--ease);
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Icon-only variants sit on the same baseline and match the CV button's
   height exactly, so a mixed row of icons and text still lines up. */
.btn--icon {
  padding: 0;
  width: 2.55rem;
  height: 2.55rem;
  justify-content: center;
}
.btn--icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

/* portrait */

.portrait { margin: 0; }
.portrait__frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translate3d(0,0,0);
  will-change: transform;
}
.portrait__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(.92) contrast(1.02);
}
.portrait__sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    46% 46% at var(--mx, 50%) var(--my, 32%),
    color-mix(in srgb, var(--accent) 26%, transparent) 0%,
    transparent 68%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .7s var(--ease);
  pointer-events: none;
}
.portrait__frame:hover .portrait__sheen { opacity: 1; }

.scrollcue {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  width: 1px; height: 3.5rem;
  background: var(--rule);
  overflow: hidden;
}
.scrollcue span {
  position: absolute; inset: 0;
  background: var(--accent);
  animation: cue 2.6s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

@media (max-width: 900px) {
  .hero { min-height: auto; padding-block: 7.5rem 4rem; }
  .hero__inner { grid-template-columns: 1fr; gap: 2.75rem; }
  .portrait { order: -1; max-width: 300px; }
  .scrollcue { display: none; }
}

/* ------------------------------ sections ------------------------------ */

.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt {
  background: var(--ground-alt);
  border-block: 1px solid var(--rule);
}

.label {
  margin: 0;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sechead { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }

/* A section's label is its heading now — small, but it earns a rule beside it. */
.sechead .label,
.section--about .label,
.contact .label {
  font-size: clamp(.875rem, 1.5vw, 1.0625rem);
  letter-spacing: .18em;
  color: var(--accent);
}
.sechead .label::before,
.section--about .label::before,
.contact .label::before {
  content: "";
  display: inline-block;
  width: 2.1rem;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: .8rem;
}

/* about */

.statement {
  margin: 1.35rem 0 0;
  max-width: 54ch;
  font-size: clamp(1.0625rem, 1rem + .45vw, 1.3125rem);
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--ink-soft);
}

/* ------------------------------ timeline ------------------------------ */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__rail {
  position: absolute;
  top: .55rem;
  bottom: 1rem;
  left: 0;
  width: 1px;
  background: var(--rule);
}
.timeline__fill {
  position: absolute;
  inset: 0 0 auto 0;
  width: 1px;
  height: var(--progress, 0%);
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent));
  transition: height .18s linear;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: 0 0 clamp(1.6rem, 3.5vw, 2.4rem) clamp(1.5rem, 3vw, 2.4rem);
}
.entry:last-child { padding-bottom: 0; }

.entry::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: .55rem;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--ground);
  border: 1px solid var(--rule);
  transition: background-color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
.section--alt .entry::before { background: var(--ground-alt); }
.entry.is-live::before {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.35);
}

.entry__when {
  font-family: var(--mono);
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: .3rem;
}
.entry.is-live .entry__when { color: var(--accent); }

.entry__role {
  margin: 0;
  font-size: clamp(1.1875rem, 2.4vw, 1.5rem);
  font-weight: 550;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

/* The bare text node here is the employer's name; the note and place spans
   set their own muted colours, so this one governs just the name. */
.entry__org {
  margin: .45rem 0 .95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .9rem;
  font-size: 1.0625rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.entry__note {
  font-weight: 400;
  font-size: .8125rem;
  color: var(--ink-soft);
}
.entry__note::before { content: "— "; color: var(--ink-faint); }
.entry__place {
  margin-left: auto;
  font-family: var(--mono);
  font-weight: 400;
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.entry__points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .55rem;
  max-width: 66ch;
}
.entry__points li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-size: .9063rem;
  line-height: 1.56;
}
.entry__points li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: .5rem; height: 1px;
  background: var(--accent);
  opacity: .75;
}
.entry__points strong { color: var(--ink); font-weight: 550; }
.entry__points em { font-style: italic; color: var(--ink); }

@media (max-width: 780px) {
  .entry { grid-template-columns: 1fr; gap: .75rem; }
  .entry__when { padding-top: 0; }
  .entry__place { margin-left: 0; }
}

/* ------------------------------- cards ------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(.8rem, 1.8vw, 1.25rem);
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: clamp(1.3rem, 2.4vw, 1.85rem);
}

.card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.card__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  letter-spacing: -0.015em;
}
.card__when {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .1em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.card__sub {
  margin: .4rem 0 1.05rem;
  font-size: .8125rem;
  font-family: var(--mono);
  letter-spacing: .04em;
  color: var(--accent);
}
.card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .6rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.05rem;
}
.card__list li {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* skills */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  margin-top: clamp(1.9rem, 4vw, 2.6rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--rule);
}
.skillset__title {
  margin: 0 0 .9rem;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0; padding: 0;
  list-style: none;
}
.chips li {
  font-size: .8125rem;
  padding: .35rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--ground);
}

/* ------------------------------- beyond ------------------------------- */

/* Same card treatment as Education, so the two sections read as one system. */
.beyond {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(.8rem, 1.8vw, 1.25rem);
}
@media (min-width: 760px) { .beyond { grid-template-columns: repeat(2, 1fr); } }

.beyond__item {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: clamp(1.3rem, 2.4vw, 1.85rem);
}
.beyond__title {
  margin: 0 0 .7rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.beyond__item p {
  margin: 0;
  font-size: .9063rem;
  line-height: 1.56;
  color: var(--ink-soft);
}

/* ------------------------------- contact ------------------------------- */

.contact {
  padding-block: clamp(3.25rem, 6.5vw, 5rem) 2rem;
  background: var(--ground-alt);
  border-top: 1px solid var(--rule);
}

.contact__big {
  margin: 1.15rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 6.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  word-break: break-word;
}
.contact__big a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 92%;
  transition: background-size .6s var(--ease), color .4s var(--ease);
}
.contact__big a:hover { background-size: 100% 2px; color: var(--accent); }

.contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1.9rem;
}
.contact__row a {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--rule);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.contact__row a:hover { color: var(--accent); border-color: var(--accent); }

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: clamp(2rem, 4.5vw, 3rem) 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------- reveal ------------------------------- */

/* Scoped to .js, which an inline script in <head> sets. Without JavaScript
   the class never lands, .reveal never hides, and the page renders in full
   rather than staying invisible waiting for an observer that will not run. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scrollcue span { animation: none; }
  .btn:hover { transform: none; }
}
