@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 0.25s ease-out both vtFadeOut; }
::view-transition-new(root) { animation: 0.25s ease-out both vtFadeIn; }

@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } to { opacity: 1; } }

:root {
  --ink: #0f0e0c;
  --paper: #f5f1ea;
  --cream: #ede8df;
  --rust: #c4572a;
  --slate: #0f0e0c;
  --muted: #0f0e0c;
  --rule: #d4cfc6;
  --highlight: #e8e0d0;
  --max-width: 960px;
  --header-h: 60px;
}

html.dark {
  --paper: #0f0e0c;
  --ink: #f5f1ea;
  --slate: var(--ink);
  --muted: var(--ink);
}
html.dark .tech-tag {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}
html.dark body::before { opacity: 0.08; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 20px;
  line-height: 1.7;
  cursor: crosshair;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
  view-transition-name: none;
}

a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper); border-bottom: 1px solid var(--rule); height: var(--header-h);
  view-transition-name: none;
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.logo:hover { color: var(--rust); }
.theme-toggle {
  font-size: 20px;
  line-height: 1;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  color: var(--muted);
  padding: 4px 10px;
  margin-right: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--ink); }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  padding: 6px 14px;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: none; }
.nav-link.active { color: var(--ink); background: none; }
.recruit-link:hover { cursor: url('pfp.jpeg') 16 16, pointer; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-shrink: 0; }
.mobile-menu-btn span { display: block; width: 24px; height: 3px; background: var(--ink); margin: 6px 0; transition: 0.2s; border-radius: 1px; }
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.page { display: none; }
.page.active { display: block; }

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

.hero {
  padding: 80px 0 60px;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
}
.hero-pfp {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rule);
  margin-bottom: 32px;
  display: block;
}
.hero-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(65px, 7.5vw, 90px);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.hero-headline {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 24px;
  font-weight: 400;
  border-left: 2px solid var(--rust);
  padding-left: 20px;
  max-width: 620px;
  line-height: 1.8;
}
.hero-about {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 660px;
}
.hero-about p { margin-bottom: 12px; }
.hero-about p:last-child { margin-bottom: 0; }
.social-links { display: flex; flex-wrap: wrap; gap: 24px; }
.social-link {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}
.social-link:hover { color: var(--rust); }
.social-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.page-header { padding: 48px 0 32px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.page-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-header p { font-size: 15px; color: var(--muted); }

.projects-grid { padding: 0 0 80px; display: flex; flex-direction: column; gap: 0; }
.project-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.2s;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}
.project-card:last-child { border-bottom: none; }
.project-card:hover { padding-left: 16px; }
.project-card::after {
  content: '→';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: var(--rust);
  opacity: 0;
  transition: opacity 0.2s;
}
.project-card:hover::after { opacity: 1; }
.project-card-header { margin-bottom: 10px; }
.project-domain {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.project-domain::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--rust);
}
.project-card-title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: break-word;
}
.project-card-tagline {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 18px;
  font-style: italic;
  line-height: 1.5;
}
.project-card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag {
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  color: var(--slate);
  background: var(--cream);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.3); z-index: 200; justify-content: center; align-items: flex-start;
  padding: 60px 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--paper);
  max-width: 780px; width: 100%;
  padding: 48px;
  position: relative;
  animation: modalIn 0.25s ease;
  border: 1px solid var(--rule);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); background: var(--paper);
  cursor: pointer; color: var(--muted); font-size: 22px;
  z-index: 1;
}
.modal-close:hover { background: var(--cream); color: var(--ink); }
.modal-domain {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-domain::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--rust);
}
.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 35px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: break-word;
}
.modal-tagline {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  font-style: italic;
}
.modal-section { margin-bottom: 28px; }
.modal-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.modal-section p { font-size: 16px; color: var(--slate); line-height: 1.8; }
.modal-section ul { list-style: none; padding: 0; }
.modal-section ul li {
  font-size: 16px;
  color: var(--slate);
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.7;
}
.modal-section ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--rust);
  font-size: 14px;
}
.modal-techs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modal-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }
.modal-link {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--rust);
}
.modal-link:hover { color: var(--ink); }
.placeholder { font-size: 14px; color: var(--muted); font-style: italic; }

.cs-grid { padding: 0 0 80px; display: flex; flex-direction: column; gap: 0; }
.cs-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.2s;
  position: relative;
}
.cs-card:last-child { border-bottom: none; }
.cs-card:hover { padding-left: 16px; }
.cs-card::after {
  content: '→';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: var(--rust);
  opacity: 0;
  transition: opacity 0.2s;
}
.cs-card:hover::after { opacity: 1; }
.cs-title {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.cs-tagline {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}
.cs-section { margin-bottom: 24px; }
.cs-section:last-child { margin-bottom: 0; }
.cs-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.cs-section p { font-size: 16px; color: var(--slate); line-height: 1.8; }
.cs-section ul { list-style: none; padding: 0; }
.cs-section ul li {
  font-size: 16px;
  color: var(--slate);
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.7;
}
.cs-section ul li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--rust);
}

.findings-grid { padding: 0 0 80px; display: flex; flex-direction: column; gap: 0; }
.finding-card {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
}
.finding-card:last-child { border-bottom: none; }
.finding-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.finding-block { margin-bottom: 24px; }
.finding-block:last-child { margin-bottom: 0; }
.finding-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.finding-block p { font-size: 16px; color: var(--slate); line-height: 1.8; margin-bottom: 10px; }
.finding-block p:last-child { margin-bottom: 0; }
.finding-block ul { list-style: none; padding: 0; }
.finding-block ul li {
  font-size: 16px;
  color: var(--slate);
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.7;
}
.finding-block ul li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--rust);
}

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 36px; margin-bottom: 12px; flex-wrap: wrap; }
.footer-link {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 4px 0;
}
.footer-link:hover { color: var(--rust); }
.footer-copy { font-size: 13px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-name { animation: fadeUp 0.8s 0.1s both; }
.hero-headline { animation: fadeUp 0.8s 0.3s both; }
.hero-about { animation: fadeUp 0.8s 0.5s both; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); }

.project-card, .cs-card, .finding-card, .modal-content { overflow-wrap: break-word; word-break: break-word; }

.project-detail { padding: 0 0 80px; }
.project-detail .back-link {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  padding: 4px 0;
}
.project-detail .back-link:hover { color: var(--rust); }

.xp-content { padding: 0 0 80px; }
.xp-content p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.xp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 0 40px;
}

.xp-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.xp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

.xp-card-accent {
  height: 6px;
  width: 100%;
  flex-shrink: 0;
  background: var(--rust);
}

.xp-accent-green { background: #3a7d44; }
.xp-accent-blue { background: #2a6f97; }
.xp-accent-purple { background: #7c3aed; }
.xp-accent-amber { background: #c8762a; }

.xp-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.xp-card-domain {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rust);
  margin-bottom: 10px;
}

.xp-card-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.xp-card-tagline {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.xp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.xp-card-tags .tech-tag {
  font-size: 12px;
  padding: 3px 10px;
}

.newsletter-btn {
  display: inline-block;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--paper);
  background: var(--rust);
  padding: 14px 36px;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}

.newsletter-btn:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}

html.dark .xp-card {
  border-color: var(--rule);
}

html.dark .xp-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

html.dark .newsletter-btn {
  color: var(--paper);
}

@media (max-width: 700px) {
  .xp-grid { grid-template-columns: 1fr; gap: 16px; }
  .xp-card-body { padding: 20px; }
  .xp-card-title { font-size: 20px; }
  .newsletter-btn { padding: 12px 28px; font-size: 14px; }
}

@media (max-width: 900px) {
  :root { --header-h: 56px; }
  .header-inner { padding: 0 16px; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; padding: 16px; gap: 4px;
    z-index: 101;
    overflow-x: visible;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; font-size: 15px; }
  .mobile-menu-btn { display: block; }
  .theme-toggle { font-size: 18px; padding: 2px 8px; }
  .hero { padding: 40px 0 48px; min-height: auto; }
  .hero-name { font-size: clamp(40px, 12vw, 56px); }
  .hero-pfp { width: 100px; height: 100px; margin-bottom: 24px; }
  .hero-headline { font-size: 15px; padding-left: 16px; }
  .hero-about { font-size: 15px; }
  .social-link { font-size: 13px; }
  .social-link svg { width: 16px; height: 16px; }
  .container { padding: 0 16px; }
  .page-header { padding: 32px 0 24px; }
  .page-header h1 { font-size: 30px; }
  .page-header p { font-size: 14px; }
  .modal-content { padding: 24px; }
  .modal-title { font-size: 26px; }
  .modal-tagline { font-size: 15px; }
  .modal-section p { font-size: 15px; }
  .modal-section ul li { font-size: 15px; }
  .modal-overlay { padding: 40px 16px; }
  .project-card { padding: 24px 0; }
  .project-card:hover { padding-left: 8px; }
  .project-card-title { font-size: 24px; }
  .project-card-tagline { font-size: 14px; }
  .project-domain { font-size: 12px; }
  .tech-tag { font-size: 12px; }
  .cs-card { padding: 24px 0; }
  .cs-card:hover { padding-left: 8px; }
  .cs-title { font-size: 22px; }
  .cs-tagline { font-size: 14px; }
  .cs-section p { font-size: 15px; }
  .cs-section ul li { font-size: 15px; }
  .finding-card { padding: 24px 0; }
  .finding-card h2 { font-size: 22px; }
  .finding-block p { font-size: 15px; }
  .finding-block ul li { font-size: 15px; }
  .footer-links { flex-direction: column; gap: 16px; align-items: center; }
  .footer-link { font-size: 13px; }
  .site-footer { padding: 32px 0; }
  .project-detail { padding: 0 0 56px; }
  .project-detail .back-link { margin-bottom: 24px; }
  .xp-content { padding: 0 0 56px; }
  .projects-grid { padding: 0 0 56px; }
  .cs-grid { padding: 0 0 56px; }
  .findings-grid { padding: 0 0 56px; }
}

@media (max-width: 480px) {
  .hero { padding: 32px 0 40px; }
  .hero-name { font-size: 36px; }
  .hero-pfp { width: 80px; height: 80px; margin-bottom: 20px; }
  .social-links { flex-direction: column; gap: 14px; }
  .page-header h1 { font-size: 26px; }
  .project-card-title { font-size: 20px; }
  .project-card-tagline { font-size: 14px; }
  .cs-title { font-size: 20px; }
  .finding-card h2 { font-size: 20px; }
  .modal-content { padding: 20px 16px; }
  .modal-title { font-size: 22px; }
  .modal-overlay { padding: 24px 12px; }
  .modal-tagline { font-size: 14px; margin-bottom: 20px; padding-bottom: 16px; }
  .modal-section { margin-bottom: 20px; }
  .project-detail { padding: 0 0 40px; }
  .xp-content { padding: 0 0 40px; }
  .projects-grid { padding: 0 0 40px; }
  .cs-grid { padding: 0 0 40px; }
  .findings-grid { padding: 0 0 40px; }
}

@media (max-width: 400px) {
  .hero { padding: 24px 0 32px; }
  .hero-name { font-size: 30px; }
  .hero-pfp { width: 68px; height: 68px; margin-bottom: 16px; }
  .hero-headline { font-size: 14px; padding-left: 12px; }
  .hero-about { font-size: 14px; }
  .social-link { font-size: 12px; gap: 6px; }
  .social-link svg { width: 14px; height: 14px; }
  .container { padding: 0 12px; }
  .header-inner { padding: 0 12px; }
  .modal-content { padding: 16px 12px; }
  .modal-title { font-size: 19px; }
  .project-card-title { font-size: 18px; }
  .cs-title { font-size: 18px; }
  .finding-card h2 { font-size: 18px; }
  .modal-overlay { padding: 16px 8px; }
  .project-card { padding: 20px 0; }
  .cs-card { padding: 20px 0; }
  .finding-card { padding: 20px 0; }
  .hero-headline { margin-bottom: 16px; }
  .hero-about { margin-bottom: 24px; }
  .page-header { padding: 24px 0 20px; margin-bottom: 24px; }
}

@media (hover: none) {
  .project-card:hover, .cs-card:hover { padding-left: 0; }
  .project-card::after, .cs-card::after { display: none; }
  .project-card { cursor: default; }
  .cs-card { cursor: default; }
}

@media (min-width: 901px) and (max-width: 1024px) {
  .container { padding: 0 32px; }
  .header-inner { padding: 0 32px; }
  .hero-name { font-size: clamp(52px, 7vw, 72px); }
}
