/* ============================================================
   RSSJ — portfolio
   ============================================================ */

:root {
  --bg: #08090c;
  --bg-soft: #0d0f14;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-hover: rgba(255, 255, 255, 0.052);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --muted: #9aa0b0;
  --dim: #6c7285;
  --accent: #8b8cf6;
  --accent-2: #22d3ee;

  --radius: 18px;
  --maxw: 1140px;
  --pad: clamp(20px, 5vw, 48px);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.1; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(139, 140, 246, 0.32); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- background ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 20%, transparent 80%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  top: -30vh;
  left: 50%;
  width: min(1200px, 130vw);
  height: 90vh;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(139,140,246,0.20), transparent 70%),
    radial-gradient(closest-side at 70% 40%, rgba(34,211,238,0.13), transparent 70%);
  filter: blur(20px);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--pad);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(8,9,12,0.85), rgba(8,9,12,0.4));
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; }
.brand-text {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
}

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}
.site-nav a { transition: color 0.18s ease; }
.site-nav a:hover { color: var(--text); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active {
  color: #0a0b0f;
  background: linear-gradient(120deg, #b9baff, #8ee9f5);
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 12vw, 132px) var(--pad) clamp(48px, 9vw, 96px);
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 12px;
  border: 1px solid rgba(139,140,246,0.28);
  border-radius: 999px;
  background: rgba(139,140,246,0.07);
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(34px, 6.4vw, 72px);
  font-weight: 600;
  max-width: 20ch;
  text-wrap: balance;
}
.hero h1 span { display: block; }
.grad {
  background: linear-gradient(100deg, #b9baff 0%, #8ee9f5 55%, #7ef0c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 26px;
  max-width: 62ch;
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #08090c;
  background: linear-gradient(120deg, #c3c4ff, #92ecf7);
  box-shadow: 0 10px 34px -12px rgba(139,140,246,0.75);
}
.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}
.btn-ghost:hover { background: var(--surface-hover); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 6vw, 64px);
  margin: clamp(48px, 8vw, 84px) 0 0;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.stats dt {
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dim);
  font-family: var(--mono);
}
.stats dd {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---------- sections ---------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--pad);
}

.section-head { margin-bottom: clamp(32px, 5vw, 52px); }
.section-head h2 {
  font-size: clamp(28px, 4.2vw, 42px);
}
.section-head p {
  margin-top: 14px;
  color: var(--muted);
  max-width: 58ch;
  font-size: 17px;
}

/* ---------- project cards ---------- */

.projects {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.2,0.7,0.3,1), border-color 0.28s ease, box-shadow 0.28s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.55;
  transition: opacity 0.28s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 180px at 50% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 26px 60px -34px color-mix(in srgb, var(--accent) 75%, transparent);
}
.card:hover::after { opacity: 1; }
.card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}
.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-live { color: #4ade80; border-color: rgba(74,222,128,0.28); background: rgba(74,222,128,0.08); }
.status-live i { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: pulse 2.4s infinite; }
.status-dev { color: #fbbf24; border-color: rgba(251,191,36,0.28); background: rgba(251,191,36,0.08); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.card h3 { font-size: 23px; }
.card .tagline {
  margin-top: 8px;
  font-size: 15px;
  color: color-mix(in srgb, var(--accent) 72%, #ffffff);
}
.card .desc {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 24px;
}
.tags li {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,0.02);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text);
  width: fit-content;
  transition: gap 0.2s ease, color 0.2s ease;
}
.card-link:hover { gap: 11px; color: color-mix(in srgb, var(--accent) 70%, #ffffff); }
.card-link.is-muted { color: var(--dim); cursor: default; }

/* ---------- capabilities ---------- */

.capabilities {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cap {
  padding: 30px 26px;
  background: var(--bg);
  transition: background 0.24s ease;
}
.cap:hover { background: var(--bg-soft); }
.cap h3 { font-size: 17px; }
.cap p { margin-top: 10px; color: var(--muted); font-size: 14.5px; }

/* ---------- contact ---------- */

.contact-card {
  position: relative;
  text-align: center;
  padding: clamp(40px, 7vw, 72px) var(--pad);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(600px 220px at 50% 0%, rgba(139,140,246,0.16), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  overflow: hidden;
}
.contact-card h2 { font-size: clamp(28px, 4.2vw, 40px); }
.contact-card p {
  margin: 14px auto 0;
  max-width: 48ch;
  color: var(--muted);
}
.mail {
  display: inline-block;
  margin-top: 28px;
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-bottom: 4px;
  background: linear-gradient(100deg, #b9baff, #8ee9f5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom: 1px solid rgba(139,140,246,0.4);
  transition: border-color 0.2s ease;
}
.mail:hover { border-color: rgba(139,140,246,0.9); }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px var(--pad) 46px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--dim);
}
.foot-brand { display: flex; flex-direction: column; gap: 3px; }
.foot-brand strong { color: var(--text); letter-spacing: 0.14em; font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.foot-links a { transition: color 0.18s ease; }
.foot-links a:hover { color: var(--text); }
.copy { width: 100%; font-size: 13px; }

/* ---------- reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2,0.7,0.3,1), transform 0.7s cubic-bezier(0.2,0.7,0.3,1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-live i { animation: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .site-nav { display: none; }
  .lang-switch { margin-left: auto; }
  .stats { gap: 26px 40px; }
  .foot-links { margin-left: 0; width: 100%; }
}
