
/* ---- Fonts ---- */


/* ---- Root Variables (Light) ---- */
:root {
  /* brand */
  --brand: #2e2b32;          
  --brand-2: #f8f0dd;        

  /* light theme */
  --bg: #f4f2e9;
  --surface: #fffef8;
  --text: #0b1220;
  --muted: #5b6472;
  --border: #e6e7ec;
  --shadow: 0 10px 25px rgba(0,0,0,0.06);

  /* sizing */
  --radius: 16px;
  --container: 1120px;
  --pad: clamp(16px, 1.5vw, 24px);

  /* typography (fluid) */
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-hero: clamp(28px, 5vw, 56px);
  --fs-h1: clamp(24px, 3.2vw, 40px);
  --fs-h2: clamp(20px, 2.6vw, 28px);
  --fs-body: clamp(16px, 1.4vw, 18px);
  --fs-small: 14px;

  /* typewriter config */
  --typewriter-chars: 28;  /* set to length of your tagline for perfect timing */
  --typewriter-speed: 3.2s;
}

/* ---- Dark Theme Variables ---- */
:root[data-theme="dark"] {
  --bg: #030920;
  --surface: #03091e;
  --text: #f5f7fb;
  --muted: #b4bccb;
  --border: #232a3a;
  --shadow: 0 10px 25px rgba(0,0,0,0.45);
}

/* Auto-match system theme by default */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0c1118;
    --surface: #121826;
    --text: #f5f7fb;
    --muted: #b4bccb;
    --border: #232a3a;
    --shadow: 0 10px 25px rgba(0,0,0,0.45);
  }
}

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

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: rgba(59,130,246,0.25); }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.section {
  padding: clamp(24px, 4vw, 48px) 0;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(160%) blur(6px);
  background: color-mix(in oklab, var(--bg), transparent 12%);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end; 
  width: 100%
  padding-block: 16px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.nav a:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--surface), var(--border) 35%);
  transform: translateY(-1px);
}

/* toggle */
.toggle { display: inline-block; }
.toggle-btn{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}
.toggle-btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }


/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  text-align: center;
  padding-top: clamp(24px, 6vw, 72px);
}

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero__tagline {
  margin: 8px auto 0;
  max-width: 52ch;
  color: var(--muted);
}

/* Typewriter effect */
.typewriter {
  display: inline-block;
  border-right: 2px solid var(--brand);
  white-space: nowrap;
  overflow: hidden;
  animation:
    typing var(--typewriter-speed) steps(var(--typewriter-chars)) 1 both,
    caret 1s steps(1) infinite;
}
@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes caret { 50% { border-color: transparent } }

/* Hero avatar (optional) */
.avatar {
  width: clamp(96px, 18vw, 160px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin: 0 auto;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid color-mix(in oklab, var(--brand), black 8%);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
}

/* ---- Grid Utilities ---- */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

/* ---- Cards (Projects, Posts, etc.) ---- */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .15s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  /* border-color: color-mix(in oklab, var(--border), var(--brand) 12%); */
}

.card--link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .25s ease, border-color .25s ease;
}

.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--border), var(--brand) 15%);
}

.card h3 {
  margin: 0;
  font-size: var(--fs-h2);
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card .meta {
  margin-top: auto;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* ---- Section Headings ---- */
.section__title {
  font-size: var(--fs-h1);
  margin: 0 0 10px 0;
}
.section__desc {
  margin: 0 0 24px 0;
  color: var(--muted);
}

/* ---- Contact blocks ---- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

/* ---- Footer ---- */
.site-footer {
  padding-block: 40px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---- Utilities ---- */
.hide { display: none !important; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.gap-0 { gap: 0; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 14px; }
.gap-3 { gap: 20px; }

/* ---- Nice focus states ---- */
a, button, .btn, .card {
  outline: none;
}
a:focus-visible, button:focus-visible, .btn:focus-visible, .card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 60%);
  transition: box-shadow .2s ease;
}

/* Title-only font */
.major-mono-display-regular {
  font-family: "Major Mono Display", monospace !important;
  font-weight: 400;
  font-style: normal;
}

/* Base background color */
body {
  background-color: var(--bg);
  /* control images via variables per theme */
  background-image: var(--bg-images);
  background-repeat: no-repeat;
  /* Left-bottom and right-center */
  background-position: left -24px bottom -24px, right -12px center;
  background-size: clamp(160px, 22vw, 320px), clamp(160px, 22vw, 320px);
}

/* --- LIGHT THEME --- */
:root:not([data-theme]),           
:root[data-theme="light"] body::before {
  background-image: url("assets/bg/leaf-left.svg"), url("assets/bg/leaf-right.svg");
}

/* --- DARK THEME --- */
:root[data-theme="dark"] .sky {
  position: fixed;
  inset: 0;
  z-index: -1;           /* behind everything */
  pointer-events: none;  /* never blocks clicks */
  background-color: #1f1e25; /* dark base for space */
}

/* Soft glowing moon in the upper-right */
:root[data-theme="dark"] .sky::after {
  content: "";
  position: absolute;
  top: 40px;
  right: 24px;
  width: clamp(80px, 12vw, 140px);
  height: clamp(80px, 12vw, 140px);
  border-radius: 50%;
  /* two glows + bright core */
  background:
    radial-gradient(circle at 50% 50%, rgba(255,243,204,0.95) 0 58%, rgba(255,243,204,0) 62%),
    radial-gradient(circle at 50% 50%, rgba(255,230,140,0.45) 0 70%, rgba(255,230,140,0) 75%),
    radial-gradient(circle at 60% 40%, #ffe6a0 0 52%, #ffe6a0 52%); /* body */
  filter: drop-shadow(0 0 24px rgba(255,230,140,0.35))
          drop-shadow(0 0 48px rgba(255,230,140,0.2));
  opacity: 0.95;
}

/* A handful of bigger, soft yellow "bubbly" stars that float a bit */
:root[data-theme="dark"] .sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(255,236,170,0.9) 0 3px, transparent 4px) 12% 35% / auto no-repeat,
    radial-gradient(circle, rgba(255,236,170,0.8) 0 4px, transparent 5px) 32% 72% / auto no-repeat,
    radial-gradient(circle, rgba(255,236,170,0.85) 0 5px, transparent 6px) 68% 22% / auto no-repeat,
    radial-gradient(circle, rgba(255,236,170,0.8) 0 4px, transparent 5px) 82% 64% / auto no-repeat;
  animation: float-slow 14s ease-in-out infinite alternate;
  opacity: 0.9;
  pointer-events: none;
}

/* Gentle motion + slight twinkle */
@keyframes float-slow {
  from { transform: translateY(0px); }
  to   { transform: translateY(8px); }
}
@keyframes twinkle {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.08); }
}
