/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root { --tr: background .4s ease, color .4s ease, border-color .4s ease; }

[data-theme="dark"] {
  --bg: #000000;
  --bg-gradient: radial-gradient(125% 125% at 50% 100%, #000000 40%, #010133 100%);
  --bg-image: none;
  --surface: #0D0C1A; --surface-2: #13122A; --surface-3: #1A1836;
  --border: rgba(255,255,255,0.07); --border-h: rgba(255,255,255,0.15);
  --t1: #ECEAF6; --t2: #7E7A96; --t3: #46425E;
  --accent: #A0714F; --adim: rgba(160,113,79,0.12); --adim2: rgba(160,113,79,0.24);
  --orange: #C97B3A; --odim: rgba(201,123,58,0.12);
  --violet: #a597e8; --vdim: rgba(165,151,232,0.13);
  --green: #5de898; --gdim: rgba(93,232,152,0.11); --gborder: rgba(93,232,152,0.28);
  --shadow: 0 4px 28px rgba(0,0,0,0.65);
  --dbg: #08080F; --dborder: rgba(160,113,79,0.18); --dglow: rgba(160,113,79,0.20);
  --cover-overlay: rgba(8,7,18,0.38);
  --cover-bg: #0c0b14;
  --tw-static-color: rgba(255,255,255,0.38);
  --tw-text-color: #ffffff;
  --tw-cursor-color: #ffffff;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-gradient: none;
  --bg-image:
    repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(75,85,99,0.06) 5px, rgba(75,85,99,0.06) 6px, transparent 6px, transparent 15px),
    repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(75,85,99,0.06) 5px, rgba(75,85,99,0.06) 6px, transparent 6px, transparent 15px),
    repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(107,114,128,0.04) 10px, rgba(107,114,128,0.04) 11px, transparent 11px, transparent 30px),
    repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(107,114,128,0.04) 10px, rgba(107,114,128,0.04) 11px, transparent 11px, transparent 30px);
  --surface: #ffffff; --surface-2: #ede9e0; --surface-3: #e2ddd3;
  --border: rgba(0,0,0,0.08); --border-h: rgba(0,0,0,0.18);
  --t1: #1a1814; --t2: #6b6860; --t3: #aaa89e;
  --accent: #8a6e3e; --adim: rgba(138,110,62,0.09); --adim2: rgba(138,110,62,0.2);
  --orange: #C97B3A; --odim: rgba(201,123,58,0.09);
  --violet: #5c4eb8; --vdim: rgba(92,78,184,0.09);
  --green: #1a7a4a; --gdim: rgba(26,122,74,0.09); --gborder: rgba(26,122,74,0.22);
  --shadow: 0 4px 24px rgba(0,0,0,0.09);
  --dbg: #f8f4ed; --dborder: rgba(0,0,0,0.1); --dglow: rgba(138,110,62,0.12);
  --cover-overlay: rgba(255,255,255,0.72);
  --cover-bg: #f0ece4;
  --tw-static-color: rgba(0,0,0,0.38);
  --tw-text-color: #1a1814;
  --tw-cursor-color: #1a1814;
}


/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  opacity: 0;
  background-color: var(--bg);
  background-image: var(--bg-gradient, var(--bg-image, none));
  background-attachment: fixed;
  color: var(--t1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: var(--tr);
}
body.home-page { display: flex; flex-direction: column; }
html.home-page { height: 100%; }
body.inner-page { min-height: 100vh; display: flex; flex-direction: column; }


/* ═══════════════════════════════════════════
   NAV
═══════════════════════════════════════════ */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; flex-shrink: 0;
}
.nav-left { display: flex; align-items: center; gap: 16px; }
.nav-logo {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--t3);
  letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.nav-logo em { color: var(--accent); font-style: normal; }
.nav-links { display: flex; gap: 7px; }
.nav-links a {
  font-size: 12px; color: var(--t2); text-decoration: none; padding: 6px 14px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--surface);
  transition: all .2s;
}
.nav-links a:hover { color: var(--t1); border-color: var(--border-h); }
.nav-links a.cta { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.nav-links a.cta:hover { opacity: .88; }
.nav-back {
  display: flex; align-items: center; gap: 7px;
  font-family: 'DM Mono', monospace; font-size: 10px; color: var(--t3);
  letter-spacing: .1em; cursor: pointer; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  transition: all .2s; text-transform: uppercase; text-decoration: none;
}
.nav-back:hover { color: var(--t1); border-color: var(--border-h); }


/* ═══════════════════════════════════════════
   THEME TOGGLE
═══════════════════════════════════════════ */
.theme-btn {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 24px; padding: 5px 12px 5px 7px;
  cursor: pointer; transition: border-color .2s, background .3s; user-select: none;
}
.theme-btn:hover { border-color: var(--border-h); }
.t-track {
  width: 30px; height: 16px; background: var(--surface-3); border-radius: 9px;
  border: 1px solid var(--border); position: relative; flex-shrink: 0;
}
.t-thumb {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  position: absolute; top: 2px; left: 2px;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
[data-theme="light"] .t-thumb { transform: translateX(14px); }
.t-label { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--t2); letter-spacing: .09em; }
.t-icon { font-size: 13px; line-height: 1; }


/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px 0; flex-shrink: 0;
}
.footer-copy { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--t3); letter-spacing: .05em; }
.footer-copy em { color: var(--accent); font-style: normal; }
.socials { display: flex; gap: 6px; }
.soc {
  width: 40px; height: 30px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; text-decoration: none; color: var(--t2); transition: all .2s;
}
.soc:hover { background: rgba(201,123,58,0.12); border-color: var(--orange); color: var(--orange); }
.soc svg { width: 14px; height: 14px; fill: currentColor; }
.card-link { cursor: pointer; text-decoration: none; }


/* ═══════════════════════════════════════════
   INNER PAGE SHARED
═══════════════════════════════════════════ */
.inner-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; flex-shrink: 0;
}
.inner-nav-left { display: flex; align-items: center; gap: 14px; }
.inner-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.inner-body::-webkit-scrollbar { width: 4px; }
.inner-body::-webkit-scrollbar-track { background: transparent; }
.inner-body::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 4px; }
.page-header { margin-bottom: 32px; }
.page-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 10px; color: var(--t3);
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 8px;
}
.page-title {
  font-family: 'Fraunces', serif; font-size: 36px; font-weight: 600; color: var(--t1);
  line-height: 1.05; letter-spacing: -.02em; margin-bottom: 10px;
}
.page-desc { font-size: 14px; color: var(--t2); max-width: 560px; line-height: 1.7; font-weight: 300; }
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .75s cubic-bezier(.22,1,.36,1), transform .75s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  nav { flex-wrap: wrap; gap: 10px; padding-bottom: 10px; }
  .nav-links { gap: 5px; }
  .nav-links a { font-size: 11px; padding: 5px 11px; }
  .hero-cover { height: 85px; }
  .hero-lower { padding: 0 16px 16px; }
  .hero-avatar { width: 80px; height: 72px; margin-top: -36px; }
  .hero-name { font-size: 22px; }
  .card-weather { padding: 14px 14px 12px; }
  .dc-digit { width: 28px; height: 42px; font-size: 21px; }
  .temp-num { font-size: 34px; }
  .inner-nav { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 28px; }
  .about-layout { grid-template-columns: 1fr; gap: 24px; }
  .status-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-row { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
  nav { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav-left { width: 100%; justify-content: space-between; }
  .nav-links { width: 100%; justify-content: flex-end; }
  .nav-links a { font-size: 10.5px; padding: 5px 10px; }
  .card-bottom { padding: 14px; }
  .tile-title { font-size: 14px; }
  .tile-sub { font-size: 10px; }
  .dc-digit { width: 24px; height: 36px; font-size: 18px; border-radius: 5px; }
  .dc-sep { font-size: 18px; width: 9px; }
  .dc-ampm { font-size: 8px; }
  .temp-num { font-size: 28px; }
  .fday .dt { font-size: 11px; }
  .inner-nav-left { gap: 8px; }
  .nav-back { font-size: 9px; padding: 4px 10px; }
  .nav-logo { font-size: 10px; }
  .page-title { font-size: 24px; }
  .page-desc { font-size: 13px; }
  .projects-grid { grid-template-columns: 1fr; }
  .stack-layout { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .contact-big { font-size: 22px; }
  .form-input, .form-textarea { font-size: 14px; padding: 9px 12px; }
  .form-textarea { height: 90px; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-tags { gap: 4px; }
  .tag { font-size: 9.5px; padding: 3px 8px; }
}

@media (max-width: 360px) {
  .dc-digit { width: 22px; height: 32px; font-size: 16px; }
  .digital-clock { gap: 1px; }
  .dc-sep { font-size: 15px; width: 7px; }
  .about-intro reveal visible{
    display: inline-block;
  }
}

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

/* ═══════════════════════════════════════════
   PROJECTS PREVIEW — THEME OVERRIDES
═══════════════════════════════════════════ */
[data-theme="light"] .preview-proj-name { color: #2c2b28; }
[data-theme="light"] .preview-proj-tags { color: rgba(44,43,40,0.55); }
[data-theme="light"] .preview-project-row:hover { background: var(--surface); border-color: var(--accent); }
[data-theme="light"] .preview-project-row:hover .preview-proj-name { color: var(--t1); }
[data-theme="light"] .preview-project-row:hover .preview-proj-tags { color: var(--t2); }


/* ── Card fly-in ── */
@keyframes cardFlyIn {
  from { opacity: 0; transform: translateY(32px) scale(0.97); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
/* ═══════════════════════════════════════════
   ABOUT ME CARD
═══════════════════════════════════════════ */
.card-about {
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
}

.about-cover {
  position: relative; height: 100px; overflow: hidden;
  background: var(--cover-bg); flex-shrink: 0; transition: background .4s;
}
.about-cover-aurora { position: absolute; inset: 0; overflow: hidden; }
.about-cover-overlay {
  position: absolute; inset: 0; background: var(--cover-overlay); z-index: 1; transition: background .4s;
}
.about-cover-grid {
  position: absolute; inset: -60%; width: 220%; height: 220%;
  background-image: radial-gradient(circle, rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 22px 22px; animation: grid-move 20s linear infinite; z-index: 2;
}
.about-cover-label {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end; padding: 14px 18px;
}
.about-cover-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 8.5px;
  color: rgba(255,255,255,0.42); letter-spacing: .18em;
  text-transform: uppercase; margin-bottom: 5px;
}
[data-theme="light"] .about-cover-eyebrow { color: rgba(0,0,0,0.35); }
.about-cover-title {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600;
  color: var(--tw-text-color); line-height: 1.1; letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 6px;
}
.about-lower { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.about-sub { font-size: 11px; color: var(--t3); line-height: 1.5; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.stat-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  transition: border-color .2s, background .2s;
}
.stat-box:hover { border-color: var(--border-h); background: var(--surface-3); }
.stat-num {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
  color: var(--t1); line-height: 1; margin-bottom: 4px;
}
.stat-label {
  font-family: 'DM Mono', monospace; font-size: 8px;
  color: var(--t3); letter-spacing: .1em; text-transform: uppercase;
}