/* ============================================================
   FORGE — Theme Stylesheet
   Colour: deep navy-black × signal red × off-white
   ============================================================ */

/* ── Self-hosted Fonts ─────────────────────────────────────── */
@font-face {
  font-family: "UbuntuSans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-Regular.woff2") format("woff2");
}

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

@font-face {
  font-family: "UbuntuSans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-BoldItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedRegular.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedBold.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedBoldItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedMedium.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedMediumItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedSemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedSemiBoldItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedThin.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 100;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedThinItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedExtraLight.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 200;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedExtraLightItalic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedLight.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSans-Condensed";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/UbuntuSans/UbuntuSansNerdFont-CondensedLightItalic.woff2") format("woff2");
}

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

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

@font-face {
  font-family: "UbuntuSansMono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/UbuntuSansMono/UbuntuSansMonoNerdFont-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "UbuntuSansMono";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/UbuntuSansMono/UbuntuSansMonoNerdFont-BoldItalic.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Core palette */
  --black: #07080d;
  --navy-deep: #0b0e1a;
  --navy: #0f1422;
  --navy-mid: #141929;
  --navy-light: #1c2338;
  --navy-border: #232b42;
  --navy-muted: #2d3655;

  --red: #8c182c;
  --red-deep: #7d121b;
  --red-glow: rgba(168, 24, 36, 0.15);
  --red-subtle: rgba(168, 24, 36, 0.06);

  --white: #f0f2f7;
  --grey-light: #c8ccd8;
  --grey: #8891aa;
  --grey-dark: #3e4860;
  --orange: #f0a500;

  --term-bg: rgba(0, 10, 20, 0.25);
  --term-prompt: var(--red);
  --term-cmd: var(--white);
  --term-out: var(--grey);
  --term-success: var(--rust-grad);
  /*  --term-success: var(--red);
  --rust-grad: linear-gradient(135deg, var(--red) 0%, #f0a500 100%);*/
  --term-link: var(--red);

  --rust-grad: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  --red-grad: linear-gradient(135deg, var(--red-deep) 0%, var(--red) 100%);
  --grey-grad: linear-gradient(135deg, var(--grey-dark) 0%, var(--grey) 100%);
  --light-grey-grad: linear-gradient(135deg, var(--grey) 0%, var(--grey-light) 100%);

  /* Typography */
  --font-display: "UbuntuSans", sans-serif;
  --font-body: "UbuntuSans", sans-serif;
  --font-condensed: "UbuntuSans-Condensed", sans-serif;
  --font-mono: "UbuntuSansMono", monospace;

  /* Typography */
  /*--font-display: "UbuntuSans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "UbuntuSans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-condensed: "UbuntuSans-Condensed", "UbuntuSans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "UbuntuSansMono", "Cascadia Code", "Fira Code", monospace;*/

  /* Sizing */
  --max-w: 1180px;
  --max-w-narrow: 760px;
  --nav-h: 68px;
  --scale: 1;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: calc(16px * var(--scale));
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  background-color: var(--navy-deep);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.72;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--navy-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--navy-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

/* ── Grain overlay ───────────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: 0.028;
  pointer-events: none;
  z-index: 1000;
}

/* ── Typography scale ────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
}
h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 600;
}
h4 {
  font-size: 1.15rem;
  font-weight: 600;
}

p {
  font-size: 1.05rem;
  color: var(--grey-light);
}
small {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--grey);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

code {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--red);
}

pre {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-left: 3px solid var(--red);
  padding: 1.4rem 1.6rem;
  overflow-x: auto;
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--grey-light);
}

/* ── Layout utilities ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}
.section--sm {
  padding: 3.5rem 0;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 900;
  display: flex;
  align-items: center;
  background: rgba(11, 14, 26, 0.7);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--navy-border);
  transition: border-color 0.3s;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__logo:hover .nav__logo-label {
  color: var(--red);
}

.nav__logo-img {
  width: 70px;
  height: 35px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.nav__logo-label {
  font-family: var(--font-condensed);

  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  transition: all 0.3s var(--ease-out);
}

.nav__links {
  display: flex;
  gap: 2.4rem;
  align-items: center;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--grey);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0px;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.nav__link:hover,
.nav__link--active {
  color: var(--white);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* ── Mobile nav toggle ─────────────────────────────────────────── */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

/*.nav__toggle:hover {
  opacity: 0.7;
}*/

.nav__toggle:hover .nav__toggle-bar {
  background: var(--red);
}

.nav__toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s var(--ease-out);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
  gap: 2rem;
}

@media (min-width: 1400px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}


.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--navy-border) 1px, transparent 1px), linear-gradient(90deg, var(--navy-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.2;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, var(--navy-deep) 30%, transparent 100%);
}

.hero__bg-image {
  position: absolute;
  inset: 0;
  background-image: url("/img/hero_bg.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  mask-image: linear-gradient(to bottom, var(--navy-deep) 0%, transparent 100%);
  z-index: 0;
}

.hero__content {
  padding: 0 2rem 0 max(2rem, calc((100vw - var(--max-w)) / 2 + 2rem));
  position: relative;
  z-index: 1;
  justify-self: end;
  width: 100%;
  padding-right: 2rem;
}

@media (min-width: 1400px) {
  .hero__content {
    padding-left: max(4rem, calc((100vw - var(--max-w)) / 2 + 4rem));
    padding-right: 4rem;
  }
}

@media (min-width: 1400px) {
  .hero__content {
    padding-left: max(2rem, calc((100vw - var(--max-w)) / 2 + 2rem));
  }
}

@media (min-width: 1400px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
  }
}


.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--navy-border) 1px, transparent 1px), linear-gradient(90deg, var(--navy-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.2;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero__bg-image {
  position: absolute;
  inset: 0;
  background-image: url("/img/hero_bg_blurred.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  /*filter: blur(4px);*/
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  z-index: 0;
}

.hero__content {
  padding: 0 2rem 0 max(2rem, calc((100vw - var(--max-w)) / 2 + 2rem));
  position: relative;
  z-index: 1;
  justify-self: end;
  width: 100%;
  padding-right: 2rem;
}

.hero__content {
  padding: 0 2rem 0 max(2rem, calc((100vw - var(--max-w)) / 2 + 2rem));
  position: relative;
  z-index: 1;
  /*max-width: 600px;*/
}

@media (min-width: 1400px) {
  .hero__content {
    padding-left: max(4rem, calc((100vw - var(--max-w)) / 2 + 4rem));
  }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(168, 24, 36, 0.1);
  border: 1px solid rgba(168, 24, 36, 0.3);
  border-radius: 100px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero__badge-icon {
  font-size: 2rem;
  background: var(--rust-grad);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.25em;
  line-height: 1.28; /* Prevents extra line-height clipping */
}

.hero__badge-label {
  background: var(--rust-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title {
  margin-bottom: 1.5rem;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
}

.hero__title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 2px var(--red);
}

.hero__accent {
  background: var(--rust-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--grey-light);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero__stats {
  display: flex;
  gap: 2.5rem;
  justify-content: flex-start;
}

@media (min-width: 1400px) {
  .hero__stats {
    gap: 3.5rem;
  }
}

.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.hero__stat-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__stat-icon {
  font-size: 2rem;
  color: var(--white);
  padding-right: 0.25em;
  line-height: 1.28; /* Prevents extra line-height clipping */
}

.hero__stat-icon:hover {
  background: var(--rust-grad);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: max(2rem, calc((100vw - var(--max-w)) / 2 + 2rem));
  position: relative;
  z-index: 1;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn--primary:hover::before {
  opacity: 1;
}

.btn--primary:hover {
  background: var(--red-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px var(--red-glow);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--grey-light);
  border-color: var(--navy-border);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--grey-dark);
  transform: translateY(-2px);
}

.btn--ghost:hover {
  border-color: var(--grey-dark);
  color: var(--white);
  transform: translateY(-2px);
}

/* ── Section heading ─────────────────────────────────────────── */
.section-head {
  margin-bottom: 4rem;
}

.section-head__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.section-head__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
  max-width: 120px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  background: linear-gradient(135deg, var(--white) 0%, var(--grey-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-head__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.section-head__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
  max-width: 80px;
}

/* ── Project cards ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5px;
  border: 1.5px solid var(--navy-border);
  border-radius: 12px;
  overflow: hidden;
}

.project-card {
  background: var(--navy);
  padding: 2.5rem;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, #f0a500 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.project-card:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.project-card:hover::before {
  transform: scaleX(1);
}

.project-card__lang-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.project-card__lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.project-card__lang__icon {
  /*content: "🦀";*/
  font-size: 1.5rem;
  /*color: var(--red);*/
  /*background: var(--rust-grad);*/
  /*background-clip: text;*/
  /*-webkit-background-clip: text;*/
  /*-webkit-text-fill-color: transparent;*/
  /*padding-right: 0.3em;*/
  /*display: inline-block;*/

  margin: -0.1em; /* Negative margin to compensate for padding
  /*overflow: visible;*/
  line-height: 1.5; /* Prevents extra line-height clipping */
}

.project-card:hover .project-card__lang__icon {
  color: var(--red);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--white);
  transition: color 0.2s;
}

.project-card:hover .project-card__title {
  color: var(--red);
}

.project-card__desc {
  font-size: 0.95rem;
  color: var(--grey-light);
  line-height: 1.7;
  margin-bottom: 1.6rem;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25em 0.7em;
  border-radius: 3px;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  color: var(--grey);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card__link {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition:
    color 0.2s,
    gap 0.2s;
}

.project-card__link:hover {
  color: var(--red);
  gap: 0.7rem;
}

/* ── Single project page ─────────────────────────────────────── */
.project-hero {
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--navy-border);
  position: relative;
}

.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--red-subtle) 0%, transparent 60%);
  pointer-events: none;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.project-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-meta__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey-dark);
}

.project-meta__value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--grey-light);
}

.project-body {
  padding: 4rem 0;
}

.project-body__content h2 {
  font-size: 1.7rem;
  margin: 2.8rem 0 1rem;
  color: var(--white);
}

.project-body__content h3 {
  font-size: 1.25rem;
  margin: 2rem 0 0.8rem;
  color: var(--grey-light);
}

.project-body__content p {
  margin-bottom: 1.4rem;
}

.project-body__content ul,
.project-body__content ol {
  margin: 1.2rem 0 1.4rem 1.5rem;
  list-style: disc;
}

.project-body__content ol {
  list-style: decimal;
}

.project-body__content li {
  color: var(--grey-light);
  margin-bottom: 0.4rem;
}

.project-body__content a:not(.btn) {
  color: var(--red);
  border-bottom: 1px solid var(--red-glow);
  transition: border-color 0.2s;
}

.project-body__content a:not(.btn):hover {
  border-color: var(--red);
}

/* Source panel */
.source-panel {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 2rem;
}

.source-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
}

.source-panel__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.source-panel__title svg {
  color: var(--red);
}

.source-panel__body {
  padding: 1.4rem;
}

.source-panel__loading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--grey-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
}

.gitea-tree {
  width: 100%;
}

.gitea-file {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--grey);
  transition:
    background 0.15s,
    color 0.15s;
  cursor: pointer;
}

.gitea-file:hover {
  background: var(--navy-light);
  color: var(--white);
}
.gitea-file--dir {
  color: var(--grey-light);
}
.gitea-file--dir::before {
  content: "📁";
  font-size: 0.75rem;
}
.gitea-file--file::before {
  content: "📄";
  font-size: 0.75rem;
}
.gitea-file--rust::before {
  content: "🦀";
  font-size: 0.75rem;
}

/* ── WASM demo container ──────────────────────────────────────── */
.wasm-demo {
  background: var(--black);
  border: 1px solid var(--navy-border);
  border-top: 2px solid var(--red);
  border-radius: 0 0 8px 8px;
  padding: 2rem;
  margin: 2.5rem 0;
}

.wasm-demo__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Skills / tech section ───────────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  overflow: hidden;
}

.tech-item {
  background: var(--navy);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
  min-height: 90px;
}

.tech-item__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tech-item__icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}

.tech-item {
  background: var(--navy);
  padding: 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.tech-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tech-item:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
}
.tech-item:hover::before {
  opacity: 1;
}

.tech-item__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-item__type {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--navy-border);
  padding: 4rem 0 3rem;
  margin-top: 6rem;
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  transition: opacity 0.3s var(--ease-out);
}

.footer__logo:hover {
  opacity: 0.7;
}

.footer__logo-img {
  width: 40px;
  height: 20px;
}

.footer__logo-label {
  font-family: var(--font-condensed);

  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  transition: all 0.3s var(--ease-out);
}

.footer__logo:hover .footer__logo-label {
  color: var(--red);
}

.footer__tagline {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--grey-dark);
  max-width: 300px;
  line-height: 1.6;
}

.footer__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.5rem;
}

.footer__links {
  display: flex;
  gap: 1.8rem;
}

.footer__link {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--grey-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.footer__link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.footer__link:hover {
  color: var(--red);
}

.footer__link:hover::after {
  width: 100%;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--grey-dark);
}

/* ── Terminal / typewriter block ─────────────────────────────── */
.terminal {
  background: var(--term-bg);
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 700px;
  min-width: 400px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(168, 24, 36, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.terminal__bar {
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  padding: 0.65rem 1rem;
  position: relative;
}

.terminal__dot {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal__dot--grey {
  right: 2.5rem;
  background: var(--grey-grad);
}

.terminal__dot--amber {
  right: 1.5rem;
  background: var(--rust-grad);
}

.terminal__dot--red {
  right: 0.5rem;
  background: var(--red-grad);
}

.terminal__body {
  padding: 1.8rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--grey-light);
  min-height: 500px;
}

.terminal__prompt {
  color: var(--term-prompt);
}
.terminal__cmd {
  color: var(--term-cmd);
}
.terminal__out {
  color: var(--term-out);
}
.terminal__out--success {
  background: var(--rust-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.terminal__link {
  color: var(--term-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s;
}
.terminal__link:hover {
  opacity: 0.8;
}
.terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--red);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ── Posts ───────────────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--navy-border);
  align-items: start;
  transition: background 0.2s;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item__date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--grey-dark);
  padding-top: 0.3rem;
}

.post-item__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.post-item:hover .post-item__title {
  color: var(--red);
}

.post-item__excerpt {
  font-size: 0.9rem;
  color: var(--grey);
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--grey-dark);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--grey);
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--red);
}
.breadcrumb span {
  color: var(--grey-dark);
}

/* ── About page ──────────────────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 5rem;
  align-items: start;
}

.avatar-card {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  overflow: hidden;
}

.avatar-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(40%) contrast(1.1);
}

.avatar-card__info {
  padding: 1.4rem;
}

.avatar-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.avatar-card__role {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-h) + 2rem) 0 2rem;
    gap: 2rem;
  }
  .hero__visual {
    display: flex;
    padding: 0 1.5rem;
    order: 1;
  }
  .hero__content {
    padding: 0 1.5rem;
    text-align: center;
    order: 0;
  }
  .hero__visual {
    display: flex;
    padding: 0 1.5rem;
    order: 1;
  }
  .hero__content {
    padding: 0 1.5rem;
    text-align: center;
  }
  .hero__eyebrow {
    justify-content: center;
  }
  .hero__cta {
    justify-content: center;
  }
  .hero__subtitle {
    margin: 0 auto 2rem;
  }
  .hero__stats {
    justify-content: center;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }
  .avatar-card {
    position: static;
    max-width: 280px;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .post-item__date {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 80vw);
    height: 100vh;
    background: var(--navy-deep);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: calc(var(--nav-h) + 2rem) 2rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-out);
    border-left: 1px solid var(--navy-border);
    z-index: 999;
  }

  .nav__links.is-open {
    transform: translateX(0);
  }

  .nav__links li {
    width: 100%;
  }

  .nav__link {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--navy-border);
    font-size: 1.1rem;
  }

  .nav__link::after {
    display: none;
  }

  .container {
    padding: 0 1.25rem;
  }
  .container--narrow {
    padding: 0 1.25rem;
  }
  .section {
    padding: 4rem 0;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 56px;
  }
  h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }
  h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .terminal {
    max-width: 100%;
  }
  .terminal__body {
    font-size: 0.78rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* ── Large screens (1400px+) ───────────────────────────────────── */
@media (min-width: 1400px) {
  :root {
    --max-w: 1400px;
    --max-w-narrow: 900px;
    --nav-h: 80px;
    --scale: 1.15;
  }

  html {
    font-size: 18px;
  }

  h1 {
    font-size: clamp(3rem, 5vw, 5.5rem);
  }
  h2 {
    font-size: clamp(2rem, 3vw, 3.2rem);
  }

  .section {
    padding: 8rem 0;
  }
  .section--sm {
    padding: 5rem 0;
  }

  .project-card {
    padding: 2.8rem;
  }
  .project-card__title {
    font-size: 1.5rem;
  }

  .nav__logo {
    font-size: 1.5rem;
  }
  .nav__links {
    gap: 3rem;
  }
  .nav__link {
    font-size: 0.9rem;
  }
}

/* ── 4K monitors (2000px+) ─────────────────────────────────── */
@media (min-width: 2000px) {
  :root {
    --max-w: 1600px;
    --max-w-narrow: 1000px;
    --nav-h: 90px;
    --scale: 1.25;
  }

  html {
    font-size: 20px;
  }

  h1 {
    font-size: clamp(3.5rem, 4vw, 6rem);
  }
  h2 {
    font-size: clamp(2.2rem, 2.5vw, 3.5rem);
  }
  p {
    font-size: 1.15rem;
  }

  .section {
    padding: 10rem 0;
  }

  .nav__logo {
    font-size: 1.7rem;
  }
  .nav__link {
    font-size: 1rem;
  }

  .project-card {
    padding: 3.2rem;
  }
  .project-card__title {
    font-size: 1.7rem;
  }
  .project-card__desc {
    font-size: 1.05rem;
  }
}

/* ── Animated entrance ───────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.7s var(--ease-out) both;
}

.fade-up--d1 {
  animation-delay: 0.1s;
}
.fade-up--d2 {
  animation-delay: 0.2s;
}
.fade-up--d3 {
  animation-delay: 0.35s;
}
.fade-up--d4 {
  animation-delay: 0.5s;
}

/* ── Horizontal rule ─────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--navy-border);
  margin: 3rem 0;
}

/* ── HiDPI / Retina support ─────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  ::-webkit-scrollbar {
    width: 8px;
  }

  .hero__bg-grid {
    background-size: 30px 30px;
  }
}

/* ── Theming override file ─────────────────────────────── */
/* Define custom theme in static/css/theme.css to override CSS variables */
