@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,300;1,9..144,400;1,9..144,600&family=Epilogue:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:        #F9F8F5;
  --bg-raised: #FFFFFF;
  --rule:      #E2E0DA;
  --surface:   #EDECE8;
  --text:      #111110;
  --text-2:    #3A3935;
  --muted:     #79776E;
  --faint:     #B0AEA7;
  --gray:      #6B6B6B;
  --accent:    #5A5A5A;     
  --accent-lt: #E8E7E3;
  --red:       #C0392B;    
  --ink:       #111110;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Epilogue', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  20px;
  --space-lg:  40px;
  --space-xl:  80px;
  --space-2xl: 140px;

  --radius-sm:   4px;
  --radius-md:   12px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.10);
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

/* ── Ruled background texture ───────────────────────── */
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 27px,
    rgba(0,0,0,0.028) 27px,
    rgba(0,0,0,0.028) 28px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--rule);
  position: relative;
}

/* ── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}

h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: var(--space-lg); }
h3 { font-size: 1.3rem; margin-bottom: var(--space-sm); }

p { color: var(--text-2); max-width: 60ch; line-height: 1.72; }

a { color: inherit; text-decoration: none; transition: color var(--transition); }

/* ── Section Label ──────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: var(--space-md);
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 24px;
  position: relative;
  z-index: 10;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.04em;
}

.logo span {
  color: var(--red);
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-blog-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text) !important;
  border: 1px solid var(--rule);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: background var(--transition), border-color var(--transition) !important;
}

.nav-blog-btn:hover {
  background: var(--text) !important;
  color: var(--bg) !important;
  border-color: var(--text) !important;
}

.nav-blog-btn::after { display: none !important; }

/* ── Button ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}

.btn:hover {
  background: transparent;
  color: var(--text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--text);
  color: var(--bg);
}

/* ── HERO ───────────────────────────────────────────── */
header#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl) 0 var(--space-2xl);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 8vw, 7rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero-name em {
  font-style: italic;
  font-weight: 300;
  color: var(--gray);
}

.hero-role {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-2);
  max-width: 36ch;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── Blob ───────────────────────────────────────────── */
.hero-blob-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.blob-frame {
  position: relative;
  width: 380px;
  height: 420px;
}

.blob-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
  animation: blob-drift 9s ease-in-out infinite;
  filter: grayscale(20%) contrast(1.05);
  display: block;
}

.blob-ring {
  position: absolute;
  inset: -10px;
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
  border: 1px solid var(--rule);
  animation: blob-drift 9s ease-in-out infinite reverse;
  opacity: 0.7;
}

.blob-ring-2 {
  position: absolute;
  inset: -22px;
  border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%;
  border: 1px solid var(--surface);
  animation: blob-drift 12s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes blob-drift {
  0%   { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
  20%  { border-radius: 44% 56% 60% 40% / 48% 60% 40% 52%; }
  40%  { border-radius: 56% 44% 38% 62% / 54% 38% 62% 46%; }
  60%  { border-radius: 40% 60% 54% 46% / 42% 54% 46% 58%; }
  80%  { border-radius: 58% 42% 44% 56% / 58% 46% 54% 42%; }
  100% { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
}

/* ── SKILLS CLOUD ───────────────────────────────────── */
.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
  align-items: baseline;
  line-height: 1;
  position: relative;
}

.skill-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  cursor: default;
  transition: all var(--transition);
}

.skill-name {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text);
  transition: all var(--transition);
  white-space: nowrap;
}

/* Size variants */
.skill-item.sz-xl .skill-name { font-size: 2.6rem; color: var(--text); }
.skill-item.sz-lg .skill-name { font-size: 1.8rem; color: var(--text-2); }
.skill-item.sz-md .skill-name { font-size: 1.2rem; color: var(--gray); }
.skill-item.sz-sm .skill-name { font-size: 0.85rem; color: var(--faint); }

.skill-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  max-width: 24ch;
  text-align: center;
  line-height: 1.4;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.skill-item:hover .skill-name {
  color: var(--text) !important;
  transform: scale(1.08);
}

.skill-item:hover .skill-desc {
  max-height: 60px;
  opacity: 1;
  margin-top: 6px;
}

/* ── PROJECTS ───────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
}

.project-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: background var(--transition);
  cursor: default;
}

.project-entry:first-child { border-top: 1px solid var(--rule); }

.project-meta { display: flex; flex-direction: column; gap: 10px; }

.project-code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.project-entry h3 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  transition: color var(--transition);
}


.project-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.65;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.stack-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  transition: background var(--transition), color var(--transition);
}

.project-entry:hover .stack-tag {
  background: var(--accent-lt);
  color: var(--text-2);
}

.project-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
  margin-top: 6px;
}

.project-link:hover { color: var(--text); }
.project-link::after { content: '↗'; font-size: 10px; }

.project-number {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 600;
  color: var(--rule);
  line-height: 1;
  letter-spacing: -0.04em;
  user-select: none;
  transition: color var(--transition);
  align-self: center;
}

.project-entry:hover .project-number { color: var(--surface); }

/* ── ABOUT ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.about-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 52ch;
  color: var(--text-2);
  margin-bottom: var(--space-md);
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-top: 6px;
}

.about-stat {
  border-left: 2px solid var(--rule);
  padding-left: var(--space-md);
}

.about-stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}

.about-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ── CONTACT ────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.contact-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-intro h2 { margin-bottom: 0; }

.contact-intro p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 40ch;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
}

.social-link:hover { color: var(--text); }

.social-link-arrow {
  font-size: 11px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
}

.social-link:hover .social-link-arrow {
  opacity: 1;
  transform: translateX(0);
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#contact-form input::placeholder,
#contact-form textarea::placeholder { color: var(--faint); }

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: var(--gray);
  box-shadow: 0 0 0 3px rgba(107,107,107,0.08);
}

#contact-form textarea { min-height: 130px; resize: vertical; }
#contact-form button { align-self: flex-start; margin-top: 4px; }

/* ── FOOTER ─────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  max-width: none;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  transition: color var(--transition);
  letter-spacing: 0.04em;
}

.footer-links a:hover { color: var(--text); }

/* ── BLOG LIST PAGE ─────────────────────────────────── */
.blog-hero {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-xl);
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: var(--space-md);
}

.blog-hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 46ch;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.blog-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  transform-style: preserve-3d;
  cursor: pointer;
  will-change: transform;
}

.blog-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

.blog-read-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  margin-left: auto;
}

.blog-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0;
  color: var(--text);
  transition: color var(--transition);
}

.blog-card:hover h2 { color: var(--gray); }

.blog-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  max-width: none;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.blog-read-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.blog-read-link:hover { color: var(--text); }
.blog-read-link::after { content: '→'; font-size: 13px; }

/* ── BLOG POST PAGE ─────────────────────────────────── */
.post-header {
  padding: var(--space-xl) 0 var(--space-lg);
  max-width: 760px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-xl);
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--space-lg);
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-md);
}

.post-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.65;
}

.post-body {
  max-width: 680px;
  margin: 0 auto var(--space-2xl);
}

.post-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-2);
  max-width: none;
  margin-bottom: var(--space-md);
}

.post-body h2 {
  font-size: 1.8rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.post-body h3 {
  font-size: 1.25rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.post-body blockquote {
  border-left: 2px solid var(--text);
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  margin: var(--space-lg) 0;
}

.post-body blockquote p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text);
  font-weight: 300;
}

.post-body pre {
  background: var(--text);
  color: var(--bg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
}

.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-body ul, .post-body ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--text-2);
}

.post-body li { margin-bottom: 6px; line-height: 1.75; }

.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-xl) 0;
}

/* Post nav (back link) */
.post-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
  margin-bottom: var(--space-lg);
}

.post-nav:hover { color: var(--text); }
.post-nav::before { content: '←'; }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-lg);
    padding: var(--space-lg) 0 var(--space-xl);
  }

  .hero-blob-wrap { order: -1; }
  .hero-text { align-items: center; }
  .blob-frame { width: 260px; height: 280px; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-lg); }

  .project-entry { grid-template-columns: 1fr; }

  .project-number { display: none; }

  .footer { flex-direction: column; gap: var(--space-md); text-align: center; }
}

@media (max-width: 600px) {
  .container { padding: 0 var(--space-md); }

  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }

  .hero-name { font-size: clamp(3rem, 14vw, 5rem); }
  .blob-frame { width: 220px; height: 240px; }

  .skills-cloud { gap: 4px 0; }
  .skill-item { padding: 6px 10px; }

  .blog-grid { grid-template-columns: 1fr; }

  .space-2xl { padding: var(--space-xl) 0; }
}
