@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;1,9..144,600&family=DM+Mono:wght@300;400;500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;1,9..40,300&family=Playfair+Display:ital,wght@0,700;1,700&family=Cormorant+Garamond:ital,wght@0,600;1,600&family=Libre+Baskerville:ital,wght@0,700;1,700&family=Special+Elite&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Crimson+Pro:ital,wght@0,600;1,600&display=swap');

:root {
  --cream: #F8F6F1;
  --ink: #141210;
  --ink-muted: #5c5850;
  --ink-faint: #b5b2aa;
  --rule: #dedad2;
  --accent: #C8501A;
  --accent-light: #f5ede7;
  --display: 'Fraunces', serif;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --nav-h: 56px;
  --topbar-h: 44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  cursor: none;
  transition: background 0.3s ease, color 0.3s ease;
}

#cursor {
  position: fixed; top: 0; left: 0;
  width: 26px; height: 26px;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}
#cursor svg { width: 100%; height: 100%; transition: transform 0.2s ease; }
#cursor.hover svg { transform: scale(1.6); }

.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 600;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3rem;
  background: var(--ink);
  border-bottom: 0.5px solid #2a2825;
}
.top-bar-left { display: flex; align-items: center; gap: 0.75rem; }

.lang-toggle {
  display: flex;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid #3a3835;
  border-radius: 3px; overflow: hidden;
}
.lang-btn {
  padding: 5px 13px;
  text-decoration: none;
  background: transparent; border: none;
  color: #7a7870; cursor: none;
  font-family: inherit; font-size: inherit;
  letter-spacing: inherit; text-transform: inherit;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active { background: var(--accent); color: white; }
.lang-btn:not(.active):hover { background: #2a2825; color: #ccc; }

.style-btn {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 13px;
  background: transparent; color: #7a7870;
  border: 1px solid #3a3835; border-radius: 3px;
  cursor: none; transition: border-color 0.2s, color 0.2s;
}
.style-btn:hover { border-color: var(--accent); color: var(--accent); }
.style-btn-star { display: inline-block; transition: transform 0.5s ease; font-style: normal; }
.style-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #4a4845; }

.site-nav {
  position: fixed; top: var(--topbar-h); left: 0; right: 0;
  height: var(--nav-h);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3rem;
  background: var(--cream);
  border-bottom: 0.5px solid var(--rule);
}
.nav-links { display: flex; gap: 0.5rem; list-style: none; }
.nav-links li a {
  background: none; border: none;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted); cursor: none;
  padding: 0 1.5rem; line-height: var(--nav-h);
  display: block; position: relative; text-decoration: none;
  transition: color 0.2s;
}
.nav-links li a::after {
  content: ''; position: absolute; bottom: 0;
  left: 1.5rem; right: 1.5rem;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--ink); font-weight: 500; }
.nav-links li a.active::after,
.nav-links li a:hover::after { transform: scaleX(1); }

.page { padding-top: calc(var(--topbar-h) + var(--nav-h) + 3rem); min-height: 100vh; }
.container { max-width: 1060px; margin: 0 auto; padding: 0 3rem; }

.view-section { display: none; }
.view-section.active { display: block; }

.section-label {
  font-family: var(--mono);
  font-size: 13.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-weight: 500;
}
.section-label::after { content: ''; flex: 1; height: 0.5px; background: var(--rule); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 9px 18px; border-radius: 3px;
  text-decoration: none; cursor: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #a8401a; border-color: #a8401a; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: white; }

.hero { padding-bottom: 5rem; display: grid; grid-template-columns: 2fr 1fr; gap: 5rem; align-items: center; }
.hero-name { font-family: var(--display); font-size: clamp(38px, 5.5vw, 56px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 1rem; margin-top: 1rem; }
.hero-name em { font-style: italic; font-weight: 300; color: var(--ink-muted); }
.hero-tagline { font-size: 16px; line-height: 1.75; color: var(--ink-muted); margin-bottom: 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-right { display: flex; justify-content: flex-end; }

.photo-frame { width: 170px; height: 210px; background: var(--rule); border-radius: 4px; position: relative; overflow: hidden; flex-shrink: 0; }
.photo-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #ece9e2; }
.photo-placeholder svg { width: 36px; height: 36px; opacity: 0.3; stroke: var(--accent); }
.photo-placeholder span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.photo-frame::after { content: ''; position: absolute; bottom: -2px; right: -2px; width: 24px; height: 24px; background: var(--accent); border-radius: 50%; opacity: 0.75; }

.about-section { padding: 4rem 0; border-top: 0.5px solid var(--rule); }
.about-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 4rem; align-items: start; }

.quick-facts { margin-top: 0.5rem; }
.fact-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 0.5px solid var(--rule); padding: 0.7rem 0; font-size: 13px; }
.fact-row:last-child { border-bottom: 0.5px solid var(--rule); }
.fact-key { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.fact-val { color: var(--ink-muted); }
.about-body { font-size: 15px; line-height: 1.85; color: var(--ink-muted); }
.about-body p + p { margin-top: 1.2em; }

.page-header { padding-bottom: 3rem; border-bottom: 0.5px solid var(--rule); margin-bottom: 4rem; }
.page-header h1 { font-family: var(--display); font-size: clamp(38px, 6vw, 62px); font-weight: 600; letter-spacing: -0.025em; line-height: 1; margin-bottom: 0.75rem; }
.page-header h1 em { font-style: italic; font-weight: 300; color: var(--accent); }
.page-header p { font-size: 15px; color: var(--ink-muted); max-width: 500px; line-height: 1.75; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; margin-bottom: 5rem; }
.project-card { border: 0.5px solid var(--rule); border-radius: 4px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color 0.2s, box-shadow 0.2s; }
.project-card:hover { border-color: var(--accent); box-shadow: 0 4px 24px rgba(200,80,26,0.06); }
.project-screenshot { aspect-ratio: 16/10; background: var(--rule); overflow: hidden; position: relative; }
.screenshot-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: #ece9e2; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.screenshot-placeholder svg { width: 32px; height: 32px; opacity: 0.3; stroke: var(--accent); }

.project-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.project-tech { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.project-title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 0.6rem; }
.project-desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.7; flex: 1; }
.projects-links { margin-top: 1.25rem; display: flex; gap: 0.6rem; }
.project-link { font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-muted); text-decoration: none; transition: border-color 0.2s, color 0.2s; }
.project-link:hover { border-color: var(--accent); color: var(--accent); }
.project-link.code { border-color: var(--accent); color: var(--accent); }
.project-link.code:hover { background: var(--accent); color: white; }

.articles-section { padding: 4rem 0; border-top: 0.5px solid var(--rule); }
.article-item { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: baseline; border-top: 0.5px solid var(--rule); padding: 1.5rem 0; text-decoration: none; color: inherit; transition: background 0.15s; }
.article-item:last-child { border-bottom: 0.5px solid var(--rule); }
.article-item:hover .article-title { color: var(--accent); }
.article-pub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.article-title { font-family: var(--display); font-size: clamp(18px, 2.5vw, 24px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 0.4rem; transition: color 0.2s; }
.article-desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.65; max-width: 580px; }
.article-arrow { font-family: var(--display); font-size: 22px; color: var(--ink-faint); transition: transform 0.2s, color 0.2s; flex-shrink: 0; }
.article-item:hover .article-arrow { transform: translate(3px,-3px); color: var(--accent); }

.cv-header-block { padding-bottom: 2rem; border-bottom: 0.5px solid var(--rule); margin-bottom: 3.5rem; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.cv-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 5rem; align-items: start; }
.cv-section { margin-bottom: 3.5rem; }
.cv-entry { border-top: 0.5px solid var(--rule); padding: 1.4rem 0; }
.cv-entry:last-child { border-bottom: 0.5px solid var(--rule); }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 4px; }
.entry-title { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.entry-period { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); flex-shrink: 0; }
.entry-org { font-size: 13px; color: var(--ink-muted); margin-bottom: 6px; font-style: italic; }
.entry-desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.7; }

.skill-group { margin-bottom: 1.75rem; }
.skill-group-name { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.75rem; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 5px 10px; border: 0.5px solid var(--rule); border-radius: 2px; color: var(--ink-muted); background: white; }
.pdf-block { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pdf-disclaimer { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }

.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 6rem; align-items: start; padding-bottom: 6rem; }
.contact-left h1 { font-family: var(--display); font-size: clamp(38px, 6vw, 62px); font-weight: 600; letter-spacing: -0.025em; line-height: 1; margin-bottom: 1.25rem; }
.contact-left h1 em { font-style: italic; font-weight: 300; color: var(--accent); }
.contact-left p { font-size: 15px; color: var(--ink-muted); line-height: 1.8; max-width: 400px; margin-bottom: 2.5rem; }

.email-block { margin-bottom: 2.5rem; }
.email-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.5rem; }
.email-link { font-family: var(--display); font-size: clamp(20px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; transition: color 0.2s; display: inline-block; }
.email-link:hover { color: var(--accent); }

.social-grid { display: flex; flex-direction: column; gap: 0; }
.social-row { display: flex; align-items: center; justify-content: space-between; border-top: 0.5px solid var(--rule); padding: 1rem 0; text-decoration: none; color: inherit; transition: padding-left 0.2s; }
.social-row:last-child { border-bottom: 0.5px solid var(--rule); }
.social-row:hover { padding-left: 8px; }
.social-row:hover .social-name { color: var(--accent); }
.social-left { display: flex; align-items: center; gap: 12px; }
.social-icon { width: 32px; height: 32px; background: var(--accent-light); border-radius: 3px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.social-icon svg { width: 15px; height: 15px; fill: var(--accent); }
.social-name { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; transition: color 0.2s; }
.social-handle { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint); }
.social-arrow { font-size: 18px; color: var(--ink-faint); transition: transform 0.2s, color 0.2s; }
.social-row:hover .social-arrow { transform: translate(3px, -3px); color: var(--accent); }

.avail-card { border: 0.5px solid var(--rule); border-radius: 4px; padding: 2rem; margin-bottom: 2rem; position: relative; overflow: hidden; }
.avail-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.avail-status { display: flex; align-items: center; gap: 8px; margin-bottom: 1rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ECC71; flex-shrink: 0; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-text { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.avail-title { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.5rem; }
.avail-desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.response-note { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 1.5rem; padding-top: 1.5rem; border-top: 0.5px solid var(--rule); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  .top-bar { padding: 0 1.5rem; }
  .style-label { display: none; }
  .site-nav { padding: 0 1.5rem; }
  .container { padding: 0 1.5rem; }
  .page { padding-top: calc(var(--topbar-h) + var(--nav-h) + 2rem); }
  .hero { grid-template-columns: 1fr; gap: 3rem; }
  .hero-right { justify-content: flex-start; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .cv-grid { grid-template-columns: 1fr; gap: 0; }
  .cv-header-block { flex-direction: column; align-items: flex-start; }
  .pdf-block { align-items: flex-start; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
}