:root {
  --navy-900: #0a1628;
  --navy-800: #0e1f38;
  --accent: #38bdf8;
  --accent-dim: #7dd3fc;
  --ink: #0f172a;
  --muted: #51677e;
  --muted-soft: #64748b;
  --line: #e2e8f0;
  --bg: #fbfcfe;
  --header-bg: rgba(251, 252, 254, 0.9);
  --wrap: 1180px;
}

html[data-theme="dark"] {
  --ink: #f5f8fc;
  --muted: #9db2c8;
  --muted-soft: #7488a0;
  --line: rgba(255, 255, 255, 0.12);
  --bg: #060d1a;
  --header-bg: rgba(6, 13, 26, 0.85);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  font-family: "Sora", "Inter", sans-serif;
  margin: 0;
  line-height: 1.15;
}

p { margin: 0; }

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

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

.accent { color: var(--accent); }

.ext {
  font-size: 0.75em;
  vertical-align: 2px;
}

.dash {
  display: block;
  width: 32px;
  height: 3px;
  background: var(--accent);
  margin-top: 14px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink);
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--accent); }

.site-nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle svg { width: 17px; height: 17px; }

.theme-toggle .icon-sun { display: none; }

html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

/* Hero */

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  overflow: hidden;
  padding: 88px 0;
}

.hero--full {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  display: flex;
  align-items: center;
}

.hero--full .hero-inner { width: 100%; }

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg canvas { display: block; }

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  align-items: center;
  gap: 24px;
}

.hero-side {
  color: rgba(148, 197, 227, 0.8);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.9;
}

.hero-side-right { text-align: right; }

.hero-side .dash { width: 28px; height: 2px; background: var(--accent-dim); }

.hero-side-right .dash { margin-left: auto; }

.hero-main {
  text-align: center;
}

.hero-main h1 {
  color: #fff;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 700;
}

.hero-sub {
  margin-top: 22px;
  color: rgba(203, 224, 240, 0.85);
  font-size: 1.05rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-kicker {
  display: block;
  color: rgba(148, 197, 227, 0.8);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 16px;
}

/* Hero variant: left-aligned copy with a breadcrumb kicker (Projects page) */
.hero--projects .hero-main {
  text-align: left;
}

.hero--projects .hero-sub {
  margin-left: 0;
  margin-right: 0;
  max-width: 620px;
}

/* About */

.about { padding: 96px 0; }

.kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted-soft);
  margin-bottom: 24px;
}

.kicker-group .kicker { margin-bottom: 0; }
.kicker-group .dash { margin-top: 10px; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 64px;
}

.about-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  align-items: flex-start;
}

.avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
  flex-shrink: 0;
}

.about-text h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 22px;
  position: relative;
}

.about-text p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 560px;
}

.about-links {
  border-left: 1px solid var(--line);
  padding-left: 44px;
}

.about-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.15s ease;
}

.about-links a:hover { color: var(--accent); }

.icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-900);
  color: #fff;
  flex-shrink: 0;
}

.icon-badge i { font-size: 16px; line-height: 1; }

/* Writing / Projects split */

.split {
  border-top: 1px solid var(--line);
  padding: 80px 0 96px;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.split-col {
  padding: 0 48px;
}

.split-col:first-child {
  padding-left: 0;
  border-right: 1px solid var(--line);
}

.split-col:last-child {
  padding-right: 0;
}

.split-col h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.split-col p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 420px;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
}

.text-link:hover { color: var(--ink); border-color: var(--ink); }

/* Selected work (Projects page) */

.work { padding: 96px 0 40px; }

.work-list {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.work-item {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.work-item h3 {
  font-size: 1.7rem;
  font-weight: 700;
}

.work-item p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 460px;
}

.work-item .text-link {
  margin-top: 0;
  white-space: nowrap;
  justify-self: end;
}

.closing-note {
  padding: 40px 0 100px;
}

.closing-note h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.closing-note p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 20px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted-soft);
}

/* Responsive */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }
  .hero-side { display: none; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-links {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 36px;
  }
  .about-body {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .avatar { margin: 0 auto; }
  .about-text p { margin-left: auto; margin-right: auto; }

  .split-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .split-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 48px;
  }
  .split-col { padding: 0; }

  .hero--projects .hero-main { text-align: center; }
  .hero--projects .hero-sub { margin-left: auto; margin-right: auto; }

  .work-item {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }
  .work-item .text-link { justify-self: start; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }

  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: flex; }

  .hero { padding: 64px 0; }
  .about { padding: 64px 0; }
  .split { padding: 56px 0 64px; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* Dark mode component overrides */

html[data-theme="dark"] .site-nav a { color: var(--muted); }
html[data-theme="dark"] .site-nav a.active { color: #fff; }
html[data-theme="dark"] .site-nav a:hover { color: var(--accent); }
