/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #121214;
  --bg-raised: #17171a;
  --ink: #f2efe9;
  --ink-dim: #a6a39c;
  --ink-faint: #706d67;
  --line: rgba(242, 239, 233, 0.1);
  --line-strong: rgba(242, 239, 233, 0.18);
  --accent: #e3a94c;
  --accent-soft: rgba(227, 169, 76, 0.14);
  --accent-ink: #16130b;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --max: 1040px;
  --gutter: 24px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0 0 1em;
  color: var(--ink-dim);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Skip link for keyboard/screen-reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 1000;
}

.skip-link:focus {
  left: 0;
}

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

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

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

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

section:first-of-type {
  border-top: none;
}

.muted {
  color: var(--ink-dim);
}

/* ==========================================================================
   Nav bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 18px;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a:not(.btn) {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.15s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   Buttons & tags
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(227, 169, 76, 0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-top: 88px;
  padding-bottom: 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.hero .role {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero .lede {
  font-size: 18px;
  max-width: 52ch;
  margin-bottom: 28px;
}

.hero-photo {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 260px;
}

.hero-photo .frame {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 5;
}

.hero-photo .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  z-index: -1;
}

/* Fact strip: thin-divided row of quick facts under the hero */
.fact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 8px;
}

.fact {
  flex: 1 1 200px;
  padding: 18px 24px 18px 0;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.fact:first-child {
  border-left: none;
  padding-left: 0;
}

.fact .num {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.fact .label {
  font-size: 13px;
  color: var(--ink-dim);
}

/* ==========================================================================
   Section heads
   ========================================================================== */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: 30px;
  margin: 0;
}

.section-head .see-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ==========================================================================
   About & skills
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
}

.skill-group {
  margin-bottom: 22px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  font-family: var(--font-body);
}

/* ==========================================================================
   Timeline (experience & education)
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line-strong);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item .when {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 4px;
  display: block;
}

.timeline-item h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.timeline-item p {
  margin: 0;
}

/* ==========================================================================
   Project rows
   ========================================================================== */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.15s ease;
}

.project-list a.project-row:first-child {
  border-top: none;
}

.project-row:hover {
  padding-left: 8px;
}

.project-row .title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.project-row h3 {
  font-size: 20px;
  margin: 0;
}

.project-row p {
  margin: 0 0 10px;
  max-width: 60ch;
}

.project-row .arrow {
  font-size: 22px;
  color: var(--accent-faint, var(--ink-faint));
  transition: transform 0.15s ease;
  justify-self: end;
}

.project-row:hover .arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.contact-list a,
.contact-list span {
  font-size: 16px;
}

.contact-list .k {
  color: var(--ink-faint);
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-faint);
}

.footer-row a {
  color: var(--ink-faint);
}

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

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

/* ==========================================================================
   Case study pages
   ========================================================================== */
.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-faint);
  font-size: 13px;
  margin-bottom: 24px;
}

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

.page-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: start;
}

.page-hero-grid h1 {
  font-size: clamp(32px, 5vw, 46px);
  margin-bottom: 14px;
}

.snapshot {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 20px;
}

.snapshot h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-family: var(--font-body);
  margin-bottom: 12px;
}

.snapshot dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.snapshot dt {
  font-size: 12px;
  color: var(--ink-faint);
}

.snapshot dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.detail-block h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.detail-block p {
  margin: 0;
}

/* ==========================================================================
   Fade-in on scroll
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   404 page
   ========================================================================== */
.error-page {
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 120px);
  color: var(--accent);
  margin-bottom: 8px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .hero-grid,
  .about-grid,
  .page-hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    justify-self: start;
    max-width: 180px;
    order: -1;
  }

  .nav-links {
    position: fixed;
    top: 67px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px var(--gutter) 24px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  /* 2×2 grid so facts stay compact and don't stack into a long column */
  .fact-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-direction: unset;
  }

  .fact {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 12px 0;
  }

  .fact:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 16px;
  }

  .fact:nth-child(even) {
    padding-left: 16px;
  }

  .fact:first-child,
  .fact:nth-child(2) {
    border-top: none;
    padding-top: 0;
  }

  .fact .num {
    font-size: 18px;
  }

  .fact .label {
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  section {
    padding: 52px 0;
  }

  .hero {
    padding-top: 40px;
  }

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

  .project-row .arrow {
    display: none;
  }
}
