/* =========================================================
   TOKENS (light is default; dark below)
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e9f0;
  --line-2: #cbd5e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-2: #0ea5e9;
  --accent-soft: #eff6ff;
  --grad: linear-gradient(100deg, #2563eb 0%, #0ea5e9 100%);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --ring: #dbeafe;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --ok-line: #c6f0d5;
  --shadow: rgba(15, 23, 42, 0.10);
  --shadow-strong: rgba(15, 23, 42, 0.18);
  --blob-1: rgba(37, 99, 235, 0.16);
  --blob-2: rgba(14, 165, 233, 0.16);
  --blob-3: rgba(139, 92, 246, 0.10);
  --grid: rgba(15, 23, 42, 0.05);
  --contact-bg: #0b1220;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #080d1a;
  --bg-soft: #0e1526;
  --surface: #0f1729;
  --ink: #e8edf5;
  --ink-2: #c3cddc;
  --muted: #8b99ae;
  --line: #1c2740;
  --line-2: #2c3a57;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-2: #38bdf8;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --grad: linear-gradient(100deg, #60a5fa 0%, #38bdf8 100%);
  --nav-bg: rgba(8, 13, 26, 0.75);
  --ring: rgba(59, 130, 246, 0.3);
  --ok: #4ade80;
  --ok-bg: rgba(34, 197, 94, 0.12);
  --ok-line: rgba(34, 197, 94, 0.3);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-strong: rgba(0, 0, 0, 0.6);
  --blob-1: rgba(37, 99, 235, 0.28);
  --blob-2: rgba(14, 165, 233, 0.18);
  --blob-3: rgba(139, 92, 246, 0.16);
  --grid: rgba(148, 163, 184, 0.06);
  --contact-bg: #0b1428;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080d1a;
    --bg-soft: #0e1526;
    --surface: #0f1729;
    --ink: #e8edf5;
    --ink-2: #c3cddc;
    --muted: #8b99ae;
    --line: #1c2740;
    --line-2: #2c3a57;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-2: #38bdf8;
    --accent-soft: rgba(59, 130, 246, 0.14);
    --grad: linear-gradient(100deg, #60a5fa 0%, #38bdf8 100%);
    --nav-bg: rgba(8, 13, 26, 0.75);
    --ring: rgba(59, 130, 246, 0.3);
    --ok: #4ade80;
    --ok-bg: rgba(34, 197, 94, 0.12);
    --ok-line: rgba(34, 197, 94, 0.3);
    --shadow: rgba(0, 0, 0, 0.45);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --blob-1: rgba(37, 99, 235, 0.28);
    --blob-2: rgba(14, 165, 233, 0.18);
    --blob-3: rgba(139, 92, 246, 0.16);
    --grid: rgba(148, 163, 184, 0.06);
    --contact-bg: #0b1428;
    color-scheme: dark;
  }
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  line-height: 1.65; font-size: 16px; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }
::selection { background: var(--ring); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
svg { flex: none; }

.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; background: var(--grad);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 0.82rem; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.6);
}
.brand-mark.sm { width: 24px; height: 24px; font-size: 0.62rem; border-radius: 7px; margin-right: 10px; vertical-align: middle; box-shadow: none; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--muted); padding: 8px 14px; border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); background: var(--bg-soft); }
.nav-links .nav-cta, .nav-links .nav-cta.active { color: #fff; background: var(--accent); margin-left: 10px; font-weight: 600; }
.nav-links .nav-cta:hover { color: #fff; background: var(--accent-hover); }
.nav-tools { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 38px; height: 38px; position: relative; }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 1.6px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, top 0.25s; }
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 18.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 18.5px; transform: rotate(-45deg); }

/* Theme switcher */
.theme { position: relative; margin-left: 14px; }
.theme-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-btn:hover, .theme-btn[aria-expanded="true"] { border-color: var(--line-2); color: var(--ink); background: var(--bg-soft); }
.theme-btn svg, .theme-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .ic { display: none; }
.theme-btn[data-mode="light"] .ic-light, .theme-btn[data-mode="dark"] .ic-dark, .theme-btn[data-mode="system"] .ic-system { display: block; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -14px var(--shadow-strong);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.theme-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.theme-menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
}
.theme-menu button:hover { background: var(--bg-soft); color: var(--ink); }
.theme-menu button[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.theme-menu .check { margin-left: auto; opacity: 0; }
.theme-menu button[aria-checked="true"] .check { opacity: 1; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; padding: 14px 24px;
  border: 1px solid transparent; border-radius: 12px; transition: transform 0.2s, background 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}
.btn svg { transition: transform 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.7); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 16px 32px -12px rgba(37, 99, 235, 0.75); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost:hover svg { transform: translateY(2px); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; padding: 84px 0 110px; overflow: hidden; isolation: isolate; }
.mesh { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: var(--blob-1); top: -160px; right: -80px; }
.b2 { width: 420px; height: 420px; background: var(--blob-2); top: 180px; right: 320px; animation-duration: 28s; }
.b3 { width: 380px; height: 380px; background: var(--blob-3); top: -120px; left: -140px; animation-duration: 32s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.08); }
  100% { transform: translate(30px, -20px) scale(0.95); }
}
.grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 64px; align-items: center; }

.hello {
  display: inline-flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 600; color: var(--ink-2);
  padding: 7px 16px 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  box-shadow: 0 4px 14px -8px var(--shadow);
  animation: up 0.7s both;
}
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(10deg); } }
.hero h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1;
  margin-top: 24px; animation: up 0.7s 0.08s both;
}
.hl { position: relative; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em; height: 0.12em; border-radius: 99px;
  background: var(--grad); opacity: 0.28; transform: scaleX(0); transform-origin: left;
  animation: draw 0.7s cubic-bezier(.2,.7,.2,1) forwards;
}
.hl:nth-of-type(1)::after { animation-delay: 0.7s; }
.hl:nth-of-type(2)::after { animation-delay: 0.95s; }
.hl:nth-of-type(3)::after { animation-delay: 1.2s; }
@keyframes draw { to { transform: scaleX(1); } }
.lead { margin-top: 22px; font-size: 1.08rem; color: var(--muted); max-width: 540px; line-height: 1.75; animation: up 0.7s 0.16s both; }
.lead strong { color: var(--ink); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; animation: up 0.7s 0.24s both; }
.worked { margin-top: 44px; animation: up 0.7s 0.32s both; }
.worked p { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.worked ul { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 12px; }
.worked li { font-weight: 700; font-size: 1.02rem; color: var(--ink-2); opacity: 0.7; letter-spacing: -0.02em; transition: opacity 0.2s; }
.worked li:hover { opacity: 1; }
@keyframes up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Visual: tilting profile card + floating toasts */
.hero-visual { position: relative; perspective: 1200px; justify-self: end; width: 100%; max-width: 440px; animation: up 0.9s 0.2s both; }
.tilt { transform-style: preserve-3d; transition: transform 0.25s ease-out; will-change: transform; }
.profile {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 2px 4px var(--shadow), 0 40px 80px -40px var(--shadow-strong);
}
.profile-banner { height: 116px; background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%); }
.profile-banner svg { width: 100%; height: 100%; display: block; }
.banner-lines path { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.2; stroke-dasharray: 3 6; animation: flow 18s linear infinite; }
.banner-lines path + path { stroke: rgba(255, 255, 255, 0.18); animation-duration: 26s; }
.banner-dots circle { fill: rgba(255, 255, 255, 0.9); animation: blip 3s ease-in-out infinite; }
.banner-dots circle:nth-child(2) { animation-delay: 0.6s; }
.banner-dots circle:nth-child(3) { animation-delay: 1.2s; }
.banner-dots circle:nth-child(4) { animation-delay: 1.8s; }
.banner-dots circle:nth-child(5) { animation-delay: 2.4s; }
@keyframes flow { to { stroke-dashoffset: -180; } }
@keyframes blip { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.profile-body { padding: 0 28px 28px; }
.profile-top { display: flex; align-items: flex-end; justify-content: space-between; margin-top: -40px; }
.avatar {
  width: 82px; height: 82px; border-radius: 22px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em;
  border: 4px solid var(--surface); box-shadow: 0 10px 24px -10px var(--shadow-strong);
}
.badge-open {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--ok);
  background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 5px 12px; border-radius: 999px; margin-bottom: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.profile-name { font-size: 1.35rem; font-weight: 800; margin-top: 16px; }
.profile-role { color: var(--ink-2); font-weight: 600; font-size: 0.97rem; margin-top: 2px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.profile-meta li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.87rem; }
.profile-meta svg, .pbtn svg, .toast svg, .panel-ic svg, .cl-ic svg, .seal svg, .ready svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.pbtn svg.fill { fill: currentColor; stroke: none; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.profile-stats div { padding: 14px 10px; text-align: center; }
.profile-stats div + div { border-left: 1px solid var(--line); }
.profile-stats dt { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.profile-stats dd { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.profile-sub { margin-top: 22px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pills li { font-size: 0.79rem; font-weight: 500; color: var(--ink-2); padding: 5px 11px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; font-size: 0.88rem; font-weight: 600; color: var(--ink);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pbtn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.toast {
  position: absolute; display: flex; align-items: center; gap: 11px; padding: 10px 16px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -16px var(--shadow-strong); font-size: 0.8rem; white-space: nowrap;
  animation: pop 0.6s cubic-bezier(.2,.8,.2,1.2) both, float 6s ease-in-out infinite;
}
.toast strong { display: block; font-weight: 700; color: var(--ink); line-height: 1.2; }
.toast em { display: block; font-style: normal; color: var(--muted); font-size: 0.75rem; }
.toast-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.ic-green { background: var(--ok-bg); color: var(--ok); }
.ic-blue { background: var(--accent-soft); color: var(--accent); }
.ic-violet { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.toast-1 { top: -22px; left: -56px; animation-delay: 0.9s, 1.5s; }
.toast-2 { bottom: 86px; right: -58px; animation-delay: 1.2s, 0s; }
.toast-3 { bottom: -44px; left: -40px; animation-delay: 1.5s, 3s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0; width: 26px; height: 42px;
  border: 2px solid var(--line-2); border-radius: 14px;
}
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 110px 0 0; }
.head { max-width: 880px; margin-bottom: 44px; }
.label {
  display: inline-flex; align-items: center; gap: 10px; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.label::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--grad); }
.head h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.035em; margin-top: 14px; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 0.82rem; font-weight: 500; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }

/* ABOUT: bento grid */
.bento {
  display: grid; gap: 16px; grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "about about about about now now"
    "about about about about clock clock"
    "itil itil stack stack ready ready";
}
.tile {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 20px 40px -24px var(--shadow-strong); }
.t-about { grid-area: about; padding: 34px; background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface); }
.about-big { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.35; color: var(--ink); max-width: 560px; }
.about-big strong { color: var(--accent); }
.t-about .muted { margin-top: 18px; max-width: 580px; font-size: 0.98rem; }
.t-now { grid-area: now; }
.t-now h3, .t-itil h3 { font-size: 1.15rem; font-weight: 700; }
.t-now .muted { font-size: 0.9rem; }
.since { display: inline-block; margin-top: 12px; font-size: 0.78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.t-clock { grid-area: clock; background: var(--grad); border: 0; color: #fff; }
.t-clock .tile-label { color: rgba(255, 255, 255, 0.8); }
.clock { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.t-clock .muted { color: rgba(255, 255, 255, 0.8); font-size: 0.86rem; margin-top: 8px; }
.t-itil { grid-area: itil; }
.t-itil .chips { margin-top: 14px; }
.t-stack { grid-area: stack; padding-left: 0; padding-right: 0; }
.t-stack .tile-label { padding: 0 26px; }
.rail { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.rail + .rail { margin-top: 10px; }
.rail-track { display: flex; gap: 10px; width: max-content; animation: marquee 32s linear infinite; }
.rail-rev .rail-track { animation-direction: reverse; animation-duration: 38s; }
.rail-track span { font-size: 0.84rem; font-weight: 600; color: var(--ink-2); padding: 8px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); white-space: nowrap; }
.t-stack:hover .rail-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 5px)); } }
.t-ready { grid-area: ready; }
.ready li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500; padding: 6px 0; }
.ready svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); stroke-width: 2.4; }

/* EXPERTISE: tabs */
.tabs {
  display: grid; grid-template-columns: 340px 1fr; gap: 16px;
}
.tab-list { display: flex; flex-direction: column; gap: 6px; }
.tab-list button {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  padding: 16px 20px; border-radius: 14px; border: 1px solid transparent; background: transparent;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--muted); transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.tab-list button .n { font-size: 0.78rem; font-weight: 700; color: var(--line-2); transition: color 0.2s; }
.tab-list button:hover { color: var(--ink); background: var(--bg-soft); }
.tab-list button[aria-selected="true"] { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: 0 10px 24px -16px var(--shadow-strong); }
.tab-list button[aria-selected="true"] .n { color: var(--accent); }
.tab-panels {
  position: relative; border: 1px solid var(--line); border-radius: 22px; padding: 44px; min-height: 360px;
  background: radial-gradient(500px 260px at 100% 0%, var(--accent-soft), transparent 70%), var(--surface);
}
.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.45s cubic-bezier(.2,.7,.2,1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-ic {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: #fff;
  background: var(--grad); box-shadow: 0 14px 28px -12px rgba(37, 99, 235, 0.7);
}
.panel-ic svg { width: 28px; height: 28px; stroke-width: 1.6; }
.panel h3 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 26px; }
.panel p { color: var(--muted); font-size: 1.05rem; margin-top: 10px; max-width: 560px; }
.panel .chips { margin-top: 26px; }

/* EXPERIENCE: timeline with scroll-filled rail */
.timeline { position: relative; --p: 0; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 23px; top: 24px; width: 2px; border-radius: 2px; }
.timeline::before { bottom: 24px; background: var(--line); }
.timeline::after { height: calc((100% - 48px) * var(--p)); background: var(--grad); }
.tl { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 24px; padding-bottom: 20px; }
.tl-node {
  position: relative; z-index: 1; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 0.8rem; font-weight: 800; color: var(--ink-2);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.tl:first-child .tl-node { background: var(--grad); color: #fff; border-color: transparent; }
.tl-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.tl-card:hover { border-color: var(--line-2); box-shadow: 0 20px 40px -26px var(--shadow-strong); }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.tl-card h3 { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.company { color: var(--muted); font-size: 0.92rem; margin-top: 3px; }
.tl-date { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); padding: 5px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); white-space: nowrap; }
.tag-current { font-size: 0.7rem; font-weight: 600; color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 2px 9px; border-radius: 999px; }
.tl-card ul { margin-top: 16px; display: grid; gap: 7px; }
.tl-card li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 0.95rem; }
.tl-card li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0.35; transform: rotate(45deg); }

/* PROJECTS */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.project::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 0.4s; }
.project:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 26px 50px -30px var(--shadow-strong); }
.project:hover::before { transform: scaleX(1); }
.featured { grid-column: 1 / -1; background: radial-gradient(600px 300px at 100% 0%, var(--accent-soft), transparent 70%), var(--surface); }
.p-top { display: flex; align-items: center; justify-content: space-between; }
.p-num { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.p-kind { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.project h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.025em; }
.featured h3 { font-size: 1.7rem; }
.project > p { color: var(--muted); font-size: 0.95rem; max-width: 720px; }
.project .chips { margin-top: auto; padding-top: 8px; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 20px; border-top: 1px dashed var(--line-2); }
.flow span { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.flow span.go { color: #fff; background: var(--grad); border-color: transparent; }
.flow i { width: 22px; height: 2px; background: var(--line-2); position: relative; }
.flow i::after { content: ""; position: absolute; right: -1px; top: -3px; border: 4px solid transparent; border-left-color: var(--line-2); border-right: 0; }

/* CREDENTIALS */
.creds { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
.cred-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.col-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.edu li { display: flex; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.edu li:last-child { border-bottom: 0; padding-bottom: 0; }
.edu time { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 8px; height: fit-content; font-variant-numeric: tabular-nums; }
.edu strong, .cert strong { display: block; font-weight: 700; font-size: 0.97rem; }
.edu span, .cert span { display: block; color: var(--muted); font-size: 0.86rem; }
.certs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.cert { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); transition: border-color 0.3s, transform 0.3s; }
.cert:hover { border-color: var(--accent); transform: translateY(-2px); }
.cert .seal { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; }
.seal svg { width: 20px; height: 20px; }

/* CONTACT */
.contact-section { padding-bottom: 110px; }
.contact {
  position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  padding: 60px; border-radius: 28px; background: var(--contact-bg); color: #e6ecf5;
}
.contact-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 320px at 0% 0%, rgba(37, 99, 235, 0.45), transparent 70%),
    radial-gradient(480px 300px at 100% 100%, rgba(14, 165, 233, 0.3), transparent 70%);
}
.contact::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(135deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(135deg, #000, transparent 60%);
}
.label-light { color: #93c5fd; }
.label-light::before { background: #93c5fd; }
.contact h2 { color: #fff; font-size: clamp(2rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -0.035em; margin-top: 14px; }
.contact-lead { color: #a9b6ca; margin-top: 14px; max-width: 440px; font-size: 1.02rem; }
.contact-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 32px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s, border-color 0.2s, transform 0.2s; min-width: 0;
}
.contact-links a:first-child, .contact-links a:last-child { grid-column: 1 / -1; }
.contact-links a:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(147, 197, 253, 0.5); transform: translateY(-2px); }
.contact-links a > span:last-child { min-width: 0; overflow-wrap: anywhere; font-size: 0.88rem; font-weight: 600; color: #fff; line-height: 1.35; }
.contact-links em { display: block; font-style: normal; font-size: 0.72rem; font-weight: 500; color: #8b9ab0; }
.cl-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.cl-ic svg { width: 18px; height: 18px; }

.contact-form { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6); }
.contact-form h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--bg-soft); color: var(--ink);
  border: 1px solid var(--line); font: inherit; font-size: 0.95rem; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.field.invalid input, .field.invalid textarea { border-color: #dc2626; }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 12px; font-size: 0.88rem; min-height: 1.3em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #dc2626; }

/* FOOTER */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 26px 32px; }
.footer a:hover { color: var(--accent); }

/* =========================================================
   MOTION LAYER (intro, headline, profile card, glow, extras)
   ========================================================= */
:root { --intro: 1.25s; }
:root.no-intro { --intro: 0s; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }

/* Intro screen (first visit per session only) */
.loader {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 20px;
  animation: loaderOut 0.7s cubic-bezier(.7,0,.3,1) 1.05s forwards;
}
.no-intro .loader, html:not(.js) .loader { display: none; }
.loader-mark {
  width: 68px; height: 68px; border-radius: 20px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.45rem;
  box-shadow: 0 18px 40px -14px rgba(37, 99, 235, 0.7);
  animation: markIn 0.7s cubic-bezier(.2,.8,.2,1.2) both;
}
.loader-bar { width: 150px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.loader-bar span { display: block; height: 100%; background: var(--grad); transform-origin: left; animation: barFill 0.85s cubic-bezier(.6,0,.2,1) 0.15s both; }
@keyframes markIn { from { opacity: 0; transform: scale(0.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes barFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes loaderOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* Hero entrance, timed after the intro */
.hello { animation-delay: var(--intro); }
.lead { animation-delay: calc(var(--intro) + 0.55s); }
.actions { animation-delay: calc(var(--intro) + 0.65s); }
.worked { animation-delay: calc(var(--intro) + 0.75s); }
.hero-visual { animation-delay: calc(var(--intro) + 0.25s); }
.wave { animation-delay: calc(var(--intro) + 0.8s); }
.toast-1 { animation-delay: calc(var(--intro) + 1.3s), 1.5s; }
.toast-2 { animation-delay: calc(var(--intro) + 1.55s), 0s; }
.toast-3 { animation-delay: calc(var(--intro) + 1.8s), 3s; }

/* Headline: words rise out of a mask one by one */
.hero h1.split { animation: none; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.split .w > span { display: inline-block; animation: wordUp 0.85s cubic-bezier(.2,.75,.2,1) both; animation-delay: calc(var(--intro) + 0.1s + var(--i) * 0.065s); }
@keyframes wordUp { from { transform: translateY(105%); opacity: 0; } to { transform: none; opacity: 1; } }
.split .hl::after { animation-delay: calc(var(--intro) + var(--d)); bottom: 0.06em; }

/* Cursor spotlight in hero */
.spotlight {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.5s;
  background: radial-gradient(520px circle at var(--hx, 70%) var(--hy, 30%), var(--blob-2), transparent 62%);
}
.hero:hover .spotlight { opacity: 1; }

/* Profile card: animated border, aurora banner, ring avatar, shine */
.profile-frame {
  position: relative; padding: 1.5px; border-radius: 24px;
  background: conic-gradient(from var(--ang), transparent 0deg 240deg, var(--accent) 300deg, var(--accent-2) 330deg, transparent 360deg), var(--line);
  animation: spin 7s linear infinite;
  box-shadow: 0 2px 4px var(--shadow), 0 50px 90px -45px var(--shadow-strong);
}
.profile { border: 0; border-radius: 22.5px; box-shadow: none; }
.profile-banner {
  position: relative; height: 120px;
  background: linear-gradient(120deg, #1e3a8a, #2563eb, #0ea5e9, #6366f1, #1e40af);
  background-size: 300% 300%; animation: aurora 14s ease-in-out infinite alternate;
}
@keyframes aurora { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.banner-tag {
  position: absolute; top: 14px; right: 16px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.profile-shine {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.32) 48%, transparent 62%);
  transform: translateX(-130%); animation: sweep 1.4s ease calc(var(--intro) + 1.1s) both;
}
.tilt:hover .profile-shine { animation: sweep2 1.1s ease both; }
@keyframes sweep { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes sweep2 { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
.avatar {
  width: 90px; height: 90px; padding: 3px; border-radius: 50%; border: 4px solid var(--surface);
  background: conic-gradient(from var(--ang), #2563eb, #0ea5e9, #8b5cf6, #2563eb); animation: spin 5s linear infinite;
  box-shadow: 0 12px 26px -12px var(--shadow-strong);
}
.avatar span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em;
  border: 2px solid var(--surface);
}
.profile-top { position: relative; z-index: 2; margin-top: -44px; }
.profile-role { font-weight: 600; }
.profile-org { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.profile-meta { gap: 6px 16px; }
.profile-stats dt { font-variant-numeric: tabular-nums; }
.pills li { animation: chipIn 0.5s cubic-bezier(.2,.8,.2,1.2) both; animation-delay: calc(var(--intro) + 0.9s + var(--i, 0) * 0.06s); transition: border-color 0.2s, color 0.2s, background 0.2s; }
.pills li:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@keyframes chipIn { from { opacity: 0; transform: translateY(8px) scale(0.9); } to { opacity: 1; transform: none; } }
.profile-actions { grid-template-columns: 1fr auto auto auto; gap: 8px; }
.pbtn-main {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: 11px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 0.9rem; transition: background 0.2s, color 0.2s, transform 0.2s;
}
.pbtn-main:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.picon {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid var(--line-2); color: var(--ink-2); transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.picon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.pbtn-main svg, .picon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.picon svg.fill { fill: currentColor; stroke: none; }
.picon::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 4px;
  white-space: nowrap; font-size: 0.72rem; font-weight: 600; background: var(--ink); color: var(--bg);
  padding: 4px 9px; border-radius: 7px; opacity: 0; pointer-events: none; transition: opacity 0.2s, translate 0.2s;
}
.picon:hover::after { opacity: 1; translate: -50% 0; }

/* Mouse-follow glowing border on cards */
.glow { --mx: 50%; --my: 50%; }
.glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 2;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s;
}
.glow:hover::after { opacity: 1; }
.tl-card, .cert, .tab-panels { position: relative; }

/* Section headings wipe in */
.js .head.reveal { transform: none; opacity: 1; }
.js .head.reveal h2 { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(.7,0,.2,1) 0.15s; padding-bottom: 0.08em; }
.js .head.reveal.visible h2 { clip-path: inset(0 0 0 0); }
.js .head.reveal .label::before { width: 0; transition: width 0.6s ease 0.1s; }
.js .head.reveal.visible .label::before { width: 24px; }
.js .head.reveal .label { opacity: 0; transform: translateY(8px); transition: opacity 0.5s, transform 0.5s; }
.js .head.reveal.visible .label { opacity: 1; transform: none; }

/* Cards scale up slightly as they reveal */
.js .tile.reveal, .js .project.reveal { transform: translateY(26px) scale(0.97); }
.js .tile.reveal.visible, .js .project.reveal.visible { transform: none; }
.js .tile.reveal.visible:hover, .js .project.reveal.visible:hover { transform: translateY(-4px); }

/* Tab panel: chips cascade in */
.panel.active .chips li { animation: chipIn 0.45s cubic-bezier(.2,.8,.2,1.2) both; animation-delay: calc(0.12s + var(--i, 0) * 0.04s); }
.panel.active .panel-ic { animation: iconPop 0.55s cubic-bezier(.2,.8,.2,1.3) both; }
@keyframes iconPop { from { transform: scale(0.6) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Timeline nodes light up as the line reaches them */
.tl-node.lit { background: var(--grad); color: #fff; border-color: transparent; animation: nodePop 0.5s cubic-bezier(.2,.8,.2,1.4); box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.7); }
@keyframes nodePop { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Back to top with scroll-progress ring */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 50px; height: 50px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 14px 30px -12px var(--shadow-strong); display: grid; place-items: center;
  opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none; transition: opacity 0.3s, transform 0.3s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top .ring circle { fill: none; stroke: var(--line); stroke-width: 2.5; }
.to-top .ring .ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: calc(119.4 * (1 - var(--sp, 0))); }
.to-top .arrow { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.to-top:hover .arrow { transform: translateY(-3px); }

/* Theme switch: circular reveal from the theme button (supported browsers) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: vtReveal 0.75s cubic-bezier(.7,0,.3,1); }
@keyframes vtReveal {
  from { clip-path: circle(0px at var(--vt-x, 100%) var(--vt-y, 0%)); }
  to { clip-path: circle(150vmax at var(--vt-x, 100%) var(--vt-y, 0%)); }
}

/* =========================================================
   REVEAL + MOTION PREFERENCES
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.visible { opacity: 1; transform: none; }
.bento .tile:nth-child(2) { transition-delay: 0.06s; }
.bento .tile:nth-child(3) { transition-delay: 0.12s; }
.bento .tile:nth-child(4) { transition-delay: 0.08s; }
.bento .tile:nth-child(5) { transition-delay: 0.14s; }
.bento .tile:nth-child(6) { transition-delay: 0.2s; }
.projects .project:nth-child(2n+1) { transition-delay: 0.08s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hl::after { transform: scaleX(1); }
  .tilt { transform: none !important; }
  .loader { display: none; }
  .js .head.reveal h2 { clip-path: none; }
  .js .head.reveal .label { opacity: 1; transform: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .toast-1 { left: -20px; }
  .toast-2 { right: -16px; }
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 72px; }
  .hero-visual { justify-self: center; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-areas: "about about" "now clock" "itil ready" "stack stack"; }
  .tabs { grid-template-columns: 1fr; }
  .tab-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .tab-list::-webkit-scrollbar { display: none; }
  .tab-list button { width: auto; white-space: nowrap; padding: 12px 16px; font-size: 0.92rem; }
  .creds { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding: 44px; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-tools { margin-left: auto; }
  .theme { margin-left: 0; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 22px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; border-radius: 10px; font-size: 1rem; }
  .nav-links .nav-cta { margin: 10px 0 0; text-align: center; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0 90px; }
  .hero h1 { font-size: 2.35rem; }
  .actions .btn { flex: 1 1 100%; }
  .worked ul { gap: 8px 18px; }
  .worked li { font-size: 0.92rem; }
  .toast { display: none; }
  .profile-body { padding: 0 20px 22px; }
  .section { padding-top: 84px; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "about" "now" "clock" "itil" "stack" "ready"; }
  .t-about { padding: 26px; }
  .tab-panels { padding: 28px 22px; min-height: 0; }
  .panel h3 { font-size: 1.4rem; }
  .tl { grid-template-columns: 1fr; gap: 12px; padding-left: 0; }
  .timeline::before, .timeline::after { display: none; }
  .tl-node { display: none; }
  .tl-card { padding: 22px; }
  .projects { grid-template-columns: 1fr; }
  .project { padding: 24px; }
  .featured h3 { font-size: 1.4rem; }
  .certs { grid-template-columns: 1fr; }
  .contact { padding: 30px 20px; border-radius: 22px; }
  .contact-links { grid-template-columns: 1fr; }
  .contact-form { padding: 24px 20px; }
  .footer-inner { flex-direction: column; padding: 22px 20px; }
  .scroll-cue { display: none; }
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
  .profile-actions { grid-template-columns: 1fr auto auto auto; }
  .banner-tag { display: none; }
}

/* =========================================================
   PHONE LAYOUT (compact, app-like)
   ========================================================= */
.swipe-hint, .more, .dots { display: none; }

@media (max-width: 640px) {
  /* rhythm */
  .section { padding-top: 60px; }
  .head { margin-bottom: 22px; }
  .head h2 { font-size: 1.7rem; margin-top: 10px; }
  .label { font-size: 0.68rem; }
  .contact-section { padding-bottom: 72px; }

  /* hero */
  .hero { padding: 26px 0 52px; }
  .hero-grid { gap: 36px; }
  .hello { font-size: 0.8rem; padding: 5px 12px 5px 8px; }
  .hero h1 { font-size: 2.05rem; margin-top: 16px; line-height: 1.12; }
  .lead { font-size: 0.97rem; margin-top: 14px; line-height: 1.65; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .actions .btn { padding: 13px 10px; font-size: 0.9rem; border-radius: 11px; }
  .worked { margin-top: 24px; }
  .worked p { font-size: 0.66rem; }
  .worked ul { gap: 6px; margin-top: 8px; }
  .worked li { font-size: 0.78rem; font-weight: 600; opacity: 1; color: var(--ink-2); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

  /* profile card */
  .hero-visual { max-width: 100%; }
  .profile-frame { border-radius: 20px; }
  .profile { border-radius: 18.5px; }
  .profile-banner { height: 84px; }
  .profile-body { padding: 0 18px 18px; }
  .profile-top { margin-top: -36px; }
  .avatar { width: 74px; height: 74px; border-width: 3px; }
  .avatar span { font-size: 1.3rem; }
  .badge-open { font-size: 0.72rem; padding: 4px 10px; margin-bottom: 4px; }
  .profile-name { font-size: 1.2rem; margin-top: 12px; }
  .profile-role { font-size: 0.9rem; }
  .profile-org { font-size: 0.84rem; }
  .profile-meta { gap: 4px 12px; margin-top: 8px; }
  .profile-meta li { font-size: 0.78rem; }
  .profile-stats { margin-top: 16px; border-radius: 12px; }
  .profile-stats div { padding: 10px 6px; }
  .profile-stats dt { font-size: 1.15rem; }
  .profile-stats dd { font-size: 0.7rem; }
  .profile-sub { margin-top: 16px; font-size: 0.64rem; }
  .pills { gap: 6px; margin-top: 8px; }
  .pills li { font-size: 0.73rem; padding: 4px 9px; }
  .profile-actions { margin-top: 18px; gap: 7px; }
  .pbtn-main { padding: 10px 12px; font-size: 0.86rem; }
  .picon { width: 42px; height: 42px; }
  .picon::after { display: none; }

  /* about: two-column bento */
  .bento { grid-template-columns: 1fr 1fr; gap: 10px; grid-template-areas: "about about" "now clock" "itil itil" "stack stack" "ready ready"; }
  .tile { padding: 18px; border-radius: 16px; }
  .t-about { padding: 20px; }
  .tile-label { font-size: 0.62rem; margin-bottom: 10px; }
  .about-big { font-size: 1.12rem; line-height: 1.4; }
  .t-about .muted { font-size: 0.9rem; margin-top: 12px; }
  .t-now h3 { font-size: 0.98rem; line-height: 1.25; }
  .t-now .muted { font-size: 0.78rem; margin-top: 2px; }
  .since { font-size: 0.7rem; margin-top: 10px; }
  .clock { font-size: 2rem; }
  .t-clock .muted { font-size: 0.72rem; }
  .t-itil h3 { font-size: 1rem; }
  .t-itil .chips { margin-top: 10px; }
  .t-stack .tile-label { padding: 0 18px; }
  .ready li { font-size: 0.86rem; padding: 4px 0; }

  /* expertise: tabs as a 2x3 grid, nothing hidden off-screen */
  .tabs { gap: 12px; }
  .tab-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow: visible; }
  .tab-list button { white-space: normal; padding: 10px 12px; font-size: 0.82rem; gap: 8px; border-radius: 12px; line-height: 1.25; border-color: var(--line); background: var(--surface); }
  .tab-list button .n { font-size: 0.68rem; }
  .tab-list button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: none; }
  .tab-panels { padding: 22px 18px; border-radius: 18px; }
  .panel-ic { width: 46px; height: 46px; border-radius: 14px; }
  .panel-ic svg { width: 22px; height: 22px; }
  .panel h3 { font-size: 1.25rem; margin-top: 14px; }
  .panel p { font-size: 0.92rem; }
  .panel .chips { margin-top: 16px; }
  .chips { gap: 6px; }
  .chips li { font-size: 0.76rem; padding: 5px 10px; }

  /* experience: tighter cards, long lists collapse */
  .tl { padding-bottom: 12px; }
  .tl-card { padding: 18px; border-radius: 16px; }
  .tl-card h3 { font-size: 1.05rem; }
  .company { font-size: 0.84rem; }
  .tl-date { font-size: 0.72rem; padding: 3px 10px; }
  .tl-head { gap: 10px; }
  .tl-card ul { margin-top: 12px; gap: 6px; }
  .tl-card li { font-size: 0.88rem; line-height: 1.55; padding-left: 18px; }
  .collapsible.collapsed li:nth-child(n+4) { display: none; }
  .more {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--line-2); background: var(--bg-soft); color: var(--accent); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  }
  .more::after { content: "▾"; font-size: 0.7rem; transition: transform 0.2s; }
  .more[aria-expanded="true"]::after { transform: rotate(180deg); }

  /* projects: swipeable carousel */
  .swipe-hint { display: flex; align-items: center; gap: 6px; margin: -12px 0 14px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
  .swipe-hint span { color: var(--accent); animation: nudge 1.6s ease-in-out infinite; }
  @keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
  .projects {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -20px; padding: 4px 20px 18px; scroll-padding: 0 20px; scrollbar-width: none;
  }
  .projects::-webkit-scrollbar { display: none; }
  .project { flex: 0 0 86%; scroll-snap-align: start; padding: 20px; border-radius: 16px; gap: 10px; }
  .js .project.reveal { transform: none; }
  .project h3, .featured h3 { font-size: 1.15rem; }
  .project > p { font-size: 0.88rem; }
  .flow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-top: 14px; }
  .flow::-webkit-scrollbar { display: none; }
  .flow span { flex: none; font-size: 0.72rem; padding: 5px 9px; }
  .flow i { flex: none; width: 12px; }

  .dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
  .dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--line-2); transition: width 0.3s, background 0.3s; }
  .dots span.on { width: 20px; background: var(--accent); }

  /* credentials */
  .creds { gap: 12px; }
  .cred-col { padding: 18px; border-radius: 16px; }
  .edu li { gap: 12px; padding: 12px 0; }
  .edu strong, .cert strong { font-size: 0.9rem; }
  .edu span, .cert span { font-size: 0.8rem; }
  .certs { gap: 8px; margin-top: 10px; }
  .cert { padding: 12px; gap: 12px; border-radius: 12px; }
  .cert .seal { width: 34px; height: 34px; border-radius: 10px; }

  /* contact */
  .contact { padding: 26px 18px; gap: 26px; border-radius: 20px; }
  .contact h2 { font-size: 1.7rem; margin-top: 10px; }
  .contact-lead { font-size: 0.92rem; margin-top: 10px; }
  .contact-links { margin-top: 20px; gap: 8px; grid-template-columns: 1fr 1fr; }
  .contact-links a { padding: 11px; border-radius: 12px; }
  .cl-ic { width: 34px; height: 34px; border-radius: 10px; }
  .contact-form { padding: 20px 16px; border-radius: 16px; }
  .contact-form h3 { font-size: 1.1rem; margin-bottom: 14px; }
  .field { margin-bottom: 12px; }
  .field input, .field textarea { padding: 11px 12px; font-size: 16px; }
  .footer-inner { padding: 20px; font-size: 0.8rem; }
}

@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .projects { margin: 0 -16px; padding: 4px 16px 18px; scroll-padding: 0 16px; }
  .hero h1 { font-size: 1.85rem; }
  .actions .btn { font-size: 0.84rem; gap: 6px; }
  .brand span:last-child { font-size: 0.92rem; }
  .profile-stats dd { font-size: 0.64rem; }
}
