:root {
  color-scheme: dark;
  --ground: #282a36;
  --ink: #f8f8f2;
  --body: #e1deec;
  --muted: #bbbcce;
  --line: #555971;
  --grid: #bd93f91a;
  --panel: #303241;
  --screen: #1b1c28;
  --accent: #bd93f9;
  --on-accent: #221830;
  --screen-muted: #bbbcce;
  --amber: #ffb86c;
  --prompt-color: #50fa7b;
  --cyan: #8be9fd;
  --pink: #ff79c6;
  --yellow: #f1fa8c;
  --art-ground: #222331;
  --glass-sheen: #f8f8f215;
  --glass-shadow: #11101b50;
  --terminal-glass: #14131daf;
  --radius-window: 22px;
  --radius-card: 16px;
  --radius-control: 9px;
  --font: Menlo, "DejaVu Sans Mono", Consolas, ui-monospace, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f1eef6;
  --ink: #28213c;
  --body: #403650;
  --muted: #57486d;
  --line: #b4a9c4;
  --grid: #67479a1d;
  --panel: #e9e3f0;
  --screen: #f8f5fc;
  --accent: #653ba2;
  --on-accent: #fff;
  --screen-muted: #57486d;
  --amber: #925013;
  --prompt-color: #155939;
  --cyan: #205b83;
  --pink: #9b256b;
  --yellow: #755612;
  --art-ground: #dfd8eb;
  --glass-sheen: #ffffffb8;
  --glass-shadow: #54416f26;
  --terminal-glass: #f8f5fcd4;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 28px; scrollbar-color: var(--line) var(--ground); }
html[data-motion="playing"] { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--font); }
[hidden] { display: none !important; }
::selection { color: var(--on-accent); background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3 { margin: 0; }
img { display: block; max-width: 100%; }

.workspace {
  --violet-light: 70% 285px;
  --cyan-light: 87% 480px;
  isolation: isolate;
  position: relative;
  min-width: 0;
  background-color: var(--ground);
  background-image:
    radial-gradient(var(--grid) 1px, transparent 1px),
    radial-gradient(ellipse clamp(135px, 24vw, 360px) 180px at var(--violet-light), color-mix(in srgb, var(--accent) 43%, transparent), transparent),
    radial-gradient(ellipse clamp(100px, 16vw, 240px) 160px at var(--cyan-light), color-mix(in srgb, var(--cyan) 27%, transparent), transparent),
    radial-gradient(ellipse at 75% 14%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 46%);
  background-size: 20px 20px, 100% 1050px, 100% 1050px, 100% 840px;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}

.stage {
  position: sticky;
  z-index: -1;
  top: 0;
  height: 0;
  width: 100%;
  pointer-events: none;
}
.stage canvas {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  mask-image: linear-gradient(to bottom, #000, #000 76%, transparent);
}

.top {
  position: relative;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.skip { position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--accent); color: var(--on-accent); padding: 10px; }
.skip:not(:focus) { clip-path: inset(50%); }
.top-inner, .frame { width: min(100% - clamp(32px, 8%, 136px), 1240px); margin-inline: auto; }
.top-inner { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.brand { display: inline-flex; gap: 11px; align-items: center; width: fit-content; font-size: 15px; font-weight: 700; }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: var(--radius-control); background: var(--accent); color: var(--on-accent); font-size: 20px; line-height: 1; }
.accent, .folder, .path span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: clamp(15px, 3vw, 38px); font-size: 13px; color: var(--body); }
.nav a { display: grid; min-height: 44px; align-items: center; }
.nav a:hover, .section-link:hover, .file:hover strong, .file h3 a:hover, .footer a:hover { color: var(--accent); }
.preferences { display: flex; justify-content: end; gap: 7px; }
.preferences button, .terminal-clear, .film-heading button { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-control); font-size: 12px; }
.preferences button:hover, .terminal-clear:hover, .film-heading button:hover, .terminal-shortcuts button:hover { border-color: var(--accent); color: var(--accent); }
.preferences path { stroke: currentColor; stroke-width: 1.2px; }
[data-theme="dark"] .moon, [data-theme="light"] .sun { display: none; }
[data-motion="playing"] .resume, [data-motion="paused"] .pause { display: none; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
  padding: clamp(74px, 9vw, 134px) 0 clamp(96px, 10vw, 140px);
}

.identity { align-self: start; min-width: 0; text-shadow: 0 2px 22px var(--ground); }
.profile { display: flex; gap: 15px; align-items: center; margin-bottom: 21px; padding-bottom: var(--portrait-room, 0px); }
.avatar { position: relative; z-index: 1; flex: 0 0 60px; height: 60px; }
.portrait-frame { position: absolute; inset: 0 auto auto 0; width: var(--portrait-size, 60px); aspect-ratio: 1; }
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  clip-path: polygon(0 0, 28% 0, 28% 12%, 12% 12%, 12% 28%, 0 28%, 0 72%, 12% 72%, 12% 88%, 28% 88%, 28% 100%, 72% 100%, 72% 88%, 88% 88%, 88% 72%, 100% 72%, 100% 28%, 88% 28%, 88% 12%, 72% 12%, 72% 0);
  pointer-events: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-control); background: var(--panel); }
.avatar[data-pixelating] img, .avatar[data-pixelating] .portrait-frame::after { opacity: 0; }
.portrait-pixels { position: absolute; inset: 0 auto auto 0; width: var(--portrait-large); height: var(--portrait-large); pointer-events: none; }
.path { color: var(--muted); font-size: 13px; translate: 0 calc(var(--portrait-room, 0px) * 1.36); }

h1 { font-size: clamp(66px, 9vw, 132px); font-weight: 800; line-height: .86; letter-spacing: -.105em; margin-left: -.065em; }
.name-caret { display: inline-block; width: .35em; height: .62em; margin-left: .13em; background: var(--accent); }
html[data-motion="playing"] .name-caret { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.role { margin-top: 28px; color: var(--accent); font-size: clamp(16px, 2.1vw, 25px); font-weight: 700; letter-spacing: -.04em; }
.intro { max-width: 40ch; margin-top: 10px; color: var(--body); font-size: 14px; line-height: 1.7; }
.socials { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.action { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 14px; min-height: 44px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-control); font-size: 13px; font-weight: 700; }
.action.primary { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.action:hover { box-shadow: 0 6px 16px var(--glass-shadow); transform: translateY(-1px); }
.action:active { box-shadow: none; transform: none; }

.terminal {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 76%, var(--accent));
  border-radius: var(--radius-window);
  background-color: var(--screen);
  box-shadow: inset 0 1px 0 var(--glass-sheen), 0 26px 72px var(--glass-shadow), 0 0 40px var(--grid);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .terminal {
    background-color: var(--terminal-glass);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
}
@media (min-width: 720px) {
  .terminal { translate: 0 calc(var(--portrait-room, 0px) * -.5); }
}
.terminal-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 46px; padding-inline: 17px 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent); border-radius: calc(var(--radius-window) - 1px) calc(var(--radius-window) - 1px) 0 0; background: linear-gradient(155deg, var(--glass-sheen), transparent 70%); }
.window-dots { display: flex; gap: 5px; }
.window-dots i, .tray-window-header i { width: 7px; height: 7px; display: block; background: var(--line); }
.window-dots i { border-radius: 50%; }
.window-dots i:first-child { background: var(--pink); }
.window-dots i:nth-child(2) { background: var(--yellow); }
.window-dots i:nth-child(3) { background: var(--prompt-color); }
.terminal-bar h2 { font-size: 12px; font-weight: 400; color: var(--body); }
.terminal-clear { justify-self: end; min-width: 34px; height: 32px; border-color: transparent; background: transparent; font-size: 17px; }
.console { padding: 16px 18px 14px; }
.terminal-output { height: 214px; padding: 4px 8px 6px 0; overflow: auto; overflow-wrap: anywhere; color: var(--screen-muted); font-size: 13px; line-height: 1.65; }
.terminal-output p, .terminal-items { margin: 0 0 3px; }
.terminal-output .terminal-command { margin-top: 13px; color: var(--ink); }
.terminal-output .terminal-command:first-child { margin-top: 0; }
.terminal-command span, .prompt { color: var(--prompt-color); }
.terminal-output a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.terminal-items { display: grid; gap: 4px; list-style: none; padding: 0 0 0 16px; }
.terminal-items li { display: grid; grid-template-columns: minmax(0, 1fr); }
.terminal-items code { color: var(--ink); }
.terminal-form { display: flex; align-items: center; min-height: 43px; gap: 9px; border-top: 1px solid var(--line); margin-top: 10px; }
.terminal-form input { min-width: 0; width: 100%; height: 43px; padding: 0 3px; background: transparent; border: 0; font-size: 16px; caret-color: var(--prompt-color); }
.terminal-form input::placeholder { color: var(--screen-muted); font-size: 13px; }
.terminal-form input:focus { outline: none; }
.terminal-form input:focus::placeholder { color: transparent; }
.terminal-shortcuts { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 13px; border-top: 1px solid color-mix(in srgb, var(--line) 64%, transparent); }
.terminal-shortcuts button { min-height: 34px; background: color-mix(in srgb, var(--screen) 48%, transparent); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0 8px; color: var(--body); font-size: 11px; }

.scene-next { position: absolute; bottom: 23px; left: 0; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--body); font-size: 12px; }
.scene-next span:first-child { color: var(--accent); font-size: 18px; }
.scene-next:hover { color: var(--ink); }

html[data-motion="playing"][data-entrance] .identity {
  animation: arrive 760ms cubic-bezier(.2,.7,.25,1) both;
}
html[data-motion="playing"][data-entrance] .terminal {
  transform-origin: 70% 55%;
  animation: dock 1000ms cubic-bezier(.18,.68,.23,1) both;
}
@keyframes arrive { from { opacity: .72; transform: translateY(27px); } }
@keyframes dock {
  from { transform: perspective(1000px) translate3d(25px, 26px, -93px) rotateY(-13deg); }
  to { transform: perspective(1000px); }
}

.section { min-width: 0; padding-top: 26px; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
.section-head h2 { font-size: clamp(23px, 4vw, 36px); line-height: 1.15; letter-spacing: -.065em; }
.section-link { font-size: 12px; color: var(--body); text-decoration: underline; text-underline-offset: 4px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: color-mix(in srgb, var(--panel) 74%, transparent);
  background-image: linear-gradient(155deg, var(--glass-sheen), transparent 70%);
  box-shadow: 0 10px 26px var(--glass-shadow);
}
.project:focus-within, .project:hover { border-color: var(--accent); }

.project-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(148px, 17vw, 214px);
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) 0 0;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--art-ground);
  background-position: center;
  background-size: 16px 16px;
}
.tray-art { background-color: color-mix(in srgb, var(--art-ground) 92%, var(--cyan)); }
.tray-window { width: 78%; max-width: 290px; border: 1px solid #555971; border-radius: var(--radius-control); background: #282a36; box-shadow: 0 9px 22px #0005; }
.tray-window img { width: 100%; height: auto; border-radius: 0 0 calc(var(--radius-control) - 1px) calc(var(--radius-control) - 1px); }
.tray-window-header { display: flex; align-items: center; gap: 3px; min-height: 18px; padding: 3px 6px; color: #ddd5e9; font-size: 9px; }
.tray-window-header i { width: 4px; height: 4px; background: #bd93f9; }
.tray-window-header span { margin-left: auto; }
.expo-art { align-content: center; gap: 16px; color: var(--accent); background-color: color-mix(in srgb, var(--art-ground) 93%, var(--accent)); }
.socket::after { content: ""; position: absolute; left: 0; top: 17px; width: 5px; height: 5px; background: var(--accent); opacity: 0; }
.project:hover .socket::after, .project:focus-within .socket::after { animation: packet 720ms steps(8) 2; }
@keyframes packet {
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}
.expo-diagram { display: flex; gap: 6px; align-items: center; padding-inline: 6px; min-width: 0; }
.expo-diagram .node { display: grid; width: 54px; justify-items: center; gap: 10px; color: var(--body); font-size: 10px; }
.device-pixel, .monitor-pixel, .socket i { display: block; background: currentColor; }
.device-pixel { width: 26px; height: 36px; color: var(--accent); clip-path: polygon(evenodd, 0 3px, 3px 3px, 3px 0, 23px 0, 23px 3px, 26px 3px, 26px 33px, 23px 33px, 23px 36px, 3px 36px, 3px 33px, 0 33px, 0 3px, 4px 5px, 4px 30px, 22px 30px, 22px 5px, 4px 5px); }
.monitor-pixel { width: 44px; height: 36px; color: var(--accent); clip-path: polygon(evenodd, 0 0, 44px 0, 44px 29px, 24px 29px, 24px 32px, 32px 32px, 32px 36px, 12px 36px, 12px 32px, 20px 32px, 20px 29px, 0 29px, 0 0, 4px 4px, 4px 25px, 40px 25px, 40px 4px, 4px 4px); }
.socket { position: relative; display: grid; align-self: start; margin-top: 5px; justify-items: center; color: var(--amber); font-size: 10px; }
.socket i { width: clamp(26px, 4vw, 68px); height: 12px; clip-path: polygon(0 40%, 78% 40%, 78% 0, 100% 50%, 78% 100%, 78% 60%, 0 60%); }
.expo-art code { max-width: 95%; padding: 5px 6px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--screen); color: var(--body); text-align: center; font-size: clamp(9px, 1.05vw, 11px); overflow-wrap: anywhere; }
.expo-art code span { color: var(--accent); }

.olympi-art { perspective: 460px; isolation: isolate; background-color: color-mix(in srgb, var(--art-ground) 93%, var(--pink)); }
.phone { display: block; position: absolute; top: 16%; left: 50%; width: clamp(64px, 8vw, 102px); padding: 3px; border: 2px solid #9889ae; border-radius: 12px; background: #222231; box-shadow: 5px 2px 0 #51445e, 8px 6px 14px #0006; transition: transform 240ms ease-out; }
.phone img { width: 100%; height: auto; border-radius: 7px; }
.phone-front { z-index: 1; transform: translateX(-70%) rotateY(calc(-21deg + var(--art-angle, 0deg))) rotateZ(-15deg); }
.phone-back { top: 22%; transform: translateX(12%) rotateY(calc(-17deg + var(--art-angle, 0deg))) rotateZ(13deg); }
.olympi-art:hover .phone-front { transform: translateX(-77%) rotateY(-13deg) rotateZ(-9deg); }
.olympi-art:hover .phone-back { transform: translateX(17%) rotateY(-11deg) rotateZ(9deg); }
.play-chip { position: absolute; z-index: 2; left: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 33px; border: 1px solid var(--accent); border-radius: var(--radius-control); background: var(--screen); color: var(--accent); font-size: 13px; }

.project-info { display: grid; gap: 9px; padding: 17px clamp(12px, 2vw, 23px) 20px; }
.tag { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.tag span { width: 6px; height: 6px; background: var(--accent); }
.project-info h3 { font-size: clamp(14px, 1.65vw, 21px); line-height: 1.22; letter-spacing: -.035em; overflow-wrap: anywhere; }
.project-info h3 a:hover { color: var(--accent); }
.project-info h3 span { color: var(--accent); font-size: .84em; }
.project-info > p:last-child, .file p { color: var(--body); font-size: 13px; line-height: 1.65; }

.secondary { display: grid; gap: clamp(45px, 7vw, 98px); margin: clamp(58px, 8vw, 112px) 0 64px; }
.secondary .section { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); column-gap: clamp(24px, 7vw, 95px); align-items: start; }
.secondary .section-head { position: relative; align-self: stretch; }
.secondary .all-articles { grid-column: 2; justify-self: start; }
#projects .folder { color: var(--cyan); }
#ai .folder, #ai .file-icon { color: var(--pink); }
#articles .folder, #articles .file-icon { color: var(--yellow); }
.files { border-top: 1px solid var(--line); }
.file { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 14px 8px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ground) 95%, transparent); }
.file-icon, .file-arrow { color: var(--accent); font-size: 13px; }
.file h3, .file strong { font-size: 14px; line-height: 1.5; }
.file p { margin-top: 5px; }
.all-articles { display: inline-block; margin-top: 15px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

dialog { max-width: min(calc(100% - 28px), 780px); width: 100%; padding: 0; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-window); box-shadow: 0 24px 80px #05040db3; }
dialog::backdrop { background: #151321d9; }
.film-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; }
.film-heading h2 { font-size: 16px; }
.film-heading button { font-size: 20px; }
#film { width: 100%; max-height: 470px; display: block; background: #050706; }
.film-credit { padding: 12px; font-size: 11px; line-height: 1.5; color: var(--body); }
.film-credit a { text-decoration: underline; }

::view-transition-group(root) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (max-width: 719px) {
  .workspace { --violet-light: 38% 641px; --cyan-light: 82% 794px; }
  .top-inner { min-height: 64px; grid-template-columns: 1fr auto; gap: 0 10px; padding-top: 7px; }
  .nav { grid-row: 2; grid-column: 1 / -1; gap: 26px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 43px; padding-bottom: 79px; gap: 34px; }
  h1 { font-size: clamp(74px, 14vw, 106px); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .secondary { gap: 42px; margin-top: 48px; }
  .secondary .section { display: block; }
}

@media (max-width: 465px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-art { height: 176px; }
  .console { padding-inline: 12px; }
  .terminal-output { height: 176px; }
  .terminal-shortcuts { gap: 4px; padding: 7px; }
  .terminal-shortcuts button { min-height: 38px; padding-inline: 6px; }
  .phone { width: 87px; }
}

@media (max-width: 319px) {
  h1 { font-size: 58px; }
  .terminal-bar h2 { font-size: 10px; }
  .nav { gap: 15px; }
}

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

html[data-motion="paused"] .socket::after { animation: none; }
html[data-motion="paused"] .phone { transition: none; }
