@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sx-black: #0a0a0a;
  --sx-red: #ff3b3b;
  --sx-green: #4af626;
  --sx-offwhite: #ededed;
  --sx-amber: #ffb000;
  --sx-font-mono: "JetBrains Mono", "DejaVu Sans Mono", menlo, consolas, monospace;
}

body {
  background: var(--sx-black);
  color: var(--sx-offwhite);
  font-family: var(--sx-font-mono);
}

.sx-logo {
  color: var(--sx-red);
  letter-spacing: 0.02em;
  font-size: 0;
}

.sx-prompt {
  opacity: 0;
}

.sx-typed {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.sx-sub {
  color: var(--sx-green);
}

.sx-fade-in {
  opacity: 0;
  transition: opacity 0.8s;
}

.sx-cursor {
  display: inline-block;
  width: 0.6ch;
  color: var(--sx-red);
  opacity: 0;
}

.sx-cursor.blink {
  animation: sx-blink 1.1s steps(1, end) infinite;
}

@keyframes sx-blink {
  50% {
    opacity: 0;
  }
}

/* ===== CSS Reset ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

h1,
h2,
h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===== Nav ===== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgb(10 10 10 / 85%);
  border-bottom: 1px solid rgb(255 59 59 / 30%);
  box-shadow: 0 0 12px rgb(255 59 59 / 10%);
  backdrop-filter: blur(10px);
}

.nav-mark {
  color: var(--sx-red);
  font-family: var(--sx-font-mono);
  font-size: 20px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a,
.nav-mobile a,
.contact-line a,
.footer a {
  font-family: var(--sx-font-mono);
  transition: opacity 0.2s;
}

.nav-links a {
  color: var(--sx-offwhite);
  font-size: 14px;
  opacity: 0.7;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--sx-green);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgb(255 59 59 / 30%);
  color: var(--sx-red);
  font-family: var(--sx-font-mono);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 10px;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgb(10 10 10 / 95%);
  border-bottom: 1px solid rgb(255 59 59 / 20%);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  flex-direction: column;
  gap: 16px;
}

.nav-mobile.open {
  display: flex;
}

/* stylelint-disable no-descending-specificity */
.nav-mobile a {
  color: var(--sx-offwhite);
  font-size: 14px;
  opacity: 0.7;
}
/* stylelint-enable no-descending-specificity */

.nav-mobile a:hover {
  opacity: 1;
  color: var(--sx-green);
}

/* ===== Hero ===== */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgb(74 246 38 / 3%) 0,
    rgb(74 246 38 / 3%) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(74 246 38 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(74 246 38 / 5%) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.hero .sx-logo {
  line-height: 1;
}

.hero .sx-logo > * {
  font-size: clamp(32px, 8vw, 72px);
}

.hero .sx-sub {
  margin-top: 16px;
  font-size: clamp(14px, 2.5vw, 20px);
}

/* ===== Section common ===== */

.section {
  padding: 96px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.section-title {
  color: var(--sx-amber);
  font-family: var(--sx-font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 48px;
}

/* ===== About cards ===== */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  border: 1px solid rgb(255 59 59 / 20%);
  padding: 32px;
  transition:
    box-shadow 0.3s,
    border-color 0.3s;
}

.card:hover {
  border-color: rgb(255 59 59 / 40%);
  box-shadow: 0 0 20px rgb(255 59 59 / 8%);
}

.card-heading {
  color: var(--sx-green);
  font-family: var(--sx-font-mono);
  font-size: 0;
  margin-bottom: 12px;
}

/* stylelint-disable no-descending-specificity */
.card-heading > * {
  font-size: 16px;
}
/* stylelint-enable no-descending-specificity */

.card-prompt {
  margin-right: 0.5ch;
}

.card-typed {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.card-cursor {
  display: inline-block;
  width: 0.6ch;
  opacity: 0;
}

.card p {
  color: rgb(237 237 237 / 70%);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  opacity: 0;
  transition: opacity 0.8s;
}

/* ===== Section break ===== */

.section-break {
  text-align: center;
  color: var(--sx-green);
  font-size: 20px;
  letter-spacing: 0.5em;
  opacity: 0.4;
  padding: 16px 0;
}

/* Card typing — JS drives per-keystroke timing, CSS handles glow */

.card.typing {
  border-color: rgb(74 246 38 / 60%);
  box-shadow: 0 0 20px rgb(74 246 38 / 15%);
}

/* ===== Contact ===== */

.contact-line {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 15px;
}

.prompt {
  color: var(--sx-green);
  font-weight: 700;
}

/* stylelint-disable no-descending-specificity */
.contact-line a {
  text-decoration: underline;
  text-decoration-color: rgb(237 237 237 / 30%);
  text-underline-offset: 3px;
  transition:
    color 0.2s,
    text-decoration-color 0.2s;
}
/* stylelint-enable no-descending-specificity */

.contact-line a:hover {
  color: var(--sx-green);
  text-decoration-color: var(--sx-green);
}

/* ===== Footer ===== */

.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid rgb(255 59 59 / 15%);
  font-size: 13px;
  opacity: 0.5;
}

/* stylelint-disable no-descending-specificity */
.footer a {
  color: var(--sx-green);
  text-decoration: none;
}
/* stylelint-enable no-descending-specificity */

.footer a:hover {
  opacity: 0.8;
}

.footer p {
  margin: 8px 0 0;
}

/* ===== Mobile breakpoint ===== */

@media (width <= 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 16px;
  }
}
