:root {
  --bg: #101218;
  --bg-2: #161922;
  --card: #1c2030;
  --line: rgba(232, 234, 239, 0.1);
  --text: #e8eaef;
  --mute: #9aa1b2;
  --dim: #6b7285;
  --hot: #ff5c4d;
  --hot-2: #ff7a6e;
  --steam: #66c0f4;
  --discord: #7289da;
  --github: #e8eaef;
  --friend: #c4f04d;
  --ok: #6bcf8e;
  --info: #6aa8ff;
  --warn: #f0b45a;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Karla", system-ui, sans-serif;
  --nav: 68px;
  --shell: 1100px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav) + 10px);
}

body {
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 999;
  padding: 10px 14px;
  background: var(--hot);
  color: #111;
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

/* NAV */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav);
  background: rgba(16, 18, 24, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(16, 18, 24, 0.92);
}

.nav__in {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.nav__logo code {
  font-family: inherit;
  color: var(--hot);
  font-weight: 800;
}

.nav__links {
  display: flex;
  gap: 6px;
}

.nav__links a {
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--mute);
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__links a:hover,
.nav__links a.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease;
}

.btn--hot {
  background: var(--hot);
  color: #1a1010;
}

.btn--hot:hover {
  background: var(--hot-2);
  transform: translateY(-2px);
}

.btn--cool {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn--cool:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav) + 24px) 0 48px;
  overflow: hidden;
  text-align: center;
  background: #0c0e14;
}

.hero__stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 92, 77, 0.28) 0%, rgba(255, 92, 77, 0.08) 35%, transparent 68%);
  animation: breathe 7s ease-in-out infinite;
}

.hero__ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(58vw, 520px);
  height: min(58vw, 520px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 92, 77, 0.18);
  animation: spin 28s linear infinite;
}

.hero__ring--2 {
  width: min(78vw, 700px);
  height: min(78vw, 700px);
  border-color: rgba(255, 255, 255, 0.06);
  animation-direction: reverse;
  animation-duration: 40s;
}

.hero__ring::before,
.hero__ring--2::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hot);
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(255, 92, 77, 0.7);
}

.hero__ring--2::after {
  top: auto;
  bottom: 18%;
  background: #66c0f4;
  box-shadow: 0 0 18px rgba(102, 192, 244, 0.55);
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  animation: up 0.8s var(--ease) both;
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4rem, 16vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #fff 20%, rgba(232, 234, 239, 0.72) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--hot);
  margin-bottom: 12px;
}

.hero__lead {
  color: var(--mute);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero__btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* SECTIONS */
.sec {
  padding: 100px 0;
}

.sec--band {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

.sec__kicker {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hot);
  margin-bottom: 12px;
}

.sec__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.sec__desc {
  color: var(--mute);
  max-width: 36rem;
  margin-bottom: 40px;
}

/* ABOUT */
.about {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  margin-top: 40px;
  align-items: start;
}

.about__mark {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  font-family: var(--display);
  font-size: 3.6rem;
  font-weight: 800;
  color: var(--hot);
  background:
    linear-gradient(145deg, rgba(255, 92, 77, 0.18), transparent 55%),
    var(--card);
  border: 1px solid var(--line);
}

.about__text p {
  color: var(--mute);
  margin-bottom: 14px;
  max-width: 40rem;
}

.about__text em {
  color: var(--text);
  font-style: italic;
  font-weight: 500;
}

.about__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.about__facts li {
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}

.about__facts span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.about__timeline {
  display: grid;
  gap: 10px;
}

.about__timeline li {
  color: var(--mute);
}

.about__timeline b {
  color: var(--hot);
  margin-right: 10px;
  font-family: var(--display);
}

/* PROJECTS */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.proj {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}

.proj:hover {
  border-color: rgba(255, 92, 77, 0.35);
  transform: translateY(-3px);
}

.proj header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.proj header > span:first-child {
  font-family: var(--display);
  font-weight: 800;
  color: var(--dim);
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
}

.badge--dev {
  color: var(--info);
  background: rgba(106, 168, 255, 0.12);
}

.badge--maint {
  color: var(--warn);
  background: rgba(240, 180, 90, 0.12);
}

.badge--done {
  color: var(--ok);
  background: rgba(107, 207, 142, 0.12);
}

.proj h3 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.proj__meta {
  font-size: 0.85rem;
  color: var(--dim);
  margin-bottom: 12px;
}

.proj > p:not(.proj__meta) {
  color: var(--mute);
  font-size: 0.98rem;
  margin-bottom: 14px;
}

.proj__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.proj__tags span {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--mute);
}

.proj > a {
  font-weight: 700;
  color: var(--hot);
}

.proj > a:hover {
  color: var(--hot-2);
}

/* SERVICES */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.services li {
  padding: 22px 18px;
  border-top: 3px solid var(--hot);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 0 14px 14px;
}

.services h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.services p {
  color: var(--mute);
  font-size: 0.94rem;
}

/* STACK */
.stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stack h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hot);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.stack li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stack em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--dim);
  white-space: nowrap;
}

/* MENTOR */
.mentor {
  padding: 80px 0;
}

.mentor blockquote {
  max-width: 680px;
}

.mentor p {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.mentor footer {
  color: var(--dim);
  font-size: 0.92rem;
}

.mentor cite {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

.mentor a {
  color: var(--hot);
  font-weight: 600;
}

/* ========== CONTACT DECK ========== */
.connect {
  padding-bottom: 60px;
  overflow: hidden;
}

.connect__head {
  margin-bottom: 36px;
}

.deck {
  position: relative;
  margin-top: 8px;
}

.deck__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(12vw, 140px);
  z-index: 2;
  pointer-events: none;
}

.deck__fade--l {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.deck__fade--r {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.deck__viewport {
  overflow: hidden;
  padding: 20px 0 28px;
}

.deck__track {
  display: flex;
  align-items: stretch;
  gap: 20px;
  width: max-content;
  animation: scroll-deck 18s linear infinite;
  padding-inline: 40px;
}

.deck:hover .deck__track,
.deck:focus-within .deck__track {
  animation-play-state: paused;
}

@keyframes scroll-deck {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.social {
  position: relative;
  flex: 0 0 auto;
  width: min(280px, 78vw);
  min-height: 270px;
  height: 270px;
  padding: 26px 22px;
  border-radius: 20px;
  border: 1px solid transparent;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  transform: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, border-color 0.25s ease;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.social:hover,
.social:focus-visible {
  transform: translateY(-6px);
  z-index: 3;
  outline: none;
}

.social__glow {
  position: absolute;
  inset: -35% -15% auto;
  height: 65%;
  opacity: 0.45;
  filter: blur(42px);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.social:hover .social__glow {
  opacity: 0.7;
}

.social--steam {
  --accent: #66c0f4;
  background:
    linear-gradient(165deg, rgba(102, 192, 244, 0.28) 0%, transparent 48%),
    linear-gradient(160deg, #123247 0%, #1a2433 55%, #121820 100%);
  border-color: rgba(102, 192, 244, 0.35);
}

.social--github {
  --accent: #f0f3f6;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, transparent 45%),
    linear-gradient(160deg, #2b313a 0%, #1c2128 55%, #14181e 100%);
  border-color: rgba(240, 243, 246, 0.22);
}

.social--discord {
  --accent: #a5b4fc;
  background:
    linear-gradient(165deg, rgba(88, 101, 242, 0.38) 0%, transparent 48%),
    linear-gradient(160deg, #2a2f6b 0%, #1c2140 55%, #15182a 100%);
  border-color: rgba(114, 137, 218, 0.4);
}

.social--friend {
  --accent: #c4f04d;
  background:
    linear-gradient(165deg, rgba(196, 240, 77, 0.22) 0%, transparent 46%),
    linear-gradient(345deg, #1f2a14 0%, #243018 40%, #1a2230 100%);
  border-color: rgba(196, 240, 77, 0.4);
}

.social--steam .social__glow { background: #66c0f4; }
.social--github .social__glow { background: #9aa4af; }
.social--discord .social__glow { background: #7289da; }
.social--friend .social__glow { background: #c4f04d; }

.social--steam:hover,
.social--steam:focus-visible {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(102, 192, 244, 0.35);
}

.social--github:hover,
.social--github:focus-visible {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(240, 243, 246, 0.25);
}

.social--discord:hover,
.social--discord:focus-visible {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(114, 137, 218, 0.4);
}

.social--friend:hover,
.social--friend:focus-visible {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(196, 240, 77, 0.4);
}

.social__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 80% 18%, rgba(196, 240, 77, 0.22), transparent 42%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  mask-image: linear-gradient(180deg, #000 18%, transparent 88%);
}

.social__ribbon {
  position: absolute;
  top: 20px;
  right: 16px;
  z-index: 1;
  padding: 5px 10px;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #12150c;
  background: var(--friend);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(196, 240, 77, 0.25);
}

.social__url {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--friend);
  margin-top: 2px;
}

.social--friend .social__hint {
  color: rgba(232, 234, 239, 0.72);
}

.social__icon {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.social--steam .social__icon {
  background: rgba(102, 192, 244, 0.16);
  border-color: rgba(102, 192, 244, 0.35);
}

.social--github .social__icon {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.social--discord .social__icon {
  background: rgba(114, 137, 218, 0.2);
  border-color: rgba(114, 137, 218, 0.4);
}

.social--friend .social__icon {
  padding: 0;
  background: transparent;
  border-color: rgba(196, 240, 77, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(196, 240, 77, 0.12);
}

.social__pfp {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.social__platform {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: auto;
}

.social__handle {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  word-break: break-word;
}

.social__hint {
  font-size: 0.88rem;
  color: var(--mute);
  margin-top: 6px;
}

.social::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
  opacity: 0.9;
}

.connect__mail {
  margin-top: 8px;
  text-align: center;
  color: var(--dim);
  font-size: 0.95rem;
}

.connect__mail a {
  color: var(--hot);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 92, 77, 0.4);
}

.connect__mail a:hover {
  color: var(--hot-2);
}

/* FOOTER */
.foot {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.foot__in {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--dim);
  font-size: 0.9rem;
}

.foot__in div {
  display: flex;
  gap: 18px;
}

.foot a:hover {
  color: var(--hot);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translateX(-50%) translateY(120%);
  padding: 12px 18px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Subpages */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page main {
  flex: 1;
  padding: calc(var(--nav) + 48px) 0 80px;
}

.legal {
  max-width: 680px;
}

.legal h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.legal h2 {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--hot);
  margin: 26px 0 8px;
}

.legal p {
  color: var(--mute);
  margin-bottom: 12px;
}

.legal a {
  color: var(--hot);
  font-weight: 600;
}

.err404 {
  text-align: center;
  padding: 60px 0;
}

.err404__code {
  font-family: var(--display);
  font-size: clamp(6rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--hot);
}

.err404 h1 {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 800;
  margin: 8px 0 10px;
}

.err404 p {
  color: var(--mute);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 960px) {
  .projects,
  .services,
  .stack {
    grid-template-columns: 1fr;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .services {
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .nav__toggle {
    display: inline-flex;
  }

  .nav__links {
    position: fixed;
    inset: var(--nav) 0 auto;
    display: grid;
    gap: 4px;
    padding: 12px 16px 18px;
    background: rgba(16, 18, 24, 0.96);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.2s ease;
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero__brand {
    font-size: clamp(3.4rem, 18vw, 5.5rem);
  }

  .hero__btns {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__btns .btn {
    width: 100%;
  }

  .sec {
    padding: 72px 0;
  }

  .deck__track {
    animation-duration: 14s;
  }

  .social {
    width: min(250px, 82vw);
    min-height: 250px;
    height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .deck__track {
    animation: none;
    flex-wrap: wrap;
    width: min(100% - 40px, var(--shell));
    margin-inline: auto;
    justify-content: center;
    padding-left: 0;
  }

  .deck__track .social[aria-hidden="true"] {
    display: none;
  }

  .hero__content,
  .hero__glow,
  .hero__ring {
    animation: none !important;
  }
}
