:root {
  color-scheme: dark;
  --bg: #080a13;
  --panel: #101421;
  --ink: #f3f4fa;
  --muted: #aeb5cc;
  --custom-accent: #aab6ff;
  --accent: color-mix(in srgb, var(--custom-accent) 58%, #e7eaff);
  --stroke: #252b42;
  --frame: min(100% - 104px, 1320px);
  --display: "Segoe UI", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
  font-family: var(--display);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 280px; margin: 0; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul { margin: 0; }
svg { display: block; }
.frame { width: var(--frame); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px 18px; background: var(--ink); color: var(--bg); }

.site-header { position: relative; z-index: 2; border-bottom: 1px solid #1c2235; background: #080a13; }
.header-inner { position: relative; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 9px; font-weight: 800; font-size: 1.11rem; letter-spacing: .1em; }
.brand svg { color: #9aaaff; width: 34px; height: 34px; }
.brand-period { color: var(--accent); }
.brand [data-brand] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-inner .brand, .footer-inner .brand { max-width: min(52%, 310px); }
.brand svg { flex: 0 0 auto; }
.site-header nav { display: flex; position: absolute; left: 50%; transform: translateX(-50%); gap: 36px; align-items: center; }
.header-inner:has(#edit-site:not([hidden])) nav { position: static; min-width: 0; transform: none; }
.site-header nav a, .back-top { color: var(--muted); font-size: .92rem; font-weight: 600; white-space: nowrap; transition: color .18s ease; }
.site-header nav a { overflow: hidden; text-overflow: ellipsis; }
.site-header nav a:hover, .back-top:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-edit-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #5b6baa;
  border-radius: 100px;
  background: #222b52;
  color: #e9edff;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
}
.site-edit-button:hover { border-color: var(--accent); background: #2c396d; }
.site-save-status {
  position: fixed;
  z-index: 4;
  right: clamp(16px, 5vw, 60px);
  bottom: 20px;
  max-width: calc(100% - 32px);
  padding: 12px 17px;
  border: 1px solid #6473b3;
  border-radius: 12px;
  background: #202a4a;
  box-shadow: 0 8px 20px #0009;
}
.header-reel, .primary-button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; gap: 9px; border-radius: 100px; font-weight: 750; white-space: nowrap; transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.header-reel { min-height: 41px; padding: 0 16px 1px 12px; border: 1px solid #323950; background: #101422; font-size: .88rem; }
.header-reel:hover { border-color: #7384eb; background: #182140; }
.header-reel svg { width: 17px; height: 17px; color: var(--accent); }

.hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: clamp(550px, 45vw, 675px);
  align-items: center;
  background:
    linear-gradient(0deg, #080a13 0%, #080a1300 23%),
    radial-gradient(ellipse 69% 105% at 78% 48%, #192b5a 0%, #101c3a 39%, #090d1c 70%, #080a13 95%);
}
.hero-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(#8a99f713 1px, transparent 1px), linear-gradient(90deg, #8a99f713 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 52% 85% at 76% 45%, #000 0%, #0000 94%);
}
.orbital-art {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: clamp(690px, 65vw, 1080px);
  height: auto;
  top: 49%;
  right: max(-130px, calc((100vw - 1530px) / 2));
  transform: translateY(-50%);
}
.orbital-accent { stop-color: color-mix(in srgb, var(--custom-accent) 80%, #5164e1); }
.hero-inner { position: relative; padding-block: 68px 79px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  color: #b8c1f5;
  font: 500 .81rem/1.25 var(--mono);
  letter-spacing: .18em;
}
.eyebrow-rule { width: 22px; height: 1px; background: #9aa9ff; }
.hero h1 {
  margin-left: -.045em;
  font-size: clamp(3.1rem, 6.7vw, 6.7rem);
  font-weight: 900;
  line-height: .985;
  letter-spacing: -.072em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hero h1 span { color: color-mix(in srgb, var(--custom-accent) 68%, #dce0ff); white-space: pre-line; }
.hero-subtitle { margin-top: 25px; color: #d1d6e8; font-size: clamp(1.12rem, 1.55vw, 1.42rem); letter-spacing: -.015em; }
.hero-subtitle:empty, .section-top p:empty, .skills-intro:empty { display: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px 25px; align-items: center; margin-top: 30px; }
.primary-button { min-height: 51px; padding: 0 23px; border: 1px solid #f3f4fa; background: #f3f4fa; color: #0c1123; font-size: .94rem; }
.primary-button:hover { border-color: #c2caff; background: #c2caff; box-shadow: 0 5px 28px #8498ff39; }
.primary-button svg { width: 20px; height: 20px; }
.text-button { display: inline-flex; min-height: 46px; align-items: center; color: #c6cee7; font-size: .94rem; font-weight: 650; text-decoration: underline; text-decoration-color: #727d9c; text-underline-offset: 5px; transition: color .18s ease; }
.text-button:hover { color: white; }

.section { scroll-margin-top: 24px; }
.projects-section { padding: 38px 0 clamp(72px, 7vw, 110px); }
.section-top { display: flex; align-items: end; justify-content: space-between; gap: 20px 30px; margin-bottom: 27px; }
.section h2, .contact-section h2 { font-weight: 780; font-size: clamp(2.05rem, 3.55vw, 3.65rem); line-height: 1.08; letter-spacing: -.06em; overflow-wrap: anywhere; }
.section-top p { color: var(--muted); line-height: 1.55; margin-top: 10px; }
.project-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.project-filters button {
  min-height: 39px;
  padding: 0 13px;
  border-radius: 30px;
  border: 1px solid #30364d;
  background: transparent;
  color: #c5cce2;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 650;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.project-filters button:hover { border-color: #7081c5; }
.project-filters button[aria-pressed="true"] { background: #222b52; border-color: #46558e; color: #e0e4ff; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(13px, 1.5vw, 24px); }
.empty-projects { color: var(--muted); padding-block: 12px; }
.project-card { min-width: 0; }
.project-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  text-align: left;
  transition: border-color .22s ease, background .22s ease;
}
.project-button:hover { border-color: #6072b3; background: #151b2e; }
.project-cover { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at 72% 25%, #303a68 0%, #171d34 62%); }
.project-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #090b1966, transparent 55%, #090b1920); pointer-events: none; }
.project-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.project-button:hover img { transform: scale(1.04); }
.project-play { display: grid; place-items: center; position: absolute; z-index: 1; right: 12px; bottom: 12px; width: 42px; height: 42px; background: #0b1026bf; border: 1px solid #e2e6ff74; border-radius: 50%; color: white; transition: background .18s ease, color .18s ease; }
.project-play svg { width: 21px; height: 21px; }
.project-button:hover .project-play { background: #e9ecff; color: #111a35; }
.project-info { display: block; padding: 16px 16px 18px; overflow-wrap: anywhere; }
.project-category { display: block; color: #aebaff; font: 500 .76rem/1.4 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.project-title { display: block; margin-top: 5px; font-size: clamp(1.22rem, 2vw, 1.6rem); font-weight: 750; line-height: 1.2; letter-spacing: -.035em; }
.project-note { display: block; margin-top: 6px; color: var(--muted); font-size: .91rem; line-height: 1.35; }

.skills-section { padding: clamp(53px, 7.2vw, 104px) 0; border-block: 1px solid #22283c; background: radial-gradient(ellipse 100% 125% at 2% 0%, #111933 0%, #0b0e1a 58%); }
.skills-inner { display: grid; grid-template-columns: .78fr 1.22fr; gap: 42px; }
.skills-intro { margin-top: 18px; color: #bec6e8; font-size: clamp(1.18rem, 2.4vw, 1.7rem); line-height: 1.35; letter-spacing: -.025em; white-space: pre-line; }
.skills-list { display: grid; gap: 15px; }
.skill { display: grid; grid-template-columns: auto 1fr; gap: 17px; padding: 22px; border: 1px solid #252e47; border-radius: 13px; background: #12182a; }
.skill-icon { display: grid; place-items: center; width: 41px; height: 41px; border: 1px solid #3a477c; border-radius: 10px; background: #1d2749; color: var(--accent); }
.skill-icon svg { width: 24px; height: 24px; }
.skill h3 { font-size: 1.23rem; line-height: 1.3; letter-spacing: -.02em; }
.skill > div:last-child, .player-heading > div, .player-description { min-width: 0; overflow-wrap: anywhere; }
.skill p { margin-top: 6px; color: var(--muted); line-height: 1.5; }
.skill ul { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding: 0; list-style: none; }
.skill li { padding: 4px 9px; border: 1px solid #313c5a; border-radius: 24px; color: #c5ceeb; font-size: .875rem; }
.contact-section { padding: 62px 0; border-bottom: 1px solid var(--stroke); }
.contact-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 25px; }
.footer-inner { display: flex; min-height: 90px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding-block: 14px; }
.footer-inner p { color: var(--muted); font-size: .875rem; }

body:has(dialog[open]) { overflow: hidden; }
#player { width: min(760px, 100% - 32px); max-height: calc(100% - 32px); padding: 18px; border: 1px solid #444f77; border-radius: 17px; background: #111625; color: var(--ink); }
#player::backdrop { background: #050713db; backdrop-filter: blur(8px); }
.player-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px 20px; margin-bottom: 13px; }
.player-category { color: var(--accent); font: .75rem/1.35 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.player-heading h2 { margin-top: 2px; font-size: clamp(1.55rem, 5vw, 2rem); letter-spacing: -.05em; line-height: 1.18; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; padding: 0; border: 1px solid #343f63; border-radius: 9px; background: #1c2541; }
.icon-button:hover { background: #2a3966; }
.icon-button svg { width: 22px; height: 22px; }
.player-screen { overflow: hidden; border: 1px solid var(--stroke); border-radius: 10px; background: #05060c; }
.player-screen canvas, .player-screen video { display: block; width: 100%; aspect-ratio: 16 / 9; }
.player-controls { display: flex; gap: 13px; align-items: center; padding-top: 12px; }
.player-controls input { width: 100%; min-width: 0; padding: 0; accent-color: #a4afff; cursor: pointer; }
.player-controls output { color: #cbd2ee; font: .81rem/1 var(--mono); white-space: nowrap; }
.player-description, .player-error { padding-top: 12px; color: #bfc7de; line-height: 1.45; }
.player-error { color: #ffc2c9; }

@media (max-width: 900px) {
  :root { --frame: calc(100% - 64px); }
  .hero { min-height: 540px; }
  .orbital-art { right: -174px; opacity: .82; }
  .hero h1 { font-size: clamp(2.9rem, 8.3vw, 5rem); }
  .project-info { padding-inline: 13px; }
}

@media (max-width: 700px) {
  :root { --frame: calc(100% - 40px); }
  .header-inner { min-height: 61px; gap: 12px; }
  .site-header nav { position: static; transform: none; gap: 17px; }
  .site-header nav a { font-size: .83rem; }
  .brand { gap: 4px; font-size: .93rem; }
  .brand svg { width: 31px; height: 31px; }
  .header-reel { min-height: 34px; gap: 3px; padding: 0 9px 1px 6px; font-size: .77rem; }
  .header-reel svg { width: 15px; height: 15px; }
  .header-actions:has(#edit-site:not([hidden])) .header-reel { display: none; }
  .site-edit-button { min-height: 36px; padding-inline: 10px; font-size: .82rem; }
  .hero { min-height: 500px; align-items: end; }
  .hero-inner { padding-block: 112px 64px; }
  .orbital-art { width: 680px; right: -212px; top: 42%; opacity: .64; }
  .hero h1 { font-size: clamp(2.3rem, 9.7vw, 4.2rem); }
  .hero-subtitle { margin-top: 20px; }
  .hero-actions { margin-top: 23px; }
  .projects-section { padding-top: 22px; }
  .section-top { align-items: start; flex-direction: column; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills-inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 460px) {
  .site-header nav { gap: 12px; }
  .site-header nav a { font-size: .81rem; }
  .header-reel { display: none; }
  .header-inner:has(#edit-site:not([hidden])) nav { order: 1; width: 100%; padding: 0 0 12px 2px; }
  .header-inner:has(#edit-site:not([hidden])) { flex-wrap: wrap; padding-top: 9px; gap: 8px; }
  .hero { min-height: 464px; }
  .hero-inner { padding-bottom: 49px; }
  .eyebrow { margin-bottom: 18px; font-size: .73rem; }
  .hero-actions { gap: 4px 17px; }
  .hero .primary-button { min-height: 46px; padding-inline: 14px; font-size: .875rem; }
  .hero .text-button { font-size: .875rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-info { padding-inline: 15px; }
  .skill { gap: 12px; padding: 16px; }
  .footer-inner p { order: 1; width: 100%; }
  #player { width: calc(100% - 22px); padding: 12px; }
  .player-controls { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
