/* ---------- tokens ---------- */
:root {
  --bg: #f5f2ed;
  --surface: #ffffff;
  --ink: #16140f;
  --ink-soft: #55524a;
  --line: rgba(22, 20, 15, 0.12);
  --line-strong: rgba(22, 20, 15, 0.55);
  --accent: #9a4b2f;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f;
    --surface: #1c1a15;
    --ink: #f1ede4;
    --ink-soft: #a8a296;
    --line: rgba(241, 237, 228, 0.14);
    --line-strong: rgba(241, 237, 228, 0.5);
    --accent: #e08a5f;
  }
}

:root[data-theme="dark"] {
  --bg: #15130f;
  --surface: #1c1a15;
  --ink: #f1ede4;
  --ink-soft: #a8a296;
  --line: rgba(241, 237, 228, 0.14);
  --line-strong: rgba(241, 237, 228, 0.5);
  --accent: #e08a5f;
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 100;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 450;
  letter-spacing: -0.01em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  margin-left: auto;
}

.nav a {
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4d8b5f;
  box-shadow: 0 0 0 3px color-mix(in srgb, #4d8b5f 25%, transparent);
  display: inline-block;
}

/* ---------- hero ---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  padding: 96px 28px 88px;
}

.hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.hero-photo-wrap {
  flex: 0 0 auto;
  position: relative;
  width: 260px;
}

.hero-photo-wrap::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -16px;
  right: -16px;
  bottom: -16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  z-index: -1;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

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

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.15;
  max-width: 700px;
  margin-bottom: 32px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 44px;
}

.hero-tags span:not(:last-child)::after {
  content: '·';
  margin-left: 22px;
  color: var(--line-strong);
}

.tag-building {
  font-style: italic;
  opacity: 0.75;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  padding: 13px 22px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

/* ---------- section head ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 600;
}

.section-count {
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- work ---------- */
.work { padding: 60px 28px 20px; }

.project-list {
  display: flex;
  flex-direction: column;
}

.project {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.project:first-child { border-top: 1px solid var(--line); }

.project-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(4%);
}

.project-media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-media--placeholder span {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--line-strong);
}

.project-media--wide {
  aspect-ratio: 2.4 / 1;
  background: #0b0a08;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-media--wide img {
  object-fit: contain;
  filter: none;
}

/* ---------- gallery ---------- */
.project-media.gallery {
  position: relative;
}

.gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }

.gallery-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.project-media.gallery:hover .gallery-nav,
.project-media.gallery:focus-within .gallery-nav { opacity: 1; }

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 40%, var(--ink) 60%);
  opacity: 0.5;
  cursor: pointer;
}

.gallery-dots button.active {
  opacity: 1;
  background: var(--ink);
}

@media (hover: none) {
  .gallery-nav { display: none; }
}

.project-index {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}

.project-body h3 {
  font-size: 24px;
  margin-bottom: 12px;
  font-weight: 450;
}

.project-summary {
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-bottom: 18px;
}

.tag-row li {
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

details {
  font-size: 14px;
}

summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: '+';
  font-family: var(--font-display);
  color: var(--accent);
}

details[open] summary::before { content: '−'; }

.detail-body {
  padding-top: 16px;
  max-width: 62ch;
  color: var(--ink-soft);
}

.detail-body p { margin-bottom: 12px; }
.detail-body strong { color: var(--ink); }

.project-links a {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- about ---------- */
.about { padding: 60px 28px; }

.about-copy p {
  max-width: 60ch;
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-size: 17px;
}

.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

.stack-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.stack-group h4 {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.stack-group p {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: none;
}

.about-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- education ---------- */
.education { padding: 60px 28px; }

.education-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 12px;
}

.education-item {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.education-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.education-item-head h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.education-date {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.education-school {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- contact ---------- */
.contact { padding: 90px 28px 110px; }

.contact-inner {
  border-top: 1px solid var(--line);
  padding-top: 56px;
  text-align: left;
}

.contact h2 {
  font-size: clamp(30px, 4vw, 44px);
  margin-bottom: 16px;
  max-width: 18ch;
}

.contact p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 30px;
}

.social-row {
  display: flex;
  gap: 24px;
  margin-top: 26px;
  font-size: 14px;
}

.social-row a { color: var(--ink-soft); }
.social-row a:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 28px 40px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .header-row { height: auto; padding: 14px 20px; flex-wrap: wrap; row-gap: 10px; }
  .status-pill { order: 3; }
  .nav { order: 2; margin-left: 0; gap: 14px 18px; flex-wrap: wrap; }

  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 32px;
    padding: 56px 20px 60px;
  }
  .hero-photo-wrap { width: 128px; }
  .hero-photo-wrap::before { top: 10px; left: -10px; right: -10px; bottom: -10px; }
  .hero-photo { aspect-ratio: 1 / 1; }
  .hero-copy { width: 100%; }
  .hero h1 { max-width: none; }

  .work, .about, .education, .contact { padding-left: 20px; padding-right: 20px; }
  .education-item-head { flex-direction: column; align-items: flex-start; gap: 4px; }

  .project {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .project-media { aspect-ratio: 16 / 9; }

  .stack-groups { grid-template-columns: 1fr; }
}
