:root {
  --bg: #000;
  --panel: #04070d;
  --line: #11233f;
  --line-strong: #1c3c6e;
  --text: #e6edf7;
  --muted: #8797b0;
  --blue: #2f7bff;
  --sky: #5ab4ff;
  --ice: #a9d4ff;
  --grad: linear-gradient(135deg, #1d4ed8, #38bdf8);
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--ice); }
a:focus-visible, .button:focus-visible, .lang-btn:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

.container { max-width: 940px; margin-inline: auto; padding: 0 22px; }
section, footer { padding: 56px 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 72px;
  padding-bottom: 56px;
}
.hero::before {
  /* faint blueprint grid, fades out downward */
  content: "";
  position: absolute;
  inset: 0 -200px auto -200px;
  height: 460px;
  background-image:
          linear-gradient(rgba(47,123,255,.09) 1px, transparent 1px),
          linear-gradient(90deg, rgba(47,123,255,.09) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero-text { flex: 1 1 auto; min-width: 0; }

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero h1 .lang.active { display: block; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 52ch;
  margin: 20px 0 0;
}

.pfp {
  margin: 0;
  flex: 0 0 auto;
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 200deg, #1d4ed8, #38bdf8, #0b1a33, #1d4ed8);
  box-shadow: 0 0 60px rgba(47,123,255,.28);
  animation: ring-in 1.1s ease-out both;
}
.pfp::after {
  /* outer orbit ring */
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
}
.pfp img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg);
}
@keyframes ring-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Buttons & language switch ---------- */
.hero-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}
.hero-left { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  display: inline-block;
  padding: 11px 18px;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(47,123,255,.08);
  color: var(--ice);
  text-decoration: none;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.button:hover {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.hero-left .button:first-child {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.hero-left .button:first-child:hover { filter: brightness(1.12); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  color: var(--muted);
  transition: color .15s ease, background .15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: #fff; background: var(--grad); }

/* ---------- Language visibility ---------- */
.lang { display: none; }
.lang.active { display: inline; }
p.lang.active { display: block; }

/* ---------- Section titles ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.section-title .dot {
  width: 8px;
  height: 28px;
  border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(56,189,248,.55);
}
.section-title h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.card p { margin: 0 0 14px; max-width: 75ch; }
.card h3 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.card h4 { margin: 22px 0 0; font-size: 1rem; color: var(--ice); }
.card strong { color: var(--ice); font-weight: 600; }
.card ul { padding-left: 20px; margin: 0 0 14px; }
.card li::marker { color: var(--blue); }

/* Projects get a blue rail so they read as entries in a log */
.project {
  margin-bottom: 56px;
  border-left: 3px solid var(--blue);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
.project:last-child { margin-bottom: 0; }

/* Tech stack reads like a config line */
.stack {
  margin-top: 20px !important;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #02050a;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
  max-width: none !important;
}
.stack strong { color: var(--sky); }

/* Skills */
.skills-list {
  list-style: none;
  padding: 0 !important;
  margin-top: 12px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skills-list li {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(47,123,255,.07);
  color: var(--ice);
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 500;
  transition: border-color .2s ease, background .2s ease;
}
.skills-list li:hover { border-color: var(--sky); background: rgba(47,123,255,.16); }

/* ---------- Galleries ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 28px;
}
.gallery img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #02050a;
}
.project-gallery { align-items: start; }
.project-gallery figure { margin: 0; min-width: 0; }
.project-gallery .gallery-wide { grid-column: 1 / -1; }
.project-gallery a { display: block; border-radius: 8px; transition: box-shadow .2s ease; }
.project-gallery a:hover { box-shadow: 0 0 0 1px var(--sky), 0 0 28px rgba(47,123,255,.25); }
.project-gallery a:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; }
.project-gallery img { display: block; height: auto; }
.project-gallery figcaption { margin-top: 8px; color: var(--muted); font-size: .85rem; }

.project-status {
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--sky);
  border-radius: 6px;
  background: rgba(47,123,255,.07);
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .hero-grid { flex-direction: column-reverse; align-items: flex-start; gap: 32px; }
  .pfp { width: 168px; height: 168px; }
  .gallery { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pfp { animation: none; }
  * { transition: none !important; }
}