/* ==========================================================
   DESIGN TOKENS
   Light / clean / airy minimal — warm paper background,
   deep pine accent, editorial serif + humanist sans pairing.
   ========================================================== */
:root {
  /* color */
  --bg:          #FAF9F6;
  --bg-alt:      #F1EFEA;
  --panel:       #FFFFFF;
  --ink:         #1C1B19;
  --ink-soft:    #5B584F;
  --ink-faint:   #8C8878;
  --accent:      #2F5D50;
  --accent-ink:  #FFFFFF;
  --accent-soft: #DCE6D9;
  --line:        #DDD8CC;
  --line-strong: #C8C2B2;

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* layout */
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================
   RESET
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 560; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; cursor: pointer; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: var(--gutter); top: var(--gutter); }

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

/* subtle paper grain — cheap, no images */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 1px 1px, #000 1px, transparent 0);
  background-size: 3px 3px;
}

/* ==========================================================
   EYEBROW / UTILITY TEXT
   ========================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--panel); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-lg { padding: 16px 30px; font-size: 16px; }

/* ==========================================================
   HEADER
   ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 0 rgba(0,0,0,0.02);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 560; font-size: 19px; color: var(--ink); }
.brand-role { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 2px; }

.main-nav { display: flex; gap: 34px; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); font-size: 14.5px; font-weight: 500;
  position: relative; padding: 4px 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-cta { display: flex; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0;
}
.nav-toggle span { width: 22px; height: 1.5px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: max-height 0.4s var(--ease), border-color 0.4s var(--ease);
}
.mobile-nav.open { max-height: 400px; border-bottom-color: var(--line); }
.mobile-nav a {
  text-decoration: none; color: var(--ink); font-size: 16px;
  padding: 14px var(--gutter); border-top: 1px solid var(--line);
}
.mobile-nav .btn { margin: 16px var(--gutter) 20px; align-self: flex-start; }

/* ==========================================================
   HERO
   ========================================================== */
.hero { padding: clamp(56px, 11vw, 128px) 0 clamp(48px, 8vw, 88px); }
.hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}
.hero-text { flex: 1 1 auto; max-width: 620px; min-width: 0; }

.hero-photo { flex: 0 0 auto; }
.hero-photo-frame {
  position: relative;
  width: clamp(200px, 22vw, 300px);
  aspect-ratio: 1 / 1;
}
.hero-photo-frame::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  z-index: -1;
}
.hero-photo-placeholder,
.hero-photo-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
}
.hero-photo-placeholder {
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 56px);
  color: var(--accent);
  letter-spacing: 0.02em;
  border: 1px dashed var(--line-strong);
}

.hero-headline {
  font-size: clamp(38px, 6.4vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.hero-headline em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  margin-top: 26px;
  max-width: 560px;
  font-size: 18px;
  color: var(--ink-soft);
}

.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero-status {
  margin-top: 28px;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--ink-faint);
}
.hero-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================
   LEDGER STRIP
   ========================================================== */
.ledger {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.ledger-item {
  padding: 30px 22px 30px 0;
  border-left: 1px solid var(--line);
  padding-left: 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.ledger-item:first-child { border-left: none; padding-left: 0; }
.ledger-num { font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); font-weight: 560; color: var(--ink); line-height: 1; }
.ledger-label { font-size: 13.5px; color: var(--ink-soft); max-width: 20ch; }

/* ==========================================================
   SECTION HEAD (shared)
   ========================================================== */
section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.16; }
.section-sub { margin-top: 16px; font-size: 16.5px; color: var(--ink-soft); }
.section-note { margin-top: 14px; font-size: 13.5px; font-family: var(--font-mono); color: var(--ink-faint); }

/* ==========================================================
   WORK / INDEX LIST
   ========================================================== */
.work { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.index-row { border-top: 1px solid var(--line); }
.index-row:last-child { border-bottom: 1px solid var(--line); }

.index-link {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  text-decoration: none;
  color: var(--ink);
  padding: clamp(22px, 3vw, 32px) 4px;
  transition: padding-left 0.35s var(--ease), background 0.35s var(--ease);
}
.index-link:hover { padding-left: 14px; background: var(--bg-alt); }

.index-no {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  flex: 0 0 auto;
  padding-top: 4px;
}

.index-main { flex: 1 1 auto; min-width: 0; }
.index-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 460;
  margin-bottom: 8px;
}
.index-desc {
  display: block;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 14px;
}
.index-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

.index-arrow {
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--ink-faint);
  transform: translateX(-4px);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.index-link:hover .index-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

/* ==========================================================
   APPROACH + SKILLS
   ========================================================== */
.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.principle { background: var(--bg); padding: 34px 30px; }
.principle-mark {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--ink-faint);
  display: block; margin-bottom: 18px;
}
.principle h3 { font-size: 21px; margin-bottom: 12px; }
.principle p { color: var(--ink-soft); font-size: 15px; }

.skills-block { margin-top: clamp(48px, 6vw, 72px); }
.skills-heading { font-size: 15px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 24px; font-weight: 500; }
.skills-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
.skills-group-label { display: block; font-size: 13px; color: var(--ink-faint); margin-bottom: 12px; }
.chip-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chip {
  font-size: 14px;
  padding: 7px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  width: 100%;
}

/* ==========================================================
   EXPERIENCE TIMELINE
   ========================================================== */
.experience { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: 26px 0;
  border-top: 1px solid var(--line-strong);
}
.timeline-item:last-child { border-bottom: 1px solid var(--line-strong); }
.timeline-date { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); padding-top: 4px; }
.timeline-body h3 { font-size: 20px; margin-bottom: 4px; }
.timeline-org { font-size: 14.5px; color: var(--accent); margin-bottom: 10px; font-weight: 500; }
.timeline-desc { font-size: 15px; color: var(--ink-soft); max-width: 60ch; }

/* ==========================================================
   TESTIMONIAL
   ========================================================== */
.testimonial { background: var(--bg); }
.testimonial blockquote {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.testimonial p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.4;
  color: var(--ink);
}
.testimonial footer { margin-top: 22px; font-size: 14px; color: var(--ink-faint); }
.edit-flag { color: #B5533C; }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact {
  background: var(--ink);
  color: var(--bg);
  border-radius: 0;
}
.contact-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact .eyebrow { color: var(--accent-soft); }
.contact-headline { color: var(--bg); font-size: clamp(30px, 4.4vw, 48px); line-height: 1.14; max-width: 640px; }
.contact-sub { margin-top: 18px; max-width: 460px; color: #B9B6AB; font-size: 16px; }
.contact-actions { margin-top: 36px; }
.contact .btn-primary { background: var(--accent-soft); color: var(--ink); }
.contact .btn-primary:hover { background: var(--bg); }
.socials { margin-top: 30px; display: flex; gap: 10px; font-size: 14px; }
.socials a { color: #B9B6AB; text-decoration: none; }
.socials a:hover { color: var(--bg); }
.social-sep { color: #55524A; }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer { background: var(--ink); color: #8C8878; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 34px;
  font-size: 13px;
  border-top: 1px solid #33312B;
}
.back-to-top { text-decoration: none; color: #8C8878; }
.back-to-top:hover { color: var(--bg); }

/* ==========================================================
   SCROLL REVEAL
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
  .hero-photo-frame { width: clamp(160px, 20vw, 220px); }
  .principle-grid { grid-template-columns: 1fr; }
  .skills-groups { grid-template-columns: repeat(2, 1fr); }
  .ledger-grid { grid-template-columns: repeat(2, 1fr); }
  .ledger-item:nth-child(2) { border-left: none; padding-left: 0; }
  .ledger-item:nth-child(3), .ledger-item:nth-child(4) { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px; }
}

@media (max-width: 760px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }

  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 32px; }
  .hero-photo { align-self: center; }
  .hero-photo-frame { width: clamp(160px, 45vw, 220px); }

  .timeline-item { grid-template-columns: 1fr; gap: 6px; }

  .index-link { flex-wrap: wrap; }
  .index-arrow { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .skills-groups { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}
