:root {
  --bg: #000000; --surface: #111317; --text: #f2f4f8; --muted: #9aa3b5;
  --line: #23262d; --accent: #7a9bff; --accent-soft: #1b2340; --side: #1a1c20; --on-accent: #0b1020;
}
:root[data-theme="light"] {
  --bg: #f7f8fb; --surface: #ffffff; --text: #151a2c; --muted: #5b6478;
  --line: #e3e7ef; --accent: #2f5bea; --accent-soft: #e8eefe; --side: #ffffff; --on-accent: #ffffff;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.side a:focus-visible, .side button:focus-visible { outline-offset: -4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; text-decoration: none; }
body { background: var(--bg); color: var(--text); font: 16px/1.65 "Montserrat", system-ui, "Segoe UI", Roboto, sans-serif; padding-left: 84px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

.side { position: fixed; left: 0; top: 0; bottom: 0; width: 84px; z-index: 10; background: var(--side); display: flex; flex-direction: column; align-items: stretch; }
.side a, .side button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 1; max-height: 96px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: none; border: 0; cursor: pointer; font-family: inherit; }
.side .ico { font-size: 24px; line-height: 1; display: inline-flex; }
.side a:hover, .side a[aria-current], .side button:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.side .sp { flex: 1; }

.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 16px; background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); }
.hero h1 { font-size: clamp(34px, 7vw, 68px); line-height: 1.1; font-weight: 300; letter-spacing: .02em; margin: 24px 0 14px; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero .cta { justify-content: center; }
.hero { position: relative; }
.signature { position: absolute; left: 64px; bottom: 90px; width: clamp(150px, 18vw, 230px); height: auto; filter: brightness(0) invert(1); opacity: .85; pointer-events: none; }
:root[data-theme="light"] .signature { filter: none; opacity: 1; }
.btn { padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.avatar { display: block; width: 260px; height: 260px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; perspective: 900px; }
.av-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .8s; transform-style: preserve-3d; }
.avatar.flipped .av-in { transform: rotateY(180deg); }
.af, .ab { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.af { background: linear-gradient(135deg, var(--accent), #8f6bff); color: var(--on-accent); font-size: 86px; font-weight: 700; box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 30%, transparent); }
.ab { background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 28px; font-weight: 300; line-height: 1.3; padding: 32px; transform: rotateY(180deg); box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 22%, transparent); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 14px; }

section { padding: 44px 0; scroll-margin-top: 60px; }
h2 { font-size: 26px; margin-bottom: 20px; }
h2::after { content: ""; display: block; width: 36px; height: 3px; background: var(--accent); border-radius: 3px; margin-top: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }

.timeline { display: grid; gap: 14px; }
.job h3 { font-size: 18px; }
.job .meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.job ul { padding-left: 18px; color: var(--muted); }
.job li + li { margin-top: 4px; }
.tl { list-style: none; margin: 18px 0 0 6px; padding: 0 0 0 26px; border-left: 2px solid var(--line); }
.tl > li { position: relative; padding-bottom: 22px; }
.tl > li + li { margin-top: 0; }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before { content: ""; position: absolute; left: -35px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tl h4 { font-size: 16px; font-weight: 600; }
.tl .meta { margin-bottom: 6px; }
.tl ul { color: var(--muted); padding-left: 18px; }
.tl > li:first-child::before { background: var(--accent); }
.chip { transition: opacity .2s; }
.chip.dim { opacity: .25; }
.progress { position: fixed; top: 0; left: 84px; right: 0; height: 3px; z-index: 12; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.tilt { transition: transform .15s ease-out; will-change: transform; }
.edu { position: relative; padding-right: 170px; }
.edu .badge-link { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); line-height: 0; border-radius: 8px; }
.edu .badge { height: 72px; width: auto; }
.badge-light { display: none; }
:root[data-theme="light"] .badge-dark { display: none; }
:root[data-theme="light"] .badge-light { display: block; }
.tl p { color: var(--muted); font-size: 15px; }
.stores { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 4px; font-size: 15px; }
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.scrim.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(620px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); transform: translateX(100%); visibility: hidden; transition: transform .35s ease, visibility 0s .35s; outline: none; }
.drawer.open { transform: none; visibility: visible; transition-delay: 0s; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-top h2 { margin: 0; font-size: 22px; color: var(--muted); }
.drawer-top h2::after { display: none; }
.drawer-top button { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); cursor: pointer; }
.drawer-top button:hover { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px 28px; overscroll-behavior: contain; }
.drawer section { padding: 0 0 12px; scroll-margin-top: 12px; }
.drawer .card { background: var(--bg); }
.dh { font-size: 24px; font-weight: 600; margin: 24px 0 14px; }
.sub { font-size: 20px; font-weight: 600; margin: 32px 0 14px; }
body.drawer-open { overflow: hidden; }
@media print {
  .scrim, .drawer-top button { display: none; }
  .drawer { position: static; transform: none; visibility: visible; width: auto; border: 0; }
  .drawer-body { overflow: visible; }
}
.suits { position: absolute; right: 8px; top: 0; bottom: 0; width: 150px; pointer-events: none; overflow: hidden; }
.suits span { position: absolute; font-size: 28px; line-height: 1; color: color-mix(in srgb, var(--accent) 38%, transparent); animation: suit-float 6s ease-in-out infinite; }
.suits span:nth-child(1) { right: 96px; top: 6px; }
.suits span:nth-child(2) { right: 20px; top: 18px; animation-delay: -1.5s; }
.suits span:nth-child(3) { right: 84px; top: 58px; animation-delay: -3s; }
.suits span:nth-child(4) { right: 8px; top: 70px; animation-delay: -4.5s; }
@keyframes suit-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(10deg); } }
@media (max-width: 520px) {
  .suits { width: 110px; height: 44px; bottom: auto; right: 0; overflow: visible; }
  .suits span { font-size: 20px; }
  .suits span:nth-child(1) { right: 84px; top: 8px; }
  .suits span:nth-child(2) { right: 58px; top: 2px; }
  .suits span:nth-child(3) { right: 32px; top: 12px; }
  .suits span:nth-child(4) { right: 6px; top: 4px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 14px; font-size: 14px; font-weight: 500; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.skills-grid h3 { font-size: 15px; margin-bottom: 12px; }

.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.projects h3 { font-size: 17px; margin-bottom: 6px; }
.projects p { color: var(--muted); font-size: 15px; margin-bottom: 12px; }

.contact { text-align: center; }
.contact p { color: var(--muted); margin-bottom: 20px; }
.contact .cta { justify-content: center; }

.totop { position: fixed; right: 20px; bottom: 20px; z-index: 11; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover { color: var(--text); }
footer { padding: 24px 0; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  body { padding-left: 0; padding-bottom: 64px; }
  .progress { left: 0; }
  .signature { left: 20px; bottom: 54px; }
  .side { top: auto; width: 100%; height: 64px; flex-direction: row; }
  .side a, .side button { max-height: none; font-size: 11px; letter-spacing: 0; text-transform: none; }
  .side .ico { font-size: 20px; }
  .side .sp { display: none; }
  .hero { min-height: calc(100vh - 64px); padding-bottom: 120px; }
  .totop { bottom: 80px; right: 14px; }
  .avatar { width: 215px; height: 215px; }
  .af { font-size: 68px; }
  .ab { font-size: 23px; padding: 24px; }
}
