
:root {
  --bg: #f3f4f6;
  --bg-alt: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.06);
}

/* Dark theme overrides */
:root[data-theme="dark"] {
  --bg: #020617;
  --bg-alt: #020617;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --border: #1e293b;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.25), transparent 45%), var(--bg);
  color: var(--text);
  line-height: 1.6;
}

:root[data-theme="dark"] body {
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.3), transparent 55%), #020617;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Header / Navigation */

.header-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

:root[data-theme="dark"] .header-shell {
  background: rgba(15, 23, 42, 0.92);
  border-bottom-color: rgba(30, 64, 175, 0.8);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  max-width: 1120px;
  margin: 0 auto;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.brand span {
  font-size: 1.05rem;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  position: relative;
  padding-bottom: 0.15rem;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.18s ease-out;
}

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

.nav a:hover::after {
  width: 100%;
}

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

.nav a.active::after {
  width: 100%;
}

/* Theme toggle */

.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle span {
  font-size: 0.95rem;
}

.theme-toggle-icon {
  font-size: 0.92rem;
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.08);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
}

/* Mobile header */

@media (max-width: 720px) {
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-inline: 1.25rem;
  }
  .nav-row {
    justify-content: space-between;
  }
  .nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* Layout & cards */

main {
  margin-top: 1.25rem;
}

.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.card {
  background: var(--bg-alt);
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.5rem;
}

:root[data-theme="dark"] .card {
  border-color: rgba(30, 64, 175, 0.7);
}

.card + .card {
  margin-top: 1.25rem;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
}

h1, h2, h3 {
  line-height: 1.25;
}

h1 {
  font-size: 2.1rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
  margin-top: 1.1rem;
  margin-bottom: 0.35rem;
}

/* Button */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
  text-decoration: none;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.32);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Home hero */

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 1.8rem;
  align-items: stretch;
}

.hero-main {
  background: var(--bg-alt);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 1.8rem;
  position: relative;
  overflow: hidden;
}

.hero-main::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 62%);
  pointer-events: none;
}

:root[data-theme="dark"] .hero-main::before {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.28), transparent 65%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed rgba(148, 163, 184, 0.7);
  margin-bottom: 0.8rem;
}

.hero-kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

.hero-main h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.hero-main .sub {
  max-width: 34rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.hero-tag {
  font-size: 0.78rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
}

:root[data-theme="dark"] .hero-tag {
  color: #bfdbfe;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-aside-card {
  background: #020617;
  color: #e5e7eb;
  border-radius: 20px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.75);
  position: relative;
  overflow: hidden;
}

.hero-aside-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.28), transparent 65%);
  opacity: 0.7;
  pointer-events: none;
}

.hero-aside-card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
}

.hero-aside-card .meta {
  color: #cbd5f5;
}

.hero-aside-card p {
  font-size: 0.9rem;
}

.hero-aside-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: #bfdbfe;
}

.hero-aside-link::after {
  content: "→";
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .hero-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Blog grids / cards */

.post-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.4rem;
  margin-bottom: 1rem;
}

.post-section-header h2 {
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.9rem;
}

.post-card,
.post-card__legacy {
  display: block;
  background: var(--bg-alt);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.13s ease-out, box-shadow 0.13s ease-out, border-color 0.13s ease-out;
}

:root[data-theme="dark"] .post-card,
:root[data-theme="dark"] .post-card__legacy {
  border-color: rgba(30, 64, 175, 0.8);
}

.post-card:hover,
.post-card__legacy:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  border-color: #bfdbfe;
  text-decoration: none;
}

.post-card img,
.post-card__thumb img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.pc-body,
.post-card__body {
  padding: 1.05rem 1.15rem 1.1rem;
}

.pc-body h3,
.post-card__body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.pc-body .sub,
.post-card__body p {
  font-size: 0.9rem;
}

.post-card__cta {
  padding: 0 1.15rem 1.05rem;
  margin: 0;
}

.post-card__cta a {
  font-weight: 500;
  font-size: 0.9rem;
}

/* About & Resume */

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
  gap: 1.6rem;
}

@media (max-width: 880px) {
  .about-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.about-bio {
  background: var(--bg-alt);
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 1.6rem 1.7rem;
  box-shadow: var(--shadow-soft);
}

.about-bio p {
  margin-top: 0.45rem;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill {
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
}

:root[data-theme="dark"] .pill {
  background: rgba(15, 23, 42, 0.7);
}

.resume-layout section {
  margin-bottom: 1.6rem;
}

.resume-layout ul {
  padding-left: 1.05rem;
}

.resume-layout li {
  margin-bottom: 0.25rem;
}

.resume-layout h3 {
  margin-top: 0.8rem;
}

.resume-layout p em {
  color: var(--muted);
}

/* Individual post pages */

.article-shell {
  max-width: 760px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 1.4rem;
}

.article-header h1 {
  margin-bottom: 0.3rem;
}

.article-header .meta {
  font-size: 0.85rem;
}

.article-body p {
  margin-bottom: 0.9rem;
}

.article-body h2 {
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
}

/* Footer */

.footer {
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

:root[data-theme="dark"] .footer {
  border-top-color: rgba(30, 64, 175, 0.7);
}
