/* ============================================================
   Portfolio — Pedro Queiroz
   Tema espacial: céu estrelado, nebulosas, vidro fosco e órbitas.
   Elementos decorativos nunca interceptam a navegação.
   ============================================================ */

:root {
  --bg: #03050c;
  --surface-solid: #0a0f1d;
  --line: rgb(255 255 255 / .07);
  --line-strong: rgb(255 255 255 / .14);
  --line-accent: rgb(169 186 255 / .24);
  --ink: #eef1fb;
  --ink-soft: #c5cde2;
  --muted: #8f9bb8;
  --faint: #6c7894;
  --accent: #a9baff;
  --accent-2: #c6a9ff;
  --ok: #70e3a1;
  --off: #7c8497;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 50% at 85% 0%, rgb(68 49 126 / .22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 40%, rgb(21 69 105 / .16), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.browser-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgb(169 186 255 / .28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--accent); color: #0b1128; border-radius: 999px; font-size: 14px; font-weight: 600; }
.skip-link:focus { top: 12px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; text-wrap: balance; }
h4 { font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: -.01em; line-height: 1.35; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #b9c6ff; box-shadow: 0 0 12px #9aafff, 0 0 2px #fff; }

.grad {
  background: linear-gradient(105deg, #ffffff 0%, #b7c9ff 45%, #c6a9ff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- space backdrop ---------- */
.starfield { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.nebula { position: fixed; z-index: 0; border-radius: 50%; filter: blur(90px); pointer-events: none; animation: drift 28s ease-in-out infinite alternate; }
.nebula-1 { width: 620px; height: 620px; top: -220px; right: -140px; background: rgb(104 68 217 / .16); }
.nebula-2 { width: 520px; height: 520px; top: 45%; left: -220px; background: rgb(37 124 190 / .11); animation-delay: -9s; }
.nebula-3 { width: 460px; height: 460px; bottom: -200px; right: 10%; background: rgb(142 219 255 / .06); animation-delay: -18s; }
@keyframes drift { to { transform: translate3d(40px, 30px, 0) scale(1.08); } }

.site-header, main, .site-footer { position: relative; z-index: 1; }
.site-header { z-index: 60; }

/* ---------- glass surface with gradient hairline ---------- */
.glass, .project-card, .service-card, .process-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(160deg, rgb(20 28 52 / .72), rgb(7 11 23 / .78));
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass::before, .project-card::before, .service-card::before, .process-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgb(169 186 255 / .34), rgb(255 255 255 / .05) 38%, rgb(255 255 255 / .03) 62%, rgb(198 169 255 / .26));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background .35s;
}

/* cursor spotlight on cards (class added by space-effects.js) */
.cosmic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(340px circle at var(--light-x, 50%) var(--light-y, 50%), rgb(152 173 255 / .10), transparent 72%);
  opacity: 0;
  transition: opacity .35s;
}
.cosmic-card.is-lit::after { opacity: 1; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 14px/1 var(--font-sans);
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s, background-color .25s;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn-primary { background: linear-gradient(110deg, #d6e0ff, #b4b9f1 60%, #c9b4f5); color: #0f1733; box-shadow: 0 4px 24px rgb(140 155 224 / .18); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 34px rgb(153 169 255 / .38); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: rgb(8 14 28 / .55); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--line-accent); background: rgb(169 186 255 / .08); transform: translateY(-2px); }

.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent); }
.text-link::after { content: "→"; transition: transform .25s var(--ease); }
.text-link:hover { color: #fff; }
.text-link:hover::after { transform: translateX(4px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / .03); font: 400 11px/1.4 var(--font-mono); color: var(--muted); }

/* ---------- reading progress & command palette ---------- */
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 70; height: 2px; background: rgb(255 255 255 / .03); pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #9db4ff, #c6a9ff, #8edbff); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 12px #a9baff88; }

.command-trigger {
  position: fixed; right: 24px; bottom: 22px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px 9px 13px;
  border: 1px solid rgb(169 186 255 / .2); border-radius: 999px;
  background: rgb(10 15 30 / .85); color: #dce5ff;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font: 500 12px var(--font-sans);
  box-shadow: 0 10px 30px rgb(0 0 0 / .4);
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.command-trigger:hover { border-color: rgb(175 192 255 / .5); transform: translateY(-2px); }
.command-trigger kbd, .command-palette kbd { font: 500 10px var(--font-mono); color: var(--accent); background: rgb(169 186 255 / .08); border: 1px solid rgb(169 186 255 / .16); border-radius: 5px; padding: 2px 5px; }
.command-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #b8c6ff; box-shadow: 0 0 12px #9eafff; }

.command-palette { width: min(540px, calc(100vw - 32px)); margin: auto; padding: 0; border: 1px solid rgb(169 186 255 / .2); border-radius: 20px; background: rgb(9 14 28 / .96); color: var(--ink); box-shadow: 0 30px 100px rgb(0 0 0 / .7); }
.command-palette::backdrop { background: rgb(2 4 10 / .84); }
.command-shell { padding: 14px; }
.command-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); }
.command-head strong { font: 500 15px var(--font-display); }
.command-head button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font: 24px/1 var(--font-sans); cursor: pointer; }
.command-shell > p { margin: 14px 8px 10px; color: var(--muted); font-size: 12px; }
.command-list { display: grid; gap: 4px; }
.command-list button { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 11px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); font: 500 14px var(--font-sans); text-align: left; cursor: pointer; }
.command-list button span { font: 11px var(--font-mono); color: #7f90b7; }
.command-list button small { font-size: 12px; color: var(--faint); }
.command-list button:hover, .command-list button.is-selected { background: rgb(169 186 255 / .07); border-color: rgb(169 186 255 / .16); }

/* ---------- cursor trail (space-effects.js) ---------- */
.cursor-trail { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; }
.cursor-orb { position: fixed; z-index: 79; width: 12px; height: 12px; border: 1px solid #b8c8ff; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); opacity: 0; box-shadow: 0 0 16px #9aaeff, inset 0 0 8px rgb(255 255 255 / .5); transition: opacity .2s; }
body.cursor-active .cursor-orb { opacity: .85; }
@media (hover: none) { .cursor-orb, .cursor-trail { display: none; } }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.site-header.is-scrolled { background: rgb(3 5 12 / .72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid rgb(180 196 255 / .35); box-shadow: 0 0 18px rgb(120 145 255 / .25); }
.brand-text strong { display: block; font: 600 15px/1.2 var(--font-display); letter-spacing: -.02em; }
.brand-text small { display: block; font: 400 10px/1.4 var(--font-mono); letter-spacing: .08em; color: var(--faint); }

.site-nav { display: flex; gap: 4px; margin-left: auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgb(10 15 30 / .5); backdrop-filter: blur(10px); }
.site-nav a { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: color .2s, background-color .2s; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: #fff; background: rgb(169 186 255 / .12); box-shadow: inset 0 0 0 1px rgb(169 186 255 / .18); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.language-toggle { min-width: 42px; height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgb(8 14 28 / .5); color: var(--ink); font: 500 12px/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; transition: border-color .2s; }
.language-toggle:hover { border-color: var(--line-accent); }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }

.hero-copy > * { animation: rise .9s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-copy > :nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero-title { margin: 22px 0 24px; font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.05em; }
.hero-sub { max-width: 52ch; font-size: 17px; line-height: 1.8; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; }
.hero-links a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); transition: color .2s; }
.hero-links a:hover { color: #fff; }
.hero-links i { font-size: 16px; }

.hero-visual { position: relative; min-height: 600px; }

/* planet & orbits (parallax vars set by space-effects.js) */
.orbit-art {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 470px;
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate3d(var(--orbit-x, 0), var(--orbit-y, 0), 0);
  transition: transform .6s var(--ease);
}
.planet {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #a7bdf0 0%, #5a6fb0 16%, #2b3a6a 36%, #121a38 58%, #050814 78%);
  box-shadow:
    inset 6px 4px 14px rgb(217 231 255 / .45),
    inset -30px -24px 60px rgb(0 0 0 / .65),
    0 0 60px rgb(106 131 208 / .22),
    0 0 140px rgb(117 97 188 / .16);
}
.planet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-linear-gradient(-28deg, transparent 0 18px, rgb(160 180 255 / .05) 18px 22px, transparent 22px 34px);
}
.planet::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgb(180 200 255 / .1); }
.planet-ring {
  position: absolute;
  inset: 40% 2%;
  border-radius: 50%;
  border: 1.5px solid rgb(186 203 255 / .45);
  transform: rotate(-18deg);
  box-shadow: 0 0 0 7px rgb(139 159 223 / .05), 0 0 0 16px rgb(139 159 223 / .035), 0 0 24px rgb(160 180 255 / .15);
}
.orbit { position: absolute; border-radius: 50%; border: 1px dashed rgb(169 186 255 / .14); animation: spin 48s linear infinite; }
.orbit-outer { inset: 0; }
.orbit-inner { inset: 12%; border-style: solid; border-color: rgb(169 186 255 / .08); animation-duration: 26s; animation-direction: reverse; }
.moon { position: absolute; border-radius: 50%; }
.moon-a { top: 50%; left: -6px; width: 12px; height: 12px; background: #bacbfb; box-shadow: 0 0 22px #809dfb, 0 0 4px #fff; }
.moon-b { top: -4px; left: 50%; width: 8px; height: 8px; background: #d3c2ff; box-shadow: 0 0 16px #b49bff; }
@keyframes spin { to { transform: rotate(360deg); } }

.profile-card { position: absolute; left: -12px; bottom: 0; z-index: 2; width: min(360px, 100%); box-shadow: 0 30px 80px rgb(0 0 0 / .45); animation: rise 1s .3s var(--ease) both; }
.profile-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.profile-avatar { position: relative; flex: none; width: 48px; height: 48px; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 1px solid rgb(180 196 255 / .4); }
.profile-head strong { display: block; font: 500 19px/1.2 var(--font-display); letter-spacing: -.02em; }
.profile-head div span { font-size: 13px; color: var(--muted); }
.profile-avatar .status-dot { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid #0b1020; box-shadow: 0 0 10px rgb(112 227 161 / .7); }
.profile-avatar .status-dot.offline { background: var(--off); box-shadow: none; }
.profile-list { padding: 4px 22px 10px; }
.profile-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list dt { color: var(--muted); }
.profile-list dd { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
#clock { font-family: var(--font-mono); font-weight: 400; }
#status-text { color: var(--ok); }
#status-text.status-offline { color: var(--muted); }

/* tech marquee */
.marquee {
  margin-top: clamp(56px, 8vw, 96px);
  padding: 22px 0;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgb(169 186 255 / .03), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 44px; padding-right: 44px; }
.marquee-group li { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.marquee-group i { font-size: 20px; }
.marquee-group .devicon-nextjs-plain { color: #fff; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 11vw, 128px) 0 0; scroll-margin-top: var(--header-h); }
#form { scroll-margin-top: calc(var(--header-h) + 24px); }

.section-head { display: grid; grid-template-columns: auto auto minmax(40px, 1fr); align-items: end; gap: 22px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-index { align-self: start; padding-top: 4px; font: 400 13px/1 var(--font-mono); color: var(--accent); text-shadow: 0 0 12px rgb(169 186 255 / .6); }
.section-head h2 { margin-top: 12px; font-size: clamp(32px, 4.2vw, 50px); }
.head-line { height: 1px; margin-bottom: 14px; background: linear-gradient(90deg, rgb(163 183 255 / .4), transparent); }

/* ---------- projects ---------- */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
  padding: clamp(20px, 3vw, 36px);
  box-shadow: 0 40px 100px rgb(0 0 0 / .35);
}
.featured-media { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #070b16; box-shadow: 0 20px 60px rgb(0 0 0 / .5), 0 0 60px rgb(120 140 255 / .08); }
.window-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / .03); }
.window-bar i { width: 9px; height: 9px; border-radius: 50%; }
.window-bar i:nth-child(1) { background: #ff7a8a99; }
.window-bar i:nth-child(2) { background: #ffd07a99; }
.window-bar i:nth-child(3) { background: #7ae3a199; }
.featured-media a { display: block; overflow: hidden; }
.featured-media img { width: 100%; transition: transform .6s var(--ease); }
.featured-media a:hover img { transform: scale(1.025); }
.featured-body h3 { margin: 14px 0 8px; font-size: clamp(30px, 3.2vw, 40px); }
.featured-lead { font-size: 17px; color: var(--ink-soft); }
.case-list { margin: 24px 0; border-top: 1px solid var(--line); }
.case-list > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.case-list dt { margin-bottom: 4px; font: 500 11px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.case-list dd { font-size: 14px; line-height: 1.7; color: var(--muted); }
.featured-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 26px); margin-top: clamp(24px, 3vw, 32px); }
.project-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; }
.project-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgb(0 0 0 / .5), 0 0 40px rgb(135 152 236 / .1); }
.project-card:hover::before, .service-card:hover::before { background: linear-gradient(140deg, rgb(169 186 255 / .7), rgb(255 255 255 / .08) 40%, rgb(198 169 255 / .55)); }
.project-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; margin: 10px 10px 0; border-radius: 12px; background: #070b16; }
.project-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); background: linear-gradient(180deg, transparent 60%, rgb(3 5 12 / .45)); pointer-events: none; }
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .7s var(--ease); }
.project-card:hover .project-media img { transform: scale(1.05); }
.project-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px 22px 24px; }
.project-type { font: 500 10px/1.4 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.project-body h3 { font-size: 22px; letter-spacing: -.025em; }
.project-body > p:not(.project-type) { font-size: 14px; line-height: 1.7; color: var(--muted); }
.project-body .chips { margin-top: 4px; }
.project-body .text-link { margin-top: auto; padding-top: 10px; align-self: flex-start; }
.project-card-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
.project-card-wide .project-media { aspect-ratio: auto; min-height: 280px; margin: 10px 0 10px 10px; }
.project-card-wide .project-body { justify-content: center; padding: 32px; }
.project-card-wide .text-link { margin-top: 8px; }
.featured-media-qyrex a { display: flex; min-height: 320px; align-items: center; justify-content: center; padding: 24px; background: #0d1020; }
.featured-media-qyrex img { width: min(100%, 360px); aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }

/* ---------- process: orbital line with glowing nodes ---------- */
.process-list { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); padding-top: 26px; }
.process-list::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgb(169 186 255 / .45) 10%, rgb(198 169 255 / .45) 90%, transparent); }
.process-card { padding: 26px 22px; }
.process-node { position: absolute; top: -26px; left: 22px; width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle, #fff 0 20%, #b9c6ff 35%, rgb(154 175 255 / .2) 70%); box-shadow: 0 0 14px #9aafff; animation: pulse 3.2s ease-in-out infinite; }
.process-card:nth-child(2) .process-node { animation-delay: -.8s; }
.process-card:nth-child(3) .process-node { animation-delay: -1.6s; }
.process-card:nth-child(4) .process-node { animation-delay: -2.4s; }
@keyframes pulse { 50% { box-shadow: 0 0 26px #b4c2ff, 0 0 0 6px rgb(169 186 255 / .08); } }
.process-step { font: 500 11px/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.process-card h3 { margin: 12px 0 8px; font-size: 22px; }
.process-card p { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- timeline ---------- */
.timeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 26px); align-items: start; }
.timeline-col { padding: clamp(22px, 3vw, 32px); }
.timeline-title { padding-bottom: 16px; font-size: 22px; border-bottom: 1px solid var(--line); }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; top: 28px; bottom: 28px; left: 4px; width: 1px; background: linear-gradient(180deg, rgb(169 186 255 / .5), rgb(198 169 255 / .15)); }
.timeline-item { position: relative; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.timeline-item::before { content: ""; position: absolute; top: 29px; left: -26px; width: 9px; height: 9px; border-radius: 50%; background: #b9c6ff; box-shadow: 0 0 12px #9aafff; }
.timeline-date { font: 400 12px/1.4 var(--font-mono); color: var(--muted); }
.timeline-item h4 { margin-top: 6px; }
.timeline-org { margin: 2px 0 10px; font-size: 14px; color: var(--accent); }
.timeline-item > p:not(.timeline-date):not(.timeline-org) { margin-bottom: 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.education-photo { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line-accent); border-radius: 12px; }
.education-photo img { width: 100%; height: 120px; object-fit: cover; filter: saturate(.6) brightness(.7); transition: filter .4s, transform .6s var(--ease); }
.education-photo:hover img { filter: saturate(.9) brightness(.9); transform: scale(1.04); }

/* ---------- services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 26px); }
.service-card { padding: 30px 28px; transition: transform .35s var(--ease); }
.service-card:hover { transform: translateY(-5px); }
.service-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 14px; color: #dbe3ff; background: radial-gradient(circle at 30% 25%, rgb(169 186 255 / .3), rgb(120 100 220 / .12)); box-shadow: inset 0 0 0 1px rgb(169 186 255 / .25), 0 0 24px rgb(140 160 255 / .15); }
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 { margin-bottom: 10px; font-size: 23px; }
.service-card p { font-size: 15px; line-height: 1.7; color: var(--muted); }

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 120px); }
.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 64px) clamp(130px, 15vw, 180px);
  border: 1px solid var(--line);
  border-radius: 28px;
  text-align: center;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgb(104 88 200 / .16), transparent 70%), rgb(8 12 24 / .6);
}
.horizon {
  position: absolute;
  left: 50%;
  top: calc(100% - clamp(80px, 10vw, 120px));
  width: 160%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 0%, #1a2450, #0a0f22 30%, #03050c 55%);
  box-shadow: 0 -2px 0 rgb(190 205 255 / .55), 0 -12px 40px rgb(140 160 255 / .35), 0 -60px 120px rgb(150 120 255 / .18);
  pointer-events: none;
}
.contact-card > :not(.horizon) { position: relative; z-index: 1; }
.contact-title { margin: 18px auto 16px; max-width: 18ch; font-size: clamp(36px, 5.4vw, 64px); line-height: 1.05; letter-spacing: -.045em; }
.contact-sub { font-size: 17px; color: var(--ink-soft); }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 36px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { transition: color .2s; }
.footer-links a:hover { color: #fff; }
.blink { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- reveal on scroll (classes set by script.js) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.project-card.reveal, .service-card.reveal { transition: opacity .8s var(--ease), transform .8s var(--ease), box-shadow .35s; }
.project-card.reveal.visible:hover { transform: translateY(-6px); }
.service-card.reveal.visible:hover { transform: translateY(-5px); }
.projects-grid .reveal:nth-child(3n+2), .services-grid .reveal:nth-child(2), .process-list .reveal:nth-child(2) { transition-delay: .08s; }
.projects-grid .reveal:nth-child(3n), .services-grid .reveal:nth-child(3), .process-list .reveal:nth-child(3) { transition-delay: .16s; }
.process-list .reveal:nth-child(4) { transition-delay: .24s; }
.reveal.visible:hover { transition-delay: 0s; }

/* ---------- project browser dialog ---------- */
.project-browser { margin: auto; width: min(1200px, 96vw); max-width: 96vw; height: 92vh; height: 92dvh; padding: 0; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--line-accent); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 120px rgb(0 0 0 / .7); }
.project-browser[open] { display: flex; flex-direction: column; }
.project-browser::backdrop { background: rgb(2 4 10 / .86); }
.browser-heading, .browser-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.browser-heading { justify-content: space-between; background: #0f1628; }
.browser-heading strong { font: 500 17px var(--font-display); }
.browser-toolbar { flex-wrap: wrap; }
.project-browser button, .browser-toolbar a { cursor: pointer; padding: 7px 13px; background: rgb(169 186 255 / .06); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; font: 500 12px/1.2 var(--font-sans); }
.project-browser button:hover, .browser-toolbar a:hover { border-color: var(--line-accent); }
.project-browser button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b1128; }
.browser-address { flex: 1; min-width: 100px; padding: 7px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--font-mono); color: var(--muted); background: #060a15; border: 1px solid var(--line); border-radius: 999px; }
.browser-hint { padding: 8px 16px; font-size: 12px; color: var(--muted); }
.browser-viewport { flex: 1; min-height: 0; display: flex; justify-content: center; background: #050811; }
#project-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.mobile-preview #project-frame { max-width: 390px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .site-nav a { padding: 7px 10px; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .process-list::before { display: none; }
  .process-node { top: -7px; }
  .featured { grid-template-columns: 1fr; }
  .orbit-art { width: 400px; }
}

@media (max-width: 900px) {
  .site-nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; padding-top: 220px; }
  .orbit-art { width: 340px; top: -20px; right: 50%; translate: 50% 0; }
  .profile-card { position: relative; width: 100%; max-width: 480px; margin-inline: auto; }
  .timeline-grid, .services-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: auto 1fr; }
  .head-line { display: none; }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; --radius: 16px; }
  .brand-text small, .header-actions .btn span { display: none; }
  .header-actions .btn { width: 40px; padding: 0; }
  .hero-sub, .contact-sub { font-size: 16px; }
  .hero-cta .btn, .contact-actions .btn, .featured-actions .btn { flex: 1 1 100%; }
  .orbit-art { width: 290px; }
  .hero-visual { padding-top: 190px; }
  .projects-grid, .process-list { grid-template-columns: 1fr; }
  .project-card-wide { display: flex; }
  .project-card-wide .project-media { aspect-ratio: 16 / 10; min-height: 0; margin: 10px 10px 0; }
  .project-card-wide .project-body { padding: 20px 22px 24px; }
  .section-head { gap: 14px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .command-trigger { right: 14px; bottom: 14px; }
  .command-trigger kbd, .command-list button small { display: none; }
  .command-list button { grid-template-columns: 30px 1fr; }
  .browser-address { order: 4; flex-basis: 100%; }
}

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