/* ==========================================================
   Fonts — self-hosted (no external CDN calls)
   ========================================================== */
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/librebaskerville-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ==========================================================
   Tokens
   ========================================================== */
:root {
  --bg: #f3efe9;
  --panel: #fbf9f5;
  --ink: #24201f;
  --muted: #6b625a;
  --line: rgba(36, 32, 31, 0.12);
  --accent: #e8551f;
  --accent-ink: #fff6f1;
  --max: 1320px;
  --side-pad: 34px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Switzer", -apple-system, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
}

em {
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

section {
  padding: 100px 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type {
  border-bottom: none;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 18px;
}

h2.section-title {
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}

/* ==========================================================
   Nav
   ========================================================== */
header.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 239, 233, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 20px var(--side-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
}

nav.nav-links ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

nav.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  transition: color 0.2s;
}

nav.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: 0.2s;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
}

.nav-toggle span::before {
  top: -7px;
}

.nav-toggle span::after {
  top: 7px;
}

/* ==========================================================
   Hero
   ========================================================== */
#home {
  padding-top: 64px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 56px;
  padding-bottom: 56px;
}

.hero-text {
  flex: 0 1 700px;
}

.hero-photo {
  flex: 0 0 460px;
}

.headline {
  font-size: 62px;
  line-height: 1.14;
  font-weight: 700;
  margin: 0 0 26px;
  letter-spacing: -0.01em;
}

.sub {
  font-size: 20.5px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
  margin: 0;
}

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

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232, 85, 31, 0.28);
}

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

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

.hero-photo img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  box-shadow: 0 18px 40px rgba(36, 32, 31, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.stat-cell {
  padding: 30px 26px;
  border-right: 1px solid var(--line);
}

.stat-cell:last-child {
  border-right: none;
}

.stat-icon {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 12px;
}

.stat-cell b {
  display: block;
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-cell span {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.card {
  padding: 34px 30px;
  border-right: 1px solid var(--line);
}

.card:last-child {
  border-right: none;
}

.card-icon {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-bottom: 14px;
}

.card h3 {
  font-size: 18.5px;
  font-weight: 700;
  margin: 0 0 10px;
}

.card p {
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ==========================================================
   About
   ========================================================== */
.about-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.about-text {
  flex: 0 1 680px;
}

.about-text p {
  font-size: 23px;
  line-height: 1.75;
  margin: 0 0 28px;
}

.about-quote {
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  font-size: 30px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 36px;
  padding-left: 24px;
  border-left: 3px solid var(--accent);
}

.about-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.5px;
  color: var(--muted);
  font-weight: 600;
}

.about-facts svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.about-photo {
  flex: 0 0 460px;
}

.about-photo img {
  width: 100%;
  height: 560px;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 14px;
  display: block;
  box-shadow: 0 18px 40px rgba(36, 32, 31, 0.14);
}

/* ==========================================================
   Experience / Timeline
   ========================================================== */
.timeline {
  max-width: 1060px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: none;
}

.timeline-date {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  padding-top: 3px;
}

.timeline-role {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 4px;
}

.timeline-icon {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.timeline-org {
  font-size: 16.5px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}

.timeline-desc {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 820px;
}

/* ==========================================================
   Gallery
   ========================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 220px 220px 380px;
  grid-template-areas:
    "a b c"
    "a b d"
    "e e e";
  gap: 18px;
}

.gallery-item {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  cursor: default;
}

.gallery-item.g1 {
  grid-area: a;
}

.gallery-item.g2 {
  grid-area: b;
}

.gallery-item.g3 {
  grid-area: c;
}

.gallery-item.g4 {
  grid-area: d;
}

.gallery-item.g5 {
  grid-area: e;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.3s;
}

.gallery-item.g5 img {
  object-position: center center;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 18px 14px;
  background: linear-gradient(to top, rgba(20, 16, 15, 0.82), rgba(20, 16, 15, 0));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ==========================================================
   Projects
   ========================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(36, 32, 31, 0.1);
}

.project-card.featured {
  grid-column: 1 / -1;
}

.project-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.project-card h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
}

.project-card p {
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.tech-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(36, 32, 31, 0.06);
  color: var(--ink);
}

.project-links {
  display: flex;
  gap: 18px;
}

.project-links a {
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.project-links .no-link {
  font-size: 14.5px;
  color: var(--muted);
  font-style: italic;
}

/* ==========================================================
   Writing
   ========================================================== */
.writing-list {
  display: flex;
  flex-direction: column;
  max-width: 980px;
}

.writing-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.writing-item:first-child {
  border-top: none;
}

.writing-item:hover .writing-title {
  color: var(--accent);
}

.writing-main {
  flex: 1;
}

.writing-title {
  font-size: 20.5px;
  font-weight: 700;
  margin: 0 0 6px;
  transition: color 0.2s;
}

.writing-summary {
  font-size: 16.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.writing-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

/* ==========================================================
   Contact
   ========================================================== */
.contact-block {
  max-width: 620px;
}

.contact-lead {
  font-size: 19px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 0 30px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-style: italic;
  font-size: 32px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin-bottom: 32px;
  word-break: break-word;
}

.contact-email svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--accent);
}

.contact-email:hover {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-actions .btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
}

.contact-actions .btn-ghost:hover {
  border-color: var(--ink);
}

/* ==========================================================
   Footer
   ========================================================== */
footer {
  padding: 40px 0 60px;
}

.footer-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  font-size: 15.5px;
  color: var(--muted);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 26px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.footer-links a svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1100px) {
  :root {
    --side-pad: 26px;
  }

  .hero-top {
    gap: 32px;
  }

  .hero-text {
    flex-basis: 560px;
  }

  .hero-photo {
    flex-basis: 380px;
  }

  .hero-photo img {
    height: 420px;
  }

  .headline {
    font-size: 46px;
  }

  .about-grid {
    gap: 32px;
  }

  .about-text {
    flex-basis: 540px;
  }

  .about-photo {
    flex-basis: 360px;
  }

  .about-photo img {
    height: 420px;
  }

  .gallery-grid {
    grid-template-rows: 180px 180px 260px;
    gap: 14px;
  }
}

@media (max-width: 860px) {
  :root {
    --side-pad: 22px;
  }

  nav.nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  nav.nav-links.open {
    max-height: 320px;
  }

  nav.nav-links ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 28px 20px;
  }

  nav.nav-links li {
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }

  .nav-toggle {
    display: block;
  }

  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-text {
    flex-basis: auto;
  }

  .hero-photo {
    order: -1;
    flex-basis: auto;
  }

  .hero-photo img {
    width: 220px;
    height: 260px;
  }

  .headline {
    font-size: 34px;
  }

  .sub {
    font-size: 17px;
  }

  h2.section-title {
    font-size: 33px;
  }

  .stat-grid,
  .card-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-cell:nth-child(2n),
  .card:nth-child(2n) {
    border-right: none;
  }

  .card:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .about-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .about-text {
    flex-basis: auto;
  }

  .about-photo {
    order: -1;
    flex-basis: auto;
  }

  .about-photo img {
    height: 300px;
  }

  .about-text p {
    font-size: 18px;
  }

  .about-quote {
    font-size: 22px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas: none;
  }

  .gallery-item.g1,
  .gallery-item.g2,
  .gallery-item.g3,
  .gallery-item.g4,
  .gallery-item.g5 {
    grid-area: auto;
    height: 240px;
  }

  .gallery-item.g5 {
    height: 320px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

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

  section {
    padding: 60px 0;
  }

  .writing-item {
    flex-direction: column;
    gap: 6px;
  }

  .contact-email {
    font-size: 24px;
  }

  .contact-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
