:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e7e3dc;
  --accent: #ff5a3c;
  --accent-2: #6c5ce7;
  --ring: rgba(108, 92, 231, 0.35);
  --shadow: 0 10px 40px rgba(20, 20, 20, 0.08);
  --radius: 18px;
  --max: 1080px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #f2f2f0;
  --muted: #a3a7b0;
  --border: #262a33;
  --accent: #ff6b4f;
  --accent-2: #8b7bff;
  --ring: rgba(139, 123, 255, 0.4);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

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

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; letter-spacing: 0.5px;
}
.brand-name { font-size: 16px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 15px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 10px;
  width: 38px; height: 38px; cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { transform: rotate(-12deg); border-color: var(--accent-2); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-2); }
.btn-lg { padding: 16px 30px; font-size: 17px; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  padding: 80px 24px 96px;
}
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 12px; }
.hero h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: clamp(44px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 20px;
}
.lead { color: var(--muted); font-size: 19px; max-width: 46ch; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.socials { display: flex; gap: 20px; list-style: none; }
.socials a { color: var(--muted); font-size: 14px; font-weight: 500; position: relative; }
.socials a:hover { color: var(--text); }
.socials a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1.5px;
  background: var(--accent); transition: width 0.25s;
}
.socials a:hover::after { width: 100%; }

.hero-visual { position: relative; display: grid; place-items: center; }
.avatar {
  position: relative; z-index: 2; width: 300px; height: 300px; border-radius: 28px;
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.55; z-index: 1; }
.blob-1 { width: 220px; height: 220px; background: var(--accent); top: -20px; right: 10px; }
.blob-2 { width: 200px; height: 200px; background: var(--accent-2); bottom: -10px; left: 0; }

/* Sections */
.section { padding: 72px 24px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 36px; }
.section-index { color: var(--accent); font-family: "Fraunces", serif; font-size: 18px; }
.section-head h2 {
  font-family: "Fraunces", serif; font-weight: 600; font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.01em;
}

/* About */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.about-copy p { color: var(--muted); font-size: 18px; margin-bottom: 18px; }
.about-copy a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin-top: 8px; }
.tags li {
  font-size: 14px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.about-card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 18px; }
.about-card dl div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.about-card dl div:last-child { border-bottom: 0; }
.about-card dt { color: var(--muted); }
.about-card dd { font-weight: 600; text-align: right; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-media { height: 160px; }
.media-a { background: linear-gradient(135deg, #ff5a3c, #ffb347); }
.media-b { background: linear-gradient(135deg, #6c5ce7, #00cec9); }
.media-c { background: linear-gradient(135deg, #fd79a8, #a29bfe); }
.card-body { padding: 22px; }
.card-body h3 { font-size: 20px; margin-bottom: 8px; }
.card-body p { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.card-tags { display: flex; gap: 8px; margin-bottom: 16px; }
.card-tags span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.card-link { color: var(--accent-2); font-weight: 600; font-size: 15px; }

/* Writing */
.posts { list-style: none; }
.post { border-bottom: 1px solid var(--border); }
.post a { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 22px 4px; align-items: baseline; transition: padding-left 0.2s; }
.post a:hover { padding-left: 14px; }
.post-date { color: var(--muted); font-size: 14px; }
.post-title { font-size: 19px; font-weight: 600; }
.post-excerpt { grid-column: 2; color: var(--muted); font-size: 15px; }

/* Contact */
.contact { text-align: center; padding-bottom: 96px; }
.contact .section-head { justify-content: center; }
.contact-lead { color: var(--muted); font-size: 19px; max-width: 44ch; margin: 0 auto 28px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.footer-inner a:hover { color: var(--text); }

/* Reveal animation */
.section, .hero-text, .hero-visual { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.is-visible { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section, .hero-text, .hero-visual { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 48px; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-actions, .socials { justify-content: center; }
  .hero-visual { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column;
    gap: 0; background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 380px; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links li a { display: block; padding: 16px; width: 100%; }
  .theme-toggle { margin: 12px auto; }
}

@media (max-width: 560px) {
  .post a { grid-template-columns: 1fr; gap: 4px; }
  .post-excerpt { grid-column: 1; }
  .avatar { width: 240px; height: 240px; }
}
