/* === Variables === */
:root {
  --bg: #f5f4f0;
  --bg-light: #eceae4;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #999;
  --border: #ddd;
  --border-light: #e8e6e1;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --max-width: 1200px;
  --section-pad: clamp(80px, 10vh, 140px);
  --side-pad: clamp(24px, 5vw, 60px);
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-weight: 300;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
strong { font-weight: 500; }
em { font-family: var(--font-display); font-style: italic; }

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--side-pad);
  transition: all 0.4s;
}
.nav.scrolled {
  background: rgba(245, 244, 240, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  z-index: 101;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  position: absolute;
  left: 0;
  transition: all 0.3s;
}
.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }
.nav-toggle.active span:first-child { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.active span:last-child { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(245, 244, 240, 0.98);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.mobile-menu a:hover { color: var(--text); }

/* === Hero === */
.hero {
  padding: 140px var(--side-pad) 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.hero-split {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.hero-intro {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero-name em {
  font-weight: 300;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 440px;
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-links a {
  display: inline-block;
  padding: 10px 24px;
  border: 1px solid var(--text);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: all 0.3s;
}
.hero-links a:hover {
  background: var(--text);
  color: var(--bg);
}

.hero-images {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
.hero-img {
  overflow: hidden;
  border-radius: 4px;
}
.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-img:hover img { transform: scale(1.04); }
.hero-img-main {
  grid-row: span 2;
  min-height: 480px;
}
.hero-img-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero-img-sm {
  height: 232px;
}

/* === Sections === */
.section {
  padding: var(--section-pad) var(--side-pad);
}
.section-light {
  background: var(--bg-light);
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-label {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 48px;
}
.section-intro {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 500px;
}

/* === Fade === */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === About === */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.35;
}
.about-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.75;
}
.about-details {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail {
  display: flex;
  gap: 20px;
}
.detail-label {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}
.detail-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* === Experience === */
.exp-list {
  display: flex;
  flex-direction: column;
}
.exp-item {
  padding: 40px 0;
  border-bottom: 1px solid var(--border-light);
}
.exp-item:first-child { padding-top: 0; }
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }
.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 24px;
}
.exp-company {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
}
.exp-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.exp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.exp-bullets ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exp-bullets li {
  position: relative;
  padding-left: 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.exp-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 1px;
  background: var(--text-muted);
}

/* === Projects === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 32px;
  transition: all 0.3s;
}
.project-card:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.project-card-muted {
  background: var(--bg-light);
  border-style: dashed;
}
.project-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.project-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.3s;
}
.project-card:hover .project-link { color: var(--text); }

/* === Life === */
.section-life {
  padding-bottom: 0;
}
.life-gallery {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.life-item {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  min-height: 420px;
  border-top: 1px solid var(--border-light);
}
.life-item-reverse {
  grid-template-columns: 1fr 1.3fr;
}
.life-item-reverse .life-content { order: -1; }
.life-img {
  overflow: hidden;
}
.life-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.life-item:hover .life-img img { transform: scale(1.03); }
.life-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(32px, 5vw, 64px);
}
.life-content h3 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 400;
  margin-bottom: 16px;
}
.life-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 380px;
}

/* === Writing === */
.writing-box {
  max-width: 520px;
  padding: 56px 48px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.writing-box h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 12px;
}
.writing-box p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.writing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.writing-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === Recent Posts (homepage) === */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.recent-post-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s;
  gap: 16px;
}
.recent-post-link:first-child { padding-top: 0; }
.recent-post-link:hover { padding-left: 8px; }
.recent-post-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}
.recent-post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.recent-post-all {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.3s;
}
.recent-post-all:hover { color: var(--text); }

/* === Writing Index Page === */
.writing-index-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 48px;
  max-width: 600px;
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.post-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s;
  gap: 32px;
}
.post-list-item:first-child { border-top: 1px solid var(--border-light); }
.post-list-item:hover { padding-left: 8px; }
.post-list-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.post-list-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.post-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* === Blog Post === */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 140px var(--side-pad) var(--section-pad);
}
.post-header {
  margin-bottom: 48px;
}
.post-back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color 0.3s;
}
.post-back:hover { color: var(--text); }
.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  margin-top: 40px;
  margin-bottom: 16px;
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 32px;
  margin-bottom: 12px;
}
.post-content p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}
.post-content ul, .post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.post-content li {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
  list-style: disc;
}
.post-content strong {
  font-weight: 500;
  color: var(--text);
}
.post-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.3s;
}
.post-content a:hover { opacity: 0.6; }
.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
}
.post-content blockquote p { color: var(--text-muted); }
.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 3px;
}
.post-content pre {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.post-content img {
  width: 100%;
  border-radius: 6px;
  margin: 24px 0;
}

@media (max-width: 600px) {
  .post-list-item { flex-direction: column; gap: 8px; }
  .post-list-meta { align-items: flex-start; flex-direction: row; gap: 12px; }
  .recent-post-link { flex-direction: column; gap: 4px; }
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 32px var(--side-pad);
  margin-top: var(--section-pad);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-right {
  display: flex;
  gap: 24px;
}
.footer-right a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.3s;
}
.footer-right a:hover { color: var(--text); }

/* === Responsive === */
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-images {
    grid-template-columns: 1fr 1fr;
  }
  .hero-img-main {
    grid-row: auto;
    min-height: 300px;
  }
  .hero-img-stack {
    flex-direction: column;
  }
  .hero-img-sm { height: 140px; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .project-grid { grid-template-columns: 1fr; }
  .life-item,
  .life-item-reverse {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .life-item-reverse .life-content { order: 1; }
  .life-img { height: 280px; }
  .life-content { padding: 32px 0; }
  .exp-header { flex-direction: column; gap: 8px; }
  .exp-meta { align-items: flex-start; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu { display: flex; }
  .hero { padding-top: 100px; min-height: auto; padding-bottom: 60px; }
  .hero-images { grid-template-columns: 1fr; }
  .hero-img-main { min-height: 240px; }
  .hero-img-stack { flex-direction: row; }
  .hero-img-sm { height: 140px; flex: 1; }
  .hero-links { flex-direction: column; }
  .hero-links a { text-align: center; }
  .detail { flex-direction: column; gap: 4px; }
  .writing-box { padding: 36px 28px; }
  .footer-inner { flex-direction: column; gap: 16px; align-items: flex-start; }
  .life-gallery { padding: 0 var(--side-pad); }
}
