/* =========================================================
   Axzhel Jarred A. Santos — Portfolio (modern theme)
   ========================================================= */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a10;
  --bg-2: #0d121b;
  --card: rgba(255,255,255,.04);
  --line: rgba(255,255,255,.09);
  --text: #eef2f8;
  --muted: #94a0b4;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --radius: 18px;
  --nav-bg: rgba(7,10,16,.55);
  --footer-bg: rgba(7,10,16,.5);
  --menu-bg: rgba(7,10,16,.95);
  --vignette: rgba(7,10,16,.75);
  --grid: rgba(255,255,255,.035);
  --p-text: #c3cddb;
  --blob-op: .5;
  --blob-1: #0ea5a4; --blob-2: #4338ca; --blob-3: #0369a1;
  --spot: rgba(94,234,212,.10);
  --glass-a: rgba(255,255,255,.14); --glass-b: rgba(255,255,255,.04);
  --glass-line: rgba(255,255,255,.18); --glass-hi: rgba(255,255,255,.2);
  --shadow: rgba(0,0,0,.7);
  --chip-bg: rgba(94,234,212,.08); --chip-line: rgba(94,234,212,.28);
  --hover-bg: rgba(255,255,255,.06);
  --dot-rgb: 94,234,212; --link-rgb: 56,189,248;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-2: #e9eef6;
  --card: rgba(255,255,255,.7);
  --line: rgba(15,23,42,.12);
  --text: #0f172a;
  --muted: #55627a;
  --accent: #0d9488;
  --accent-2: #0284c7;
  --accent-3: #7c3aed;
  --nav-bg: rgba(255,255,255,.65);
  --footer-bg: rgba(255,255,255,.6);
  --menu-bg: rgba(255,255,255,.97);
  --vignette: rgba(244,247,251,.8);
  --grid: rgba(15,23,42,.05);
  --p-text: #384659;
  --blob-op: .38;
  --blob-1: #5eead4; --blob-2: #a5b4fc; --blob-3: #7dd3fc;
  --spot: rgba(13,148,136,.13);
  --glass-a: rgba(255,255,255,.95); --glass-b: rgba(255,255,255,.6);
  --glass-line: rgba(15,23,42,.12); --glass-hi: rgba(255,255,255,.9);
  --shadow: rgba(15,23,42,.28);
  --chip-bg: rgba(13,148,136,.09); --chip-line: rgba(13,148,136,.35);
  --hover-bg: rgba(15,23,42,.06);
  --dot-rgb: 13,148,136; --link-rgb: 2,132,199;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background .4s, color .4s;
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
ul { list-style: none; }
::selection { background: rgba(94,234,212,.3); }

/* ---------- Animated background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-op); will-change: transform; transition: opacity .4s, background .4s; }
.blob--1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -16vmax; background: var(--blob-1); animation: drift1 22s ease-in-out infinite alternate; }
.blob--2 { width: 40vmax; height: 40vmax; right: -12vmax; top: 10vh;  background: var(--blob-2); animation: drift2 26s ease-in-out infinite alternate; }
.blob--3 { width: 34vmax; height: 34vmax; left: 30vw; bottom: -20vmax; background: var(--blob-3); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vw, 16vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vw, 12vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-18vw, -14vh) scale(1.2); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
}
#net { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, var(--vignette)); }

.spotlight {
  position: fixed; z-index: 1; width: 480px; height: 480px; left: 0; top: 0; pointer-events: none;
  background: radial-gradient(circle, var(--spot), transparent 62%);
  transform: translate(-50%, -50%); opacity: 0; transition: opacity .4s;
}

/* ---------- Nav ---------- */
.nav {
  position: relative; z-index: 50; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6vw;
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  animation: navin .7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes navin { from { transform: translateY(-100%); opacity: 0; } }
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; color: var(--text); }
.nav__dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 0 rgba(94,234,212,.6); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(94,234,212,0); } 100% { box-shadow: 0 0 0 0 rgba(94,234,212,0); } }
.nav__links { display: flex; gap: 8px; }
.nav__links a {
  position: relative; color: var(--muted); font-size: .92rem; padding: 6px 14px; border-radius: 999px; transition: color .25s, background .25s;
}
.nav__links a:hover { color: var(--text); background: var(--hover-bg); }
.nav__links a.active { color: var(--accent); background: rgba(94,234,212,.1); }
.nav__toggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--text); font-size: 1.2rem; padding: 4px 10px; border-radius: 10px; cursor: pointer;
}

.nav__right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 50%;
  transition: border-color .25s, color .25s, transform .3s, background .3s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(18deg) scale(1.06); }
.theme-toggle svg { position: absolute; width: 20px; height: 20px; transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .3s; }
.icon-sun  { opacity: 0; transform: rotate(-90deg) scale(.4); }
.icon-moon { opacity: 1; transform: none; }
[data-theme="light"] .icon-sun  { opacity: 1; transform: none; }
[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(.4); }

/* ---------- Single-screen pages ---------- */
main { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; }
main > section { display: none; height: 100%; width: 100%; overflow-y: auto; overflow-x: hidden; }
main > section.active { display: block; }
main > section.hero.active { display: grid; align-content: center; }

/* ---------- Hero ---------- */
.hero {
  grid-template-columns: 340px 1fr; gap: 72px; align-items: center;
  padding: 40px max(6vw, calc((100vw - 1100px) / 2));
}

/* reveal-on-load */
.reveal { opacity: 0; transform: translateY(26px); }
.active .reveal, .reveal.in { animation: rise .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Photo ---------- */
.photo-wrap { position: relative; width: 100%; max-width: 320px; margin: 0 auto; perspective: 900px; outline: none; }
.photo-glow {
  position: absolute; inset: -14px; border-radius: 28px; z-index: 0;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  filter: blur(26px); opacity: .45; animation: spin 9s linear infinite; transition: opacity .4s, filter .4s;
}
.photo-wrap:hover .photo-glow, .photo-wrap.open .photo-glow, .photo-wrap:focus-visible .photo-glow { opacity: .85; filter: blur(34px); }
@keyframes spin { to { transform: rotate(360deg); } }

.photo-frame {
  position: relative; z-index: 2; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden;
  padding: 3px; background: linear-gradient(140deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
  box-shadow: 0 30px 60px -20px var(--shadow);
}
img.photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 19px; transition: transform .6s ease; }
.photo-wrap:hover img.photo, .photo-wrap.open img.photo { transform: scale(1.06); }
.photo-shine {
  position: absolute; inset: 3px; border-radius: 19px; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.28), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.photo-wrap:hover .photo-shine { opacity: 1; }

.photo-hint {
  position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: opacity .3s;
}
.photo-hint__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }
.photo-wrap:hover .photo-hint, .photo-wrap.open .photo-hint { opacity: 0; }

/* ---------- Floating logos ---------- */
.orbit { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.logo {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px;
  transform: translate(-50%, -50%) scale(0) rotate(-90deg);
  opacity: 0;
  transition: left .7s cubic-bezier(.34,1.56,.64,1), top .7s cubic-bezier(.34,1.56,.64,1),
              transform .7s cubic-bezier(.34,1.56,.64,1), opacity .35s;
  transition-delay: calc(var(--i) * 55ms);
}
.photo-wrap:hover .logo, .photo-wrap.open .logo, .photo-wrap:focus-visible .logo {
  left: var(--l); top: var(--t); opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
.logo__in {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 10px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--glass-a), var(--glass-b));
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px -8px var(--shadow), inset 0 1px 0 var(--glass-hi);
  animation: floaty 4.2s ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}
.logo__in svg { width: 100%; height: 100%; display: block; }
@keyframes floaty {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(5px, -12px) rotate(4deg); }
  50%      { transform: translate(-4px, -18px) rotate(-3deg); }
  75%      { transform: translate(-7px, -7px) rotate(3deg); }
}

/* ---------- Text ---------- */
.hero__text h1 { font-family: var(--font-head); font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.12; letter-spacing: -.02em; margin: 14px 0 8px; }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 250% 0; } }
.hero__sub { color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.hero__text p { margin-bottom: 14px; color: var(--p-text); }
.hero__text strong { color: var(--text); font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; font-size: .8rem; font-weight: 500;
  color: var(--accent); background: var(--chip-bg); border: 1px solid var(--chip-line); border-radius: 999px;
}
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; }

.typed { font-family: var(--font-head); font-size: 1.15rem; color: var(--text) !important; min-height: 1.9em; margin-bottom: 12px !important; }
.typed__label { color: var(--muted); }
#typed { color: var(--accent-2); font-weight: 700; }
.typed__caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Socials ---------- */
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(8px);
  color: var(--text); font-size: .88rem; transition: border-color .25s, color .25s, background .25s, box-shadow .25s, transform .2s;
}
.socials svg { width: 17px; height: 17px; }
.socials a:hover { border-color: var(--accent); color: var(--accent); background: rgba(94,234,212,.08); box-shadow: 0 10px 30px -10px rgba(94,234,212,.45); }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 2; flex: 0 0 auto; text-align: center; padding: 10px 6vw; color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; background: var(--footer-bg); backdrop-filter: blur(10px); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 64px; padding-top: 44px; padding-bottom: 64px; align-content: start !important; }
  .photo-wrap { max-width: 230px; }
  .logo { width: 46px; height: 46px; }
  .logo__in { padding: 7px; border-radius: 13px; }
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--menu-bg); padding: 16px 6vw; border-bottom: 1px solid var(--line);
  }
  .nav__links.open { display: flex; }
}
@media (max-width: 480px) { .nav__brand { font-size: .88rem; } }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
}
