/* ==========================================================================
   Yeabkal Dereje — portfolio
   Hand-written CSS. No framework. Tokens first, then layout, then sections.
   ========================================================================== */

/* ---------- fonts (self-hosted, latin + ethiopic subsets) ---------- */
@font-face { font-family: "Syne"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/syne-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Syne"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/syne-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Syne"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/syne-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Ethiopic"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-ethiopic-ethiopic-400-normal.woff2") format("woff2");
  unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }
@font-face { font-family: "Noto Sans Ethiopic"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-ethiopic-ethiopic-700-normal.woff2") format("woff2");
  unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }

:root {
  --bg: #08080a;
  --bg-2: #0d0d11;
  --surface: #121217;
  --surface-2: #191920;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #f4f2ed;
  --muted: #9c9ba8;
  --blue: #2f6bff;
  --orange: #ff7a45;
  --pink: #e8528f;
  --grad: linear-gradient(110deg, var(--blue) 0%, var(--orange) 62%, var(--pink) 100%);
  --code-key: #8cb0ff;
  --code-str: #ffb690;
  --code-num: #f58fb6;
  --grain: .07;
  --radius: 20px;
  --pad: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --f-display: "Syne", "Noto Sans Ethiopic", system-ui, sans-serif;
  --f-body: "Inter", "Noto Sans Ethiopic", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-2: #efece5;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --line: rgba(10, 10, 14, .11);
  --line-strong: rgba(10, 10, 14, .28);
  --text: #0c0c10;
  --muted: #5f5e6b;
  --blue: #1f57e6;
  --orange: #f0622a;
  --pink: #d63a7b;
  --code-key: #2450c8;
  --code-str: #b4461b;
  --code-num: #c0306c;
  --grain: .05;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
::selection { background: var(--orange); color: #fff; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* film grain, echoing the gradient + noise look of the printed portfolio deck */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  transition: top .2s;
}
.skip:focus { top: 16px; }

.wrap { width: min(100% - var(--pad) * 2, var(--max)); margin-inline: auto; }
.mono { font-family: var(--f-mono); }

/* scroll progress */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120;
  background: var(--grad); transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 100; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(100% - 24px, 980px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 18px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 999px;
}
.brand { font: 800 1.25rem/1 var(--f-display); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 2px; }
.brand i { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: .88rem; font-weight: 500; color: var(--muted); transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  height: 38px; min-width: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem;
  transition: color .25s, border-color .25s, background .25s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn kbd { font: 500 .72rem var(--f-mono); letter-spacing: .02em; }
.icon-btn svg { width: 17px; height: 17px; }
.theme-btn .moon { display: none; }
[data-theme="light"] .theme-btn .sun { display: none; }
[data-theme="light"] .theme-btn .moon { display: block; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .icon-btn kbd { display: none; }
  .cmdk-btn { padding: 0; width: 38px; }
  body.menu-open .nav-links {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: -1;
    background: var(--bg); padding: 110px var(--pad) 40px; gap: 4px; justify-content: center;
  }
  body.menu-open .nav-links a { font: 700 clamp(2rem, 9vw, 3rem)/1.2 var(--f-display); padding: 8px 0; color: var(--text); background: none; }
}

/* ---------- buttons ---------- */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; gap: 10px; height: var(--h); padding: 0 26px;
  border-radius: 999px; font-weight: 600; font-size: .95rem; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid var(--line-strong); transition: transform .35s var(--ease), border-color .3s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translate(3px, -3px); }
.btn-solid { background: var(--text); color: var(--bg); border-color: transparent; }
.btn-solid::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad);
  opacity: 0; transition: opacity .35s;
}
.btn-solid:hover { color: #fff; }
.btn-solid:hover::before { opacity: 1; }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { --h: 42px; padding: 0 18px; font-size: .86rem; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 130px 0 70px; overflow: hidden; isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.blob.b1 { width: 46vw; height: 46vw; left: -12vw; top: 6vh; background: var(--blue); animation: drift 22s ease-in-out infinite alternate; }
.blob.b2 { width: 40vw; height: 40vw; right: -10vw; top: 30vh; background: var(--orange); animation: drift 26s ease-in-out -8s infinite alternate-reverse; }
.blob.b3 { width: 28vw; height: 28vw; right: 24vw; bottom: -14vh; background: var(--pink); opacity: .32; animation: drift 30s ease-in-out -3s infinite alternate; }
[data-theme="light"] .blob { opacity: .28; }
@keyframes drift { to { transform: translate3d(7vw, -6vh, 0) scale(1.12); } }
#field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero::after { /* fade into the next section */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .72fr); gap: clamp(28px, 4vw, 64px); align-items: center; }

.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  font: 500 .78rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .geez { font-family: var(--f-display); text-transform: none; font-size: 1rem; color: var(--text); letter-spacing: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

h1.display {
  font: 800 clamp(2.35rem, 5.1vw, 5.2rem)/1 var(--f-display); letter-spacing: -.035em; margin: 26px 0 26px;
}
h1.display .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
h1.display .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; animation-delay: calc(.15s + var(--i) * .12s); }
@keyframes rise { to { transform: none; } }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.outline { color: transparent; -webkit-text-stroke: 1.4px var(--text); font-weight: 700; letter-spacing: -.02em; }

.role-line { font: 500 1rem/1.4 var(--f-mono); color: var(--muted); display: flex; gap: 10px; align-items: center; min-height: 28px; }
.role-line b { color: var(--text); font-weight: 500; }
.role-line .caret { width: 9px; height: 1.1em; background: var(--orange); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-lede { max-width: 56ch; margin-top: 18px; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.15rem); }
.hero-lede strong { color: var(--text); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* code card */
.code-card {
  position: relative; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55);
  transform: perspective(1200px) rotateY(calc(var(--rx, 0) * -1deg)) rotateX(calc(var(--ry, 0) * 1deg));
  transition: transform .25s ease-out;
}
.code-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); opacity: .45; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.code-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 500 .76rem var(--f-mono); color: var(--muted); }
.code-head i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-head i:nth-child(2) { background: #febc2e; }
.code-head i:nth-child(3) { background: #28c840; }
.code-head span { margin-left: 8px; }
.code-body { padding: 20px 22px 24px; font: 400 clamp(.74rem, .95vw, .86rem)/1.85 var(--f-mono); counter-reset: ln; overflow-x: auto; }
.code-body code { display: block; white-space: pre; }
.code-body .ln { display: block; opacity: 0; animation: fadeln .5s var(--ease) forwards; animation-delay: calc(.7s + var(--i) * .09s); }
.code-body .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 2ch; margin-right: 2ch; text-align: right; color: var(--muted); opacity: .45; }
@keyframes fadeln { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.k { color: var(--code-key); } .s { color: var(--code-str); } .n { color: var(--code-num); } .c { color: var(--muted); font-style: italic; } .p { color: var(--muted); }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; translate: -50% 0; z-index: 2; font: 500 .7rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-cue::after { content: ""; width: 1px; height: 34px; background: linear-gradient(var(--text), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

@media (max-width: 960px) {
  .hero { padding-top: 110px; align-items: flex-start; }
  .hero-grid { grid-template-columns: 1fr; }
  .scroll-cue { display: none; }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; position: relative; z-index: 1; background: var(--bg); }
.marquee-track { display: flex; width: max-content; animation: marq 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { display: inline-flex; align-items: center; gap: clamp(22px, 3vw, 44px); padding-right: clamp(22px, 3vw, 44px); font: 800 clamp(2rem, 5vw, 4.2rem)/1 var(--f-display); letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap; }
.marquee-track em { font-style: normal; font-weight: 700; -webkit-text-stroke: 1.3px var(--text); color: transparent; }
.marquee-track i { width: .5em; height: .5em; flex: none; background: var(--grad); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { position: relative; }
#about { overflow-x: clip; }
.section { padding: clamp(80px, 11vw, 150px) 0; }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 10px clamp(20px, 4vw, 56px); align-items: end; margin-bottom: clamp(36px, 5vw, 70px); }
.sec-label { font: 500 .78rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.sec-label::before { content: ""; width: 10px; height: 22px; background: var(--blue); } /* the blue block from the deck */
.sec-title { font: 800 clamp(1.85rem, 5.4vw, 4.6rem)/1.02 var(--f-display); letter-spacing: -.03em; overflow-wrap: anywhere; hyphens: auto; }
.sec-head > * { min-width: 0; }
@media (max-width: 380px) { .sec-title { font-size: 1.7rem; } }
.sec-note { max-width: 46ch; color: var(--muted); justify-self: end; }
@media (max-width: 820px) { .sec-head { grid-template-columns: 1fr; } .sec-note { justify-self: start; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: clamp(28px, 4vw, 54px) clamp(16px, 2.4vw, 36px); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font: 800 clamp(2.4rem, 5vw, 4.2rem)/1 var(--f-display); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: .92rem; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; padding-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- featured cases ---------- */
.cases { display: grid; gap: clamp(40px, 6vw, 84px); }
.case { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 3.5vw, 56px); align-items: center; padding-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line); }
.case-idx { font: 500 .78rem var(--f-mono); color: var(--orange); letter-spacing: .08em; }
.case h3 { font: 800 clamp(1.7rem, 3vw, 2.6rem)/1.05 var(--f-display); letter-spacing: -.025em; margin: 12px 0 6px; }
.case-kind { color: var(--muted); font-weight: 500; }
.case p.blurb { margin-top: 16px; color: var(--muted); max-width: 44ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li { font: 500 .72rem var(--f-mono); padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.case-open { margin-top: 24px; }
.strip {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; cursor: grab;
  mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip button { flex: none; scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); height: clamp(260px, 32vw, 420px); }
.strip img { height: 100%; width: auto; transition: transform .8s var(--ease); pointer-events: none; }
.strip button:hover img { transform: scale(1.04); }
@media (max-width: 960px) { .case { grid-template-columns: 1fr; } }

/* ---------- archive grid ---------- */
.archive-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin: clamp(70px, 9vw, 130px) 0 28px; }
.archive-head h3 { font: 800 clamp(1.8rem, 3.6vw, 3rem)/1 var(--f-display); letter-spacing: -.03em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; color: var(--muted); transition: all .25s; display: inline-flex; gap: 8px; align-items: center; }
.chip sup { font: 500 .72rem var(--f-mono); opacity: .7; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { columns: 3 260px; column-gap: 16px; }
.card { position: relative; display: block; padding: 0; font: inherit; color: inherit; width: 100%; break-inside: avoid; margin: 0 0 16px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: zoom-in; text-align: left; transition: opacity .45s var(--ease), transform .45s var(--ease); }
.card.hide { display: none; }
.card.fade { opacity: 0; transform: scale(.97); }
.card img { width: 100%; height: auto; transition: transform .9s var(--ease); }
.card:hover img { transform: scale(1.045); }
.card figcaption, .card .cap {
  position: absolute; inset: auto 0 0 0; padding: 38px 16px 14px;
  background: linear-gradient(to top, rgba(8, 8, 10, .88), transparent);
  display: flex; flex-direction: column; gap: 2px; color: #fff;
  transform: translateY(100%); opacity: 0; transition: transform .45s var(--ease), opacity .45s;
}
.card:hover .cap, .card:focus-visible .cap { transform: none; opacity: 1; }
.cap b { font: 700 .98rem/1.2 var(--f-display); }
.cap small { font: 500 .7rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
@media (hover: none) { .card .cap { transform: none; opacity: 1; padding-top: 28px; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(30px, 6vw, 96px); align-items: start; }
.portrait { position: relative; position: sticky; top: 110px; }
.portrait-frame { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); border: 1px solid var(--line); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 46% 30%; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.92); }
.portrait:hover img { transform: scale(1.04); filter: saturate(1.1); }
.portrait::before { content: ""; position: absolute; inset: 0; border-radius: 28px; background: var(--grad); transform: translate(14px, 14px) rotate(2.2deg); z-index: -1; opacity: .85; }
.sticker { position: absolute; right: -14px; bottom: 28px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font: 600 .78rem var(--f-mono); transform: rotate(-4deg); display: flex; gap: 8px; align-items: center; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .6); }
.about-copy .lede { font: 700 clamp(1.4rem, 2.6vw, 2.15rem)/1.22 var(--f-display); letter-spacing: -.02em; }
.about-copy .lede em { font-style: normal; color: var(--orange); }
.about-copy p + p { margin-top: 18px; }
.about-copy p { color: var(--muted); max-width: 62ch; }
.about-copy p.lede { color: var(--text); max-width: none; }
.belt { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 38px; }
.belt-col { border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.belt-col h4 { font: 500 .74rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--orange); margin-bottom: 14px; }
.belt-col ul { display: flex; flex-wrap: wrap; gap: 8px; }
.belt-col li { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; border: 1px solid var(--line); }
.belt-col p { font-size: .88rem; margin-top: 14px; max-width: none; }
.worked { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.worked h4 { font: 500 .74rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.worked p { color: var(--text); font-weight: 500; line-height: 1.9; max-width: none; }
.worked p span { color: var(--muted); padding: 0 .5ch; }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; } .portrait { position: relative; top: 0; max-width: 460px; } .belt { grid-template-columns: 1fr; } }

/* ---------- experience (git log) ---------- */
.log { position: relative; display: grid; gap: 0; max-width: 980px; margin-left: auto; }
.log::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--blue), var(--orange) 70%, var(--pink)); opacity: .55; }
.commit { position: relative; padding: 0 0 clamp(34px, 4vw, 52px) 48px; }
.commit::before { content: ""; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--orange); box-shadow: 0 0 0 5px var(--bg); transition: background .3s, transform .3s; }
.commit:hover::before, .commit.current::before { background: var(--orange); transform: scale(1.12); }
.commit-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 .76rem var(--f-mono); color: var(--muted); }
.commit-meta .hash { color: var(--orange); }
.commit-meta .head { color: #34d399; }
.commit h3 { font: 800 clamp(1.4rem, 2.6vw, 2.1rem)/1.1 var(--f-display); letter-spacing: -.02em; margin: 8px 0 2px; }
.commit .org { color: var(--muted); font-weight: 500; }
.commit ul { margin-top: 14px; display: grid; gap: 8px; max-width: 70ch; }
.commit li { position: relative; padding-left: 20px; color: var(--muted); font-size: .96rem; }
.commit li::before { content: "+"; position: absolute; left: 0; color: #34d399; font: 500 .9rem var(--f-mono); }
.edu { margin-top: clamp(30px, 5vw, 60px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu-card { border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: color-mix(in srgb, var(--surface) 70%, transparent); transition: border-color .3s, transform .4s var(--ease); }
.edu-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.edu-card small { font: 500 .72rem var(--f-mono); color: var(--orange); letter-spacing: .06em; text-transform: uppercase; }
.edu-card h4 { font: 700 1.15rem/1.25 var(--f-display); margin: 8px 0 4px; }
.edu-card p { color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) { .edu { grid-template-columns: 1fr; } }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.svc { grid-column: span 2; position: relative; padding: 30px 26px 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; transition: transform .5s var(--ease), border-color .3s; min-height: 280px; display: flex; flex-direction: column; }
.svc:nth-child(4), .svc:nth-child(5) { grid-column: span 3; }
.svc::after { content: ""; position: absolute; inset: auto -30% -60% -30%; height: 80%; background: var(--grad); filter: blur(60px); opacity: 0; transition: opacity .6s; z-index: 0; }
.svc:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.svc:hover::after { opacity: .35; }
.svc > * { position: relative; z-index: 1; }
.svc .no { font: 500 .76rem var(--f-mono); color: var(--muted); }
.svc svg { width: 40px; height: 40px; margin: 22px 0 auto; stroke: var(--text); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.svc h3 { font: 800 1.45rem/1.1 var(--f-display); letter-spacing: -.02em; margin-top: 32px; }
.svc p { color: var(--muted); font-size: .94rem; margin-top: 10px; }
@media (max-width: 960px) { .services { grid-template-columns: 1fr 1fr; } .svc, .svc:nth-child(4), .svc:nth-child(5) { grid-column: auto; } .svc:last-child { grid-column: 1 / -1; } }
@media (max-width: 600px) { .services { grid-template-columns: 1fr; } }

/* ---------- testimonials ---------- */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quote { padding: clamp(26px, 3.4vw, 44px); border-radius: 26px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 28px; justify-content: space-between; position: relative; overflow: hidden; }
.quote::before { content: "“"; position: absolute; top: -.18em; right: 22px; font: 800 9rem/1 var(--f-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .55; }
.quote blockquote { font: 500 clamp(1.05rem, 1.5vw, 1.28rem)/1.6 var(--f-body); position: relative; }
.quote figcaption { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font: 800 1rem var(--f-display); color: #fff; }
.quote figcaption b { display: block; font-weight: 600; }
.quote figcaption span { color: var(--muted); font-size: .86rem; }
@media (max-width: 860px) { .quotes { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact { position: relative; overflow: hidden; border-top: 1px solid var(--line); isolation: isolate; text-align: center; }
.contact .blob { opacity: .32; }
.contact .b1 { left: -15vw; top: -10vh; } .contact .b2 { right: -12vw; top: auto; bottom: -20vh; }
.contact h2 { font: 800 clamp(1.8rem, 8.4vw, 8rem)/.95 var(--f-display); letter-spacing: -.04em; margin: 22px auto 0; max-width: 14ch; }
.contact-lede { max-width: 54ch; margin: 28px auto 0; color: var(--muted); font-size: 1.08rem; }
.mail-link { display: inline-block; margin-top: 44px; font: 700 clamp(1.3rem, 4.2vw, 3rem)/1.1 var(--f-display); letter-spacing: -.02em; padding-bottom: 6px; background: linear-gradient(var(--text), var(--text)) 0 100% / 100% 2px no-repeat; transition: background-size .5s var(--ease), color .3s; }
.mail-link:hover { background-image: var(--grad); background-size: 100% 6px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 36px; }
.contact-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 34px; margin-top: 56px; font: 500 .82rem var(--f-mono); color: var(--muted); }
.contact-meta a:hover { color: var(--text); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0 34px; font: 500 .78rem var(--f-mono); color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: center; }
footer a { color: var(--text); border-bottom: 1px solid var(--line-strong); }
footer a:hover { border-color: var(--orange); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 30px); opacity: 0; background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font: 600 .85rem var(--f-mono); pointer-events: none; transition: all .4s var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(5, 5, 8, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#lightbox { width: 100vw; height: 100dvh; }
#lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 56px 72px 8px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8); animation: lbin .45s var(--ease); }
@keyframes lbin { from { opacity: 0; transform: scale(.97); } }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px) 22px; color: #f4f2ed; }
.lb-bar b { font: 700 1.05rem var(--f-display); display: block; }
.lb-bar small { font: 500 .74rem var(--f-mono); color: #9c9ba8; letter-spacing: .06em; text-transform: uppercase; }
.lb-count { font: 500 .8rem var(--f-mono); color: #9c9ba8; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .06); transition: background .25s, transform .25s; z-index: 2; }
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev { left: 14px; top: 50%; translate: 0 -50%; } .lb-next { right: 14px; top: 50%; translate: 0 -50%; } .lb-close { right: 14px; top: 14px; }
@media (max-width: 640px) { .lb-stage { padding: 64px 12px 8px; } .lb-prev, .lb-next { top: auto; bottom: 6px; translate: none; } .lb-prev { left: auto; right: 74px; } .lb-bar { padding-right: 140px; } }

#palette { width: min(640px, 100% - 24px); margin: 14vh auto auto; }
.pal { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .7); }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal-input svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; flex: none; }
.pal-input input { flex: 1; height: 58px; background: none; border: 0; outline: 0; color: var(--text); font: 500 1rem var(--f-body); }
.pal-input kbd { font: 500 .7rem var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.pal-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.pal-group { font: 500 .68rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
.pal-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; text-align: left; font-size: .95rem; }
.pal-item small { font: 500 .7rem var(--f-mono); color: var(--muted); }
.pal-item[aria-selected="true"] { background: var(--surface-2); }
.pal-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- custom cursor ring (fine pointers only) ---------- */
.cursor { position: fixed; z-index: 250; left: 0; top: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1.5px solid var(--text); border-radius: 50%; pointer-events: none; opacity: 0; mix-blend-mode: difference; display: grid; place-items: center; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), opacity .3s, background .3s; }
.cursor span { font: 600 .62rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; opacity: 0; transition: opacity .2s; }
.cursor.on { opacity: 1; }
.cursor.hover { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.cursor.label { width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(255, 255, 255, .92); }
.cursor.label span { opacity: 1; color: #000; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- no-js + reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  h1.display .line > span { transform: none; }
  .code-body .ln { opacity: 1; }
  .marquee-track { animation: none; }
}
noscript .ns { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- responsive safety net ---------- */
html, body { overflow-x: clip; }
img, video, svg { max-width: 100%; }
@media (pointer: coarse) {
  .icon-btn { height: 44px; min-width: 44px; }
  .cmdk-btn { width: 44px; }
  .brand { min-height: 44px; padding: 0 6px; }
  .chip { min-height: 44px; }
  .nav { padding: 6px 6px 6px 14px; }
}
@media (max-width: 380px) { .hero h1, .hero-title { overflow-wrap: anywhere; } }

/* two-up archive on phones: halves the scroll length */
@media (max-width: 640px) {
  .grid { columns: 2; column-gap: 10px; }
  .card { margin-bottom: 10px; border-radius: 12px; }
  .card .cap { padding: 22px 10px 8px; }
  .cap b { font-size: .74rem; }
  .cap small { display: none; }
}

/* ---------- clients strip (logos shown in one tone) ---------- */
:root { --logo-filter: brightness(0) invert(1); }
[data-theme="light"] { --logo-filter: brightness(0); }
.clients { padding: 30px 0 8px; }
.clients[hidden] { display: none; }
.clients-row { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 22px 48px; margin-top: 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.clients-row::-webkit-scrollbar { display: none; }
.clients-row li { flex: none; }
.clients-row img { height: 34px; width: auto; max-width: 150px; object-fit: contain; filter: var(--logo-filter); opacity: .6; transition: opacity .3s; }
.clients-row img:hover { opacity: 1; }

/* ---------- case study ---------- */
.casestudy { margin: clamp(40px, 6vw, 84px) 0; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 48px); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.cs-head h3 { font: 800 clamp(1.8rem, 4.4vw, 3.4rem)/1.02 var(--f-display); letter-spacing: -.03em; margin: 16px 0 10px; overflow-wrap: anywhere; }
.cs-sub { color: var(--muted); max-width: 56ch; }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 28px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.cs-meta > div { background: var(--bg); padding: 16px 18px; }
.cs-meta dt { font: 500 .72rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.cs-meta dd { margin: 6px 0 0; font-weight: 500; }
.cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 40px); }
.cs-grid h4 { font: 700 1.1rem var(--f-display); margin-bottom: 8px; }
.cs-grid p { color: var(--muted); }
@media (max-width: 860px) { .cs-meta { grid-template-columns: 1fr 1fr; } .cs-grid { grid-template-columns: 1fr; } }

/* ---------- order / contact form ---------- */
.order { text-align: left; max-width: 720px; margin: 56px auto 0; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 80%, transparent); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.order-head { grid-column: 1 / -1; }
.order-head h3 { font: 800 clamp(1.4rem, 3vw, 2rem)/1.1 var(--f-display); letter-spacing: -.02em; }
.order-head p { color: var(--muted); margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font: 500 .74rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: 400 1rem var(--f-body, inherit); }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-color: transparent; }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--pink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.order-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.order-status { color: var(--muted); font-size: .92rem; }
.order-status a { text-decoration: underline; color: var(--text); }
.order-note { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.order button[disabled] { opacity: .6; pointer-events: none; }
@media (max-width: 600px) { .order { grid-template-columns: 1fr; } }

/* ---------- language switch ---------- */
.lang-btn { font: 700 .82rem var(--f-body); letter-spacing: 0; }
html[lang="am"] body { font-family: "Noto Sans Ethiopic", var(--f-body); line-height: 1.75; }
html[lang="am"] .display { line-height: 1.12; }
html[lang="am"] .sec-label, html[lang="am"] .field label, html[lang="am"] .cs-meta dt, html[lang="am"] .edu-card small { letter-spacing: 0; text-transform: none; }
html[lang="am"] .sec-title, html[lang="am"] .contact h2, html[lang="am"] .cs-head h3 { letter-spacing: 0; line-height: 1.2; }
@media (max-width: 360px) { .cmdk-btn { display: none; } }
.clients-row { gap: 18px clamp(16px, 2.2vw, 36px); }
.clients-row img { height: clamp(26px, 2.3vw, 32px); max-width: 130px; }

/* clients marquee: continuous side-to-side loop */
.clients-marquee { overflow: hidden; margin-top: 20px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.clients-row.is-marquee { margin-top: 0; width: max-content; max-width: none; overflow: visible; gap: 0; justify-content: flex-start; flex-wrap: nowrap; animation: clients-scroll 38s linear infinite; }
.clients-row.is-marquee li { padding-right: clamp(40px, 5vw, 80px); }
.clients-row.is-marquee img { height: 32px; max-width: 150px; }
.clients-marquee:hover .clients-row.is-marquee { animation-play-state: paused; }
@keyframes clients-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .clients-row.is-marquee { animation: none; } .clients-marquee { overflow-x: auto; } }
.stat span span { display: inline; margin-top: 0; }

.portrait-frame img { object-position: 50% 22%; }
