/*
 * Oyende Favour · portfolio
 * One dark world, on purpose: an editor and a terminal, in black and green.
 * Layout: full-screen matrix hero → component tree → cube + CLI → about object → contact command.
 */
:root {
  --bg: #070a08;
  --panel: #0d120f;
  --panel-2: #111814;
  --line: #1c2a22;
  --ink: #d6e6db;
  --muted: #6f8b78;
  --green: #2ee27a;
  --green-2: #19a556;
  --green-deep: #0e4d2b;
  --amber: #f0b44c;
  --blue: #7cc4ff;
  --pink: #ff8fb8;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cube: min(300px, 70vw);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.g { color: var(--green); }
.b { color: var(--blue); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.comment { color: var(--muted); font-size: 0.85rem; }
.todo { color: var(--amber) !important; border-bottom: 1px dashed currentColor; }
kbd { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--green); }
.cursor { color: var(--green); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Top bar */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  background: rgba(7, 10, 8, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 42, 34, 0.6);
  font-size: 0.85rem;
  white-space: nowrap;
}
@media (max-width: 480px) { .top { gap: 12px; } .top nav { gap: 12px; } .top nav a::before { content: ""; } }
.path { text-decoration: none; color: var(--muted); }
.path:hover { color: var(--ink); }
.top nav { margin-left: auto; display: flex; gap: 18px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a::before { content: "./"; color: var(--green-2); }
.top nav a:hover { color: var(--green); }

/* Hero: the first page is an editor window with the code rain inside it */
.hero { position: relative; min-height: 100svh; padding: calc(58px + env(safe-area-inset-top, 0px)) clamp(10px, 2vw, 22px) 46px; display: grid; }
.ide {
  position: relative; display: grid; grid-template-rows: auto 1fr auto;
  min-height: calc(100svh - 104px - env(safe-area-inset-top, 0px));
  border: 1px solid #263a2e; border-radius: 10px; overflow: hidden;
  background: #0b0f0c;
  box-shadow: 0 0 0 1px rgba(46, 226, 122, 0.05), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.ide-bar { display: flex; align-items: stretch; background: #161b18; border-bottom: 1px solid #263a2e; font-size: 0.8rem; min-height: 38px; }
.ide-bar .dots { display: flex; gap: 7px; align-items: center; padding: 0 14px; }
.ide-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a3a30; }
.ide-bar .dots i:first-child { background: #ff5f57; } .ide-bar .dots i:nth-child(2) { background: #febc2e; } .ide-bar .dots i:nth-child(3) { background: #28c840; }
.ide-tab { display: flex; align-items: center; padding: 0 16px; color: var(--muted); border-right: 1px solid #263a2e; white-space: nowrap; letter-spacing: 0.06em; }
.ide-tab.on { color: var(--ink); background: #0b0f0c; box-shadow: inset 0 2px 0 var(--green); margin-bottom: -1px; }
.ide-title { margin-left: auto; align-self: center; padding: 0 14px; color: #3d5546; white-space: nowrap; }
@media (max-width: 560px) { .ide-title, .ide-tab:not(.on) { display: none; } }
.ide-body { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 0; }
/* height:0 + min-height:100% keeps the 60 line numbers from stretching the window */
.gutter { height: 0; min-height: 100%; list-style: none; margin: 0; padding: 14px 0; counter-reset: g; overflow: hidden; border-right: 1px solid #1a2620; background: #0b0f0c; font-size: 0.75rem; line-height: 1.9; color: #2f4337; user-select: none; }
.gutter li { counter-increment: g; padding: 0 12px 0 14px; text-align: right; }
.gutter li::before { content: counter(g); }
.gutter li.cur { color: var(--green); background: rgba(46, 226, 122, 0.05); }
@media (max-width: 560px) { .gutter { font-size: 0.65rem; } .gutter li { padding: 0 6px 0 8px; } }
.ide-view { position: relative; overflow: hidden; isolation: isolate; display: grid; align-items: center; }
#rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.ide-view::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 75% 65% at 32% 52%, rgba(11, 15, 12, 0.9), rgba(11, 15, 12, 0.35) 72%);
}
.hero-inner { padding: clamp(22px, 4vw, 48px) clamp(18px, 5vw, 64px); display: grid; gap: clamp(14px, 2vh, 22px); justify-items: start; }
.ide-status { display: flex; gap: 16px; align-items: center; padding: 4px 12px; background: var(--green-deep); color: #bfe9cf; font-size: 0.72rem; white-space: nowrap; overflow: hidden; }
.ide-status .sp { flex: 1; }
@media (max-width: 560px) { .ide-status span:nth-child(n+5) { display: none; } }
.tag { color: var(--ink); opacity: 0.8; font-size: 0.95rem; letter-spacing: 0.08em; }
.src { margin: 0; font-family: var(--mono); font-size: clamp(0.72rem, 0.62rem + 0.45vw, 0.98rem); line-height: 1.75; color: var(--ink); white-space: pre; max-width: 100%; overflow-x: auto; transition: opacity .6s; }
.src .ln { display: inline-block; min-width: 100%; padding-right: 8px; }
.src .ln.on { background: rgba(46, 226, 122, 0.06); box-shadow: inset 2px 0 0 var(--green); }
.src .k { color: var(--pink); } .src .v, .src .f { color: var(--blue); } .src .s { color: var(--amber); } .src .t { color: var(--green); } .src .a { color: #b7d6c2; }
.hero h1 span { display: block; min-height: 1.08em; }
.after { display: grid; gap: clamp(12px, 2vh, 20px); justify-items: start; transition: opacity .7s, transform .7s; }
.hero-inner.typing .after, .hero-inner.rendering .after { opacity: 0; transform: translateY(8px); pointer-events: none; }
.hero-inner.built .src { opacity: 0.5; }
.replay { all: unset; cursor: pointer; align-self: center; font-size: 0.8rem; color: var(--muted); padding: 6px 4px; }
.replay:hover, .replay:focus-visible { color: var(--green); }
.hero h1 {
  display: grid; font-weight: 300;
  font-size: clamp(2.2rem, 0.6rem + 6.4vw, 6.4rem);
  letter-spacing: 0.32em; line-height: 1.08;
  color: #e9f2ec;
  text-shadow: 0 0 30px rgba(46, 226, 122, 0.15);
  margin-right: -0.32em;
}
.typed { font-size: clamp(1rem, 0.85rem + 0.6vw, 1.3rem); color: var(--green); }
.typed .prompt { color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.btn { display: inline-block; text-decoration: none; padding: 11px 18px; border: 1px solid var(--green); color: var(--bg); background: var(--green); font-weight: 700; font-size: 0.9rem; border-radius: 4px; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 22px rgba(46, 226, 122, 0.35); }
.btn.ghost { background: transparent; color: var(--green); }
.down { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: var(--muted); text-decoration: none; font-size: 0.8rem; }

/* Background code: two layers drifting up at different speeds, faint, for depth */
.bgcode { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); }
.bgcode pre { position: absolute; margin: 0; font-family: var(--mono); white-space: pre; will-change: transform; }
.bgcode .far { left: 4%; top: 0; font-size: 13px; line-height: 1.8; color: var(--green); opacity: 0.07; animation: drift 140s linear infinite; }
.bgcode .near { right: -4%; top: 0; font-size: 22px; line-height: 1.7; color: var(--green); opacity: 0.045; filter: blur(1.2px); animation: drift 90s linear infinite; transform-origin: right; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (max-width: 700px) { .bgcode .near { display: none; } }

/* Shared editor chrome */
.editor { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tabs { display: flex; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 0.8rem; overflow-x: auto; }
.tab { padding: 9px 16px; color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; }
.tab.on { color: var(--ink); background: var(--panel); box-shadow: inset 0 2px 0 var(--green); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3a30; flex-shrink: 0; }
.term-bar i:first-child { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

section { scroll-margin-top: 60px; }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.sect-head h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); font-weight: 500; letter-spacing: -0.01em; }

/* Selected works: the component tree */
.selected { width: min(1120px, 100%); margin: 0 auto; padding: 40px 20px 80px; }
.code { list-style: none; margin: 0; padding: 18px 0; counter-reset: ln; font-size: clamp(0.72rem, 0.6rem + 0.6vw, 1.1rem); overflow-x: auto; }
.code li { counter-increment: ln; display: flex; align-items: stretch; min-height: 2em; white-space: pre; }
.code li::before { content: counter(ln); width: 3.2em; flex-shrink: 0; text-align: right; padding-right: 1.4em; color: #34483b; user-select: none; }
.code .ind { display: inline-block; width: 1.6em; flex-shrink: 0; border-left: 1px solid var(--line); }
.code .ind.hot { border-left-color: var(--green-deep); }
.code .t { align-self: center; }
.code .fn { color: var(--blue); }
.code .kw { color: var(--pink); }
.code .tg { color: var(--green); }
.code .at { color: #b7d6c2; }
.code .st { color: var(--amber); }
.code .cm { color: var(--muted); font-style: italic; }
.code button.work {
  all: unset; cursor: pointer; display: flex; align-items: center; flex: 1; border-radius: 3px; padding-right: 12px;
}
.code button.work:hover, .code button.work:focus-visible, .code button.work.on { background: rgba(46, 226, 122, 0.08); box-shadow: inset 2px 0 0 var(--green); }
.code button.work:focus-visible { outline: 1px solid var(--green); }
.code .go { margin-left: auto; padding-left: 18px; color: var(--muted); font-size: 0.8em; opacity: 0; transition: opacity .15s; }
.code button.work:hover .go, .code button.work:focus-visible .go { opacity: 1; color: var(--green); }

/* Works: cube + CLI */
.works { width: min(1120px, 100%); margin: 0 auto; padding: 40px 20px 90px; overflow-x: clip; }
.works-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 880px) { .works-grid { grid-template-columns: minmax(0, 1fr); } }

.stage { position: relative; height: calc(var(--cube) * 1.75); display: grid; place-items: center; perspective: 1100px; touch-action: pan-y; cursor: grab; user-select: none; }
.stage:active { cursor: grabbing; }
.wires { position: absolute; inset: -6% -8%; width: 116%; height: 112%; pointer-events: none; z-index: 0; }
.wires line { vector-effect: non-scaling-stroke; }
.wires .base { stroke: var(--green); stroke-width: 1; opacity: 0.16; }
.wires .flow { stroke: var(--green); stroke-width: 1.2; opacity: 0.45; stroke-dasharray: 4 46; animation: flow 3.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -100; } }
.float { position: relative; z-index: 1; transform-style: preserve-3d; animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-14px); } }
.cube { position: relative; width: var(--cube); height: var(--cube); transform-style: preserve-3d; will-change: transform; }
.face {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(17, 24, 20, 0.97), rgba(9, 14, 11, 0.97));
  border: 1px solid var(--green-2);
  box-shadow: inset 0 0 40px rgba(46, 226, 122, 0.07), 0 0 24px rgba(46, 226, 122, 0.08);
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  backface-visibility: hidden;
}
.face .term-bar { padding: 7px 10px; font-size: 0.66rem; }
.face .term-bar i { width: 8px; height: 8px; }
.shot { height: 46%; flex-shrink: 0; overflow: hidden; border-bottom: 1px solid var(--green-deep); background: #e9eee9; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; pointer-events: none; }
.face-body { flex: 1; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; background-image: linear-gradient(rgba(46,226,122,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(46,226,122,.04) 1px, transparent 1px); background-size: 18px 18px; }
.face-body .k { color: var(--muted); }
.face-body h3 { font-size: clamp(0.98rem, 0.75rem + 0.9vw, 1.3rem); font-weight: 700; color: #effaf3; line-height: 1.15; letter-spacing: -0.01em; }
.face-body .meta { color: var(--green); }
.face-body .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.face-body .tags span { border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; color: #a9c5b2; }
.face-body .run { margin-top: auto; color: var(--muted); }
.face-body .run b { color: var(--green); font-weight: 500; }
.face.on { border-color: var(--green); box-shadow: inset 0 0 50px rgba(46, 226, 122, 0.12), 0 0 40px rgba(46, 226, 122, 0.25); }
.floor { position: absolute; bottom: 4%; width: calc(var(--cube) * 1.2); height: 30px; background: radial-gradient(closest-side, rgba(46, 226, 122, 0.22), transparent); filter: blur(6px); pointer-events: none; }

.term { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
.term-out { height: 360px; overflow-y: auto; padding: 14px 16px 4px; font-size: 0.85rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.term-out p { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.3em; }
.term-out .cmd { color: var(--ink); }
.term-out .cmd .ps { color: var(--green); }
.term-out .ok { color: var(--green); }
.term-out .key { color: var(--blue); }
.term-out .dim { color: var(--muted); }
.term-out .warn { color: var(--amber); }
.term-out .ascii { color: var(--green); line-height: 1.15; font-size: 0.72rem; }
.term-out a { color: var(--green); }
.term-out img.thumb { display: block; max-width: min(320px, 100%); max-height: 180px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 6px; margin: 6px 0 4px 16px; }
.term-out button.inline { all: unset; cursor: pointer; color: var(--bg); background: var(--green); padding: 2px 9px; border-radius: 3px; font-weight: 700; margin: 4px 6px 4px 0; display: inline-block; }
.term-out button.inline:focus-visible { outline: 2px solid var(--ink); }
.term-in { display: flex; gap: 8px; align-items: center; padding: 8px 16px 12px; font-size: 0.85rem; }
.prompt-line { white-space: nowrap; color: var(--ink); }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: inherit; caret-color: var(--green); outline: none; padding: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.chips button { all: unset; cursor: pointer; font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; }
.chips button:hover, .chips button:focus-visible { color: var(--green); border-color: var(--green-2); }
@media (max-width: 480px) { .prompt-line .g { display: none; } .term-out { height: 300px; } }

/* About */
.about { width: min(1120px, 100%); margin: 0 auto; padding: 40px 20px 90px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.about-obj { grid-column: 1 / -1; }
@media (max-width: 760px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
.portrait { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 600 / 550; object-fit: cover; filter: grayscale(0.15) contrast(1.02); }
.obj { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: clamp(0.78rem, 0.7rem + 0.3vw, 0.92rem); line-height: 1.75; overflow-x: auto; }
.obj .k { color: var(--pink); } .obj .v { color: var(--blue); } .obj .p { color: #b7d6c2; } .obj .s { color: var(--amber); } .obj .c { color: var(--muted); font-style: italic; }
.about-copy { display: grid; gap: 16px; font-family: var(--sans); font-size: 1.08rem; line-height: 1.65; color: #c5d6ca; max-width: 52ch; }
.about-copy p:first-child { font-size: 1.3rem; color: var(--ink); line-height: 1.45; }

/* Code snippets */
.snippets { width: min(1120px, 100%); margin: 0 auto; padding: 40px 20px 90px; }
.snip .tabs .tab { all: unset; cursor: pointer; padding: 9px 16px; color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; font-size: 0.8rem; }
.snip .tabs .tab.on { color: var(--ink); background: var(--panel); box-shadow: inset 0 2px 0 var(--green); }
.snip .tabs .tab:focus-visible { outline: 1px solid var(--green); outline-offset: -1px; }
.snip-body { max-height: 520px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.code-lines { margin: 0; padding: 14px 0; list-style: none; counter-reset: sl var(--start, 0); font-size: clamp(0.74rem, 0.68rem + 0.25vw, 0.88rem); line-height: 1.7; }
.code-lines li { counter-increment: sl; white-space: pre; padding-right: 20px; }
.code-lines li::before { content: counter(sl); display: inline-block; width: 3.4em; padding-right: 1.4em; text-align: right; color: #34483b; user-select: none; }
.code-lines li:hover { background: rgba(46, 226, 122, 0.04); }
.code-lines .kw { color: var(--pink); } .code-lines .fn { color: var(--blue); } .code-lines .st { color: var(--amber); }
.code-lines .tg { color: var(--green); } .code-lines .cm { color: var(--muted); font-style: italic; } .code-lines .rx { color: #ff9f7a; } .code-lines .nu { color: #c9a2ff; }
.snip-status { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 12px; background: var(--green-deep); color: #bfe9cf; font-size: 0.72rem; }

/* Contact */
.contact { width: min(1120px, 100%); margin: 0 auto; padding: 20px 20px 70px; }
.contact-body { padding: clamp(22px, 5vw, 48px); display: grid; gap: 20px; }
.contact-card { border-top: 1px solid var(--line); }
.contact-body { padding-inline: 0; }
.contact-body h2 { font-size: clamp(1.7rem, 1rem + 3vw, 3.2rem); font-weight: 500; line-height: 1.15; max-width: 20ch; letter-spacing: -0.02em; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.15rem); }
.contact-list li { display: flex; gap: 14px; flex-wrap: wrap; }
.contact-list .key { color: var(--blue); width: 8ch; }
.contact-list .key::after { content: ":"; color: var(--muted); }
.contact-list a { color: var(--green); text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }

footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 20px 36px; width: min(1120px, 100%); margin: 0 auto; color: var(--muted); font-size: 0.75rem; }

/* Demo modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3, 6, 4, 0.82); backdrop-filter: blur(4px); padding: 16px; }
.modal-box { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--green-2); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100svh - 32px); }
.modal-box iframe { width: 100%; height: min(850px, calc(100svh - 120px)); border: 0; background: #111a36; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.modal-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-box .hint { padding: 10px 14px; font-size: 0.78rem; color: var(--muted); }
.modal-box .hint a { color: var(--green); }
.close { margin-left: auto; all: unset; cursor: pointer; color: var(--muted); padding: 0 4px; margin-left: auto !important; }
.close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .bgcode pre, .wires .flow, .float { animation: none; }
}

/* ------------------------------------------------------------------
 * Works: a cube per project, with Favour's lines running behind them
 * ------------------------------------------------------------------ */
.works-grid { align-items: start; }
.cubes-wrap { position: relative; }
.cubes-wrap .wires { inset: -4% -6%; width: 112%; height: 108%; }
.cubes { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.cell {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  display: grid; justify-items: center; gap: 10px; padding: 26px 6px 14px; border-radius: 12px;
  --c: clamp(104px, 13vw, 150px);
}
.cell:focus-visible { outline: 1px solid var(--green); outline-offset: -2px; }
.cube3 { display: block; width: var(--c); height: var(--c); perspective: 760px; }
.c3 { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }
.c3 .f {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(160deg, #111814, #0a0f0c);
  border: 1px solid var(--green-2);
  box-shadow: inset 0 0 24px rgba(46, 226, 122, 0.06);
  backface-visibility: hidden;
  font-size: calc(var(--c) * 0.068); line-height: 1.35; color: var(--ink);
  transition: border-color .3s, box-shadow .3s;
}
.cell:hover .c3 .f, .cell.on .c3 .f { border-color: var(--green); box-shadow: inset 0 0 30px rgba(46, 226, 122, 0.1), 0 0 22px rgba(46, 226, 122, 0.22); }
.f-front  { transform: rotateY(0deg)   translateZ(calc(var(--c) / 2)); }
.f-right  { transform: rotateY(90deg)  translateZ(calc(var(--c) / 2)); }
.f-back   { transform: rotateY(180deg) translateZ(calc(var(--c) / 2)); }
.f-left   { transform: rotateY(-90deg) translateZ(calc(var(--c) / 2)); }
.f-top    { transform: rotateX(90deg)  translateZ(calc(var(--c) / 2)); }
.f-bottom { transform: rotateX(-90deg) translateZ(calc(var(--c) / 2)); }
.f .bar { display: flex; align-items: center; gap: 3px; padding: 4px 6px; background: var(--bg); border-bottom: 1px solid var(--green-deep); flex-shrink: 0; }
.f .bar i { width: 5px; height: 5px; border-radius: 50%; background: #28c840; }
.f .bar i:first-child { background: #ff5f57; } .f .bar i:nth-child(2) { background: #febc2e; }
.f .bar em { font-style: normal; margin-left: 4px; font-size: 0.75em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: top center; display: block; background: #e9eee9; pointer-events: none; }
.f .k { color: var(--muted); font-size: 0.85em; }
.f-name { justify-content: center; gap: 4px; padding: 10%; }
.f-name b { font-size: 1.45em; line-height: 1.1; color: #effaf3; letter-spacing: -0.01em; }
.f-name span:last-child { color: var(--green); }
.f-about { padding: 10%; gap: 4px; color: #a9c5b2; }
.f-tags { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 4px; padding: 10%; }
.f-tags .k { width: 100%; }
.f-tags .chip { border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; color: #a9c5b2; }
.f-cmd { align-items: center; justify-content: center; text-align: center; color: var(--muted); background-image: linear-gradient(rgba(46,226,122,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(46,226,122,.06) 1px, transparent 1px); background-size: 12px 12px; }
.f-cmd b { color: var(--green); font-weight: 500; }
.shadow { width: calc(var(--c) * 1.1); height: 16px; margin-top: 6px; background: radial-gradient(closest-side, rgba(46, 226, 122, 0.2), transparent); filter: blur(4px); }
.cell.on .shadow { background: radial-gradient(closest-side, rgba(46, 226, 122, 0.4), transparent); }
.cap { font-size: 0.8rem; color: var(--muted); text-align: center; transition: color .2s; }
.cap .n { color: var(--green-2); }
.cell:hover .cap, .cell.on .cap { color: var(--ink); }
@media (min-width: 881px) { .term { position: sticky; top: 72px; } }
@media (max-width: 480px) { .cubes { gap: 0 8px; } .cell { padding-top: 22px; --c: clamp(96px, 30vw, 130px); } }

/* ------------------------------------------------------------------
 * Skills
 * ------------------------------------------------------------------ */
.skills { width: min(1120px, 100%); margin: 0 auto; padding: 40px 20px 90px; }
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.sg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 18px; display: grid; gap: 12px; align-content: start; }
.sg h3 { font-size: 0.85rem; font-weight: 500; color: var(--ink); letter-spacing: 0.04em; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 0.85rem; padding: 4px 11px; border: 1px solid var(--green-deep); border-radius: 4px; background: rgba(46, 226, 122, 0.05); color: #c9e8d4; transition: border-color .2s, color .2s; }
.tags li::before { content: "<"; color: var(--green-2); }
.tags li::after { content: " />"; color: var(--green-2); }
.tags li:hover { border-color: var(--green); color: var(--green); }
@media (max-width: 480px) { .top .path { display: none; } .top nav { margin-left: 0; } }

/* ------------------------------------------------------------------
 * Works: one calm section per project — cube on one side, its own
 * terminal window on the other. Readable sans text, green for accents.
 * ------------------------------------------------------------------ */
.work-list { display: grid; gap: clamp(64px, 10vw, 120px); }
.wk { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); align-items: center; scroll-margin-top: 76px; }
.wk.flip .wk-cube { order: 2; }
@media (max-width: 860px) { .wk { grid-template-columns: minmax(0, 1fr); gap: 8px; } .wk.flip .wk-cube { order: 0; } }
.wk-cube { position: relative; display: grid; justify-items: center; gap: 10px; padding: 34px 0 10px; --c: clamp(150px, 19vw, 220px); cursor: pointer; }
.wk-cube .wires { position: absolute; inset: 0 -12%; width: 124%; height: 100%; z-index: 0; }
.wk-cube .cube3 { position: relative; z-index: 1; }
.wk-cube .cap { position: relative; z-index: 1; font-size: 0.78rem; }
.wk-term { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; transition: border-color .4s, box-shadow .4s; }
.wk.hl .wk-term { animation: hl 2.2s ease-out; }
@keyframes hl { 0%, 40% { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 40px rgba(46, 226, 122, 0.18); } 100% { border-color: var(--line); box-shadow: none; } }
.wk-body { padding: clamp(18px, 3vw, 30px); display: grid; gap: 14px; justify-items: start; }
.wk-cmd { font-size: 0.8rem; color: var(--muted); }
.wk-body h3 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); font-weight: 600; color: #f2f7f3; letter-spacing: -0.02em; line-height: 1.1; margin-top: -4px; }
.wk-kind { color: var(--green); font-size: 0.85rem; margin-top: -8px; }
.wk-shot { width: 100%; max-height: 230px; object-fit: cover; object-position: top center; border-radius: 8px; border: 1px solid var(--line); background: #e9eee9; display: block; }
.wk-about { font-family: var(--sans); font-size: 1.02rem; line-height: 1.65; color: #cbd9cf; max-width: 62ch; }
.wk-did { margin: 0; padding-left: 1.1em; font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; color: #aebfb3; display: grid; gap: 4px; }
.wk-did li::marker { color: var(--green-2); }
.tags.small { gap: 6px; }
.tags.small li { font-size: 0.75rem; padding: 2px 9px; }
.wk-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.wbtn { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--mono); font-size: 0.85rem; padding: 8px 14px; border: 1px solid var(--green-2); border-radius: 6px; color: var(--green); transition: background .15s, color .15s; }
.wbtn:hover, .wbtn:focus-visible { background: rgba(46, 226, 122, 0.1); }
.wbtn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.wbtn.primary { background: var(--green); color: var(--bg); border-color: var(--green); font-weight: 700; }
.wbtn.primary:hover { background: #5cf09a; }
.wk-note { font-size: 0.8rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .wk.hl .wk-term { animation: none; } }
