/* =========================================================
   rocket, portfolio styles
   ========================================================= */

:root {
  --bg:        #0d0d11;
  --bg-alt:    #131319;
  --surface:   #17171f;
  --surface-2: #1e1e28;
  --line:      #2a2a36;
  --text:      #ecebf0;
  --muted:     #9a99a8;
  --accent:    #ffb454;
  --btn-bg:    #e07b1f;
  --btn-text:  #ffffff;
  --accent-2:  #ff7a8a;
  --accent-3:  #7ad7ff;
  --shadow:    0 20px 50px rgba(0, 0, 0, .45);
  --radius:    16px;
  --maxw:      1180px;
  --font:      "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

html[data-theme="light"] {
  --bg:        #faf8f5;
  --bg-alt:    #f2efe9;
  --surface:   #ffffff;
  --surface-2: #f4f1ec;
  --line:      #e2ddd4;
  --text:      #1b1a20;
  --muted:     #6c6a76;
  --accent:    #c9761c;
  --btn-bg:    #9c4f0a;
  --btn-text:  #ffffff;
  --accent-2:  #d2455c;
  --accent-3:  #1f87b5;
  --shadow:    0 18px 44px rgba(60, 50, 40, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: .82em; letter-spacing: .01em; }

::selection { background: var(--accent); color: #14141a; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #14141a;
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
  text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================ nav ============================ */

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, padding .25s ease;
}
.nav.is-stuck { border-bottom-color: var(--line); padding-top: 12px; padding-bottom: 12px; }

.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: .95rem;
  transition: color .2s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .25s ease;
}
.nav__links a:hover, .nav__links a.is-current { color: var(--text); }
.nav__links a:hover::after, .nav__links a.is-current::after {
  transform: scaleX(1); transform-origin: left;
}

.theme-toggle {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-toggle__icon {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -5px -3px 0 0 var(--surface);
  transition: box-shadow .3s ease, background .3s ease;
}
html[data-theme="light"] .theme-toggle__icon {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ============================ hero =========================== */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 110px) clamp(20px, 5vw, 56px) clamp(60px, 8vw, 100px);
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .28;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 20%, transparent 78%);
}
.hero__inner {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(30px, 5vw, 70px); align-items: center;
}

.hero__title {
  font-size: clamp(2.3rem, 5.6vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  margin: 0 0 22px;
  font-weight: 700;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  background-clip: text; -webkit-background-clip: text;
  color: transparent;
}

.hero__lead {
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 34px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 46px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 12px;
  font-weight: 600; font-size: .96rem;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease, border-color .2s ease;
}
.btn--sm { padding: 10px 18px; font-size: .9rem; }
.btn--primary {
  background: var(--btn-bg); color: var(--btn-text);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--btn-bg) 34%, transparent);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--btn-bg) 45%, transparent);
}
.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-3px); }

.hero__cat { margin: 0; text-align: center; }
.hero__catframe {
  position: relative;
  border-radius: 24px; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}
.hero__catframe::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 55%, color-mix(in srgb, var(--accent) 22%, transparent));
  pointer-events: none;
}
.hero__catframe img { width: 100%; height: auto; }
.hero__cat figcaption { color: var(--muted); margin-top: 14px; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50%      { transform: translateY(-14px) rotate(.6deg); }
}

/* ========================== sections ========================= */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 9vw, 110px) clamp(20px, 5vw, 56px);
}
.section--alt {
  max-width: none;
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }

.section__head { margin-bottom: 44px; }
.section__title {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.section__num { color: var(--accent); font-size: .95rem; }
.section__sub { color: var(--muted); margin: 0; }

/* ========================== featured ========================= */

.featured {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 54px;
  box-shadow: var(--shadow);
}
.featured__media { position: relative; background: #000; min-height: 260px; }
.featured__media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;
}

.featured__body { padding: clamp(24px, 3vw, 38px); }
.tagline { color: var(--accent); margin: 0 0 10px; }
.featured__body h3 { font-size: 1.7rem; margin: 0 0 14px; letter-spacing: -.01em; }
.featured__body p { color: var(--muted); margin: 0 0 20px; }
.featured__links { margin-top: 24px; }

/* ============================ chips ========================== */

.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin-block: 0; padding: 0;
}
.chips li {
  font-family: var(--mono); font-size: .76rem;
  padding: 5px 11px; border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.chips--lg { justify-content: center; }
.chips--lg li {
  font-size: .85rem; padding: 9px 16px;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.chips--lg li:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

/* ============================ grid =========================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.project {
  position: relative;
  display: flex; flex-direction: column;
  text-decoration: none;
  overflow: hidden;
}
.project::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.project:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow);
}
.project:hover::before { opacity: 1; }

.project__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.project__name { font-size: 1.16rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.project__arrow { color: var(--muted); transition: transform .25s ease, color .25s ease; }
.project:hover .project__arrow { transform: translate(3px, -3px); color: var(--accent); }

.project__desc { color: var(--muted); font-size: .95rem; margin: 0 0 18px; flex: 1; }

.project__meta {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--line);
}
.project__lang { display: inline-flex; align-items: center; gap: 7px; }
.project__langDot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.project__fork { margin-left: auto; opacity: .75; }

.grid__error {
  grid-column: 1 / -1;
  display: grid; justify-items: center; gap: 14px;
  text-align: center; color: var(--muted);
  padding: 30px 0;
}
.grid__error img { border-radius: 14px; }
.grid__error p { margin: 0; }

/* loading placeholders while github answers */
.skeleton { display: grid; gap: 12px; align-content: start; }
.skeleton__bar {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton__bar--meta { margin-top: 14px; height: 9px; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================ stack ========================== */

.stack {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px;
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
}

.skill { margin-bottom: 22px; }
.skill__row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px; gap: 12px;
}
.skill__name { font-weight: 600; }
.skill__note { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.skill__track {
  height: 9px; border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.skill__fill {
  display: block;
  height: 100%; width: 0;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1);
}

.stack__aside { display: grid; justify-items: center; }
.stack__cat {
  width: 100%;
  max-width: 180px;          /* the gif is only 180px wide, never upscale it */
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.stack__toolsTitle {
  font-size: 1.05rem; margin-block: 46px 18px;
  font-weight: 600; text-align: center;
}

/* ============================ about ========================== */

.about {
  display: grid; grid-template-columns: 1.3fr .7fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.about__copy p { color: var(--muted); }
.about__copy strong { color: var(--text); }

.about__facts {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: grid; gap: 10px;
}
.about__facts li {
  font-family: var(--mono); font-size: .84rem; color: var(--muted);
  padding-left: 22px; position: relative;
}
.about__facts li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent);
}

.about__fig { margin: 0; text-align: center; }
.about__fig img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.about__fig figcaption { color: var(--muted); margin-top: 12px; }

/* =========================== contact ========================= */

.section--contact { text-align: center; }
.contact__title {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  letter-spacing: -.03em;
  margin: 0 0 14px;
}
.contact__lead { color: var(--muted); max-width: 48ch; margin: 0 auto 32px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* =========================== footer ========================== */

.footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(20px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .86rem;
}
.footer p { margin: 0; }
.footer__top {
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font: inherit;
  transition: color .2s ease;
}
.footer__top:hover { color: var(--accent); }

/* =========================== reveal ========================== */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ========================= responsive ======================== */

@media (max-width: 900px) {
  .hero__inner,
  .featured,
  .stack,
  .about { grid-template-columns: 1fr; }

  .hero__cat { order: -1; max-width: 300px; margin-inline: auto; }
  .about__fig { max-width: 300px; margin-inline: auto; }
  .stack { grid-template-columns: 1fr; }
  .featured__media { min-height: 220px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .nav__links { gap: 16px; font-size: .9rem; order: 3; width: 100%; justify-content: space-between; }
  .nav { flex-wrap: wrap; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
