/* ============================================================
   Abhishek Thakur — Portfolio 2026 (homepage styles)
   Design tokens first, components, then responsive layers.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/dmmono-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/dmmono-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/inter-800.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/inter-900.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-var.woff2") format("woff2");
}

/* ---------- Icons ---------- */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: none;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Design tokens ---------- */
:root {
  /* brand palette */
  --ink: #111217;
  --muted: #707078;
  --paper: #f5f5f2;
  --line: #d9d9d4;
  --accent: #ff0000;
  --accent-text: #ff0000;      /* AA-safe accent for text on light surfaces */
  --accent-contrast: #1c1103;  /* dark ink used on accent-filled surfaces   */
  --pink: #f1b5c3;
  --surface: #ffffff;
  --soft: #ecece7;
  --copy: #4c4c52;
  --section-copy: #5e5e63;
  --button-bg: #111217;
  --button-text: #fff;

  /* geometry */
  --header-h: 64px;
  --container: 1440px;
  --gutter: clamp(22px, 7vw, 104px);
  --section-y: clamp(76px, 9vw, 128px);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* depth */
  --shadow-1: 0 1px 2px rgba(17, 18, 23, 0.05), 0 2px 10px rgba(17, 18, 23, 0.07);
  --shadow-2: 0 2px 6px rgba(17, 18, 23, 0.06), 0 14px 34px rgba(17, 18, 23, 0.11);
  --shadow-3: 0 6px 16px rgba(17, 18, 23, 0.08), 0 30px 70px rgba(17, 18, 23, 0.16);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swift: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;

  /* layering */
  --z-bottomnav: 30;
  --z-backdrop: 55;
  --z-drawer: 60;
  --z-menu-toggle: 66;
  --z-header: 40;
  --z-skip: 100;

  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #f4f3ef;
  --muted: #aaa9b0;
  --paper: #16171c;
  --line: #35363d;
  --accent: #ff0000;
  --accent-text: #ff0000;
  --accent-contrast: #1c1103;
  --pink: #8d596d;
  --surface: #202127;
  --soft: #202127;
  --copy: #d0cfd5;
  --section-copy: #c0bec8;
  --button-bg: #ff0000;
  --button-text: #111217;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 6px 16px rgba(0, 0, 0, 0.45), 0 30px 70px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
:root[data-theme="dark"] body {
  background: #0c0d10;
}

/* ---------- Reset / base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}
body {
  background: #deded9;
  color: var(--ink);
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
img {
  max-width: 100%;
}
a {
  color: inherit;
}

/* ---------- App shell ---------- */
.app {
  max-width: var(--container);
  margin: auto;
  background: var(--paper);
  /* overflow: clip keeps the shell edge clean without breaking position: sticky */
  overflow: hidden;
  overflow: clip;
  position: relative;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

/* ---------- Reveal animations ---------- */
.js-ready .reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.65s ease,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-ready .reveal-item.is-visible {
  opacity: 1;
  transform: none;
}
.js-ready .reveal-item.reveal-from-left {
  transform: translateX(-32px);
}
.js-ready .reveal-item.reveal-project {
  transform: translateY(32px) scale(0.98);
}
.js-ready .reveal-item.reveal-from-left.is-visible,
.js-ready .reveal-item.reveal-project.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Hero entrance choreography ---------- */
@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@keyframes hero-settle {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes hero-word-rise {
  from {
    transform: translateY(115%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes hero-dot-ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
@keyframes item-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js-ready .hero-status {
  animation: hero-rise 0.7s var(--ease-out) 0.05s both;
}
.js-ready .profile-wrapper {
  animation: hero-settle 0.9s var(--ease-out) 0.15s both;
}
.js-ready .hero-word {
  display: inline-block;
  animation: hero-word-rise 0.75s var(--ease-out) 0.18s both;
}
.js-ready .hero h1 .hero-word-mask:nth-child(2) .hero-word {
  animation-delay: 0.3s;
}
.js-ready .hero h2 {
  animation: hero-rise 0.7s var(--ease-out) 0.44s both;
}
.js-ready .hero .social-links {
  animation: hero-rise 0.8s var(--ease-out) 0.52s both;
}
.js-ready .social-links a {
  animation: item-pop 0.55s var(--ease-out) both;
}
.js-ready .social-links a:nth-child(1) {
  animation-delay: 0.58s;
}
.js-ready .social-links a:nth-child(2) {
  animation-delay: 0.66s;
}
.js-ready .social-links a:nth-child(3) {
  animation-delay: 0.74s;
}
.js-ready .hero .intro {
  animation: hero-rise 0.8s var(--ease-out) 0.58s both;
}
.js-ready .hero-actions {
  animation: hero-rise 0.75s var(--ease-out) 0.7s both;
}
.js-ready .trait-chip {
  animation: item-pop 0.55s var(--ease-out) both;
}
.js-ready .trait-chip:nth-child(1) {
  animation-delay: 0.82s;
}
.js-ready .trait-chip:nth-child(2) {
  animation-delay: 0.89s;
}
.js-ready .trait-chip:nth-child(3) {
  animation-delay: 0.96s;
}
.js-ready .trait-chip:nth-child(4) {
  animation-delay: 1.03s;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-skip);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font:
    12px "DM Mono",
    monospace;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
}

/* ============================================================
   Header — hamburger + floating controls below desktop;
   real top navigation bar on desktop (>= 1024px).
   The wrapper is `display: contents` so the absolutely
   positioned mobile controls keep working unchanged.
   ============================================================ */
.site-header {
  display: contents;
}

.brand-logo {
  position: absolute;
  top: 28px;
  left: clamp(24px, 5vw, 75px);
  width: 76px;
  height: 50px;
  display: block;
  z-index: 2;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* the wordmark is drawn in dark ink; lift it on dark surfaces */
:root[data-theme="dark"] .brand-logo img {
  filter: invert(0.96);
}

.theme-toggle {
  position: absolute;
  top: 26px;
  right: calc(clamp(24px, 5vw, 75px) + 52px);
  z-index: 20;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  transition:
    background 0.2s,
    color 0.2s,
    translate 0.2s var(--ease-out),
    border-color 0.2s;
}
.theme-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  translate: 0 -2px;
}

.menu-toggle {
  position: absolute;
  top: 26px;
  right: clamp(24px, 5vw, 75px);
  z-index: var(--z-menu-toggle);
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.2s ease;
  transform-origin: center;
}
.menu-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.menu-toggle:hover span {
  background: var(--accent-contrast);
}
.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ---------- Top navigation (desktop only) ---------- */
.top-nav {
  display: none;
}

/* the CTA rides in the desktop nav bar only; mobile keeps the drawer */
.top-nav-cta {
  display: none;
}
/* below 1024 the header is display:contents — mirror that wrapper */
.header-right {
  display: contents;
}

/* ---------- Menu backdrop + drawer (phone / tablet) ---------- */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(12, 13, 16, 0.68);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
}
.menu-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body.menu-open {
  overflow: hidden;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: var(--z-drawer);
  width: min(86vw, 360px);
  padding: 88px 20px 24px;
  border-left: 1px solid var(--line);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  background: linear-gradient(180deg, var(--surface) 0%, var(--paper) 78%);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  transform: translateX(calc(100% + 24px));
  visibility: hidden;
  transition:
    transform 0.48s var(--ease-out),
    visibility 0s linear 0.48s;
}
.menu-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}
.menu-drawer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 140px;
  background: radial-gradient(320px 130px at 88% 0%, rgba(255, 92, 0, 0.16), transparent 70%);
  pointer-events: none;
}
:root[data-theme="dark"] .menu-drawer::before {
  background: radial-gradient(320px 130px at 88% 0%, rgba(169, 155, 255, 0.14), transparent 70%);
}

.menu-drawer-header {
  padding: 12px 4px 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.menu-drawer-kicker {
  color: var(--accent-text);
  font:
    10px "DM Mono",
    monospace;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.menu-drawer-links {
  display: grid;
  gap: 9px;
  position: relative;
}
.menu-drawer-link {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity 0.35s ease,
    transform 0.5s var(--ease-out),
    border-color 0.25s,
    background 0.25s,
    padding-left 0.25s;
}
.menu-drawer-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 92, 0, 0.14), transparent 62%);
  opacity: 0;
  transition: opacity 0.3s;
}
:root[data-theme="dark"] .menu-drawer-link::before {
  background: linear-gradient(120deg, rgba(169, 155, 255, 0.14), transparent 62%);
}
.menu-drawer-link > * {
  position: relative;
  z-index: 1;
}
.menu-drawer.is-open .menu-drawer-link {
  opacity: 1;
  transform: none;
}
.menu-drawer.is-open .menu-drawer-link:nth-child(1) {
  transition-delay: 0.08s;
}
.menu-drawer.is-open .menu-drawer-link:nth-child(2) {
  transition-delay: 0.14s;
}
.menu-drawer.is-open .menu-drawer-link:nth-child(3) {
  transition-delay: 0.2s;
}
.menu-drawer.is-open .menu-drawer-link:nth-child(4) {
  transition-delay: 0.26s;
}
.menu-drawer:not(.is-open) .menu-drawer-link {
  transition-delay: 0s;
}
.menu-drawer-link:hover {
  border-color: var(--accent-text);
  padding-left: 16px;
}
.menu-drawer-link:hover::before {
  opacity: 1;
}
.menu-drawer-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
  font:
    10px "DM Mono",
    monospace;
}
.menu-drawer-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.menu-drawer-copy strong {
  font:
    600 14px/1.15 "Space Grotesk",
    Inter,
    sans-serif;
  letter-spacing: -0.2px;
  transition: color 0.25s;
}
.menu-drawer-link:hover .menu-drawer-copy strong {
  color: var(--accent-text);
}
.menu-drawer-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.menu-drawer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  transition:
    translate 0.25s var(--ease-out),
    color 0.25s,
    background 0.25s,
    border-color 0.25s;
}
.menu-drawer-link:hover .menu-drawer-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  translate: 2px -2px;
}

.menu-drawer-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--soft), var(--surface));
}
.menu-drawer-footnote {
  color: var(--copy);
  font-size: 11.5px;
  line-height: 1.5;
}
.menu-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font:
    600 10.5px "DM Mono",
    monospace;
  letter-spacing: 0.6px;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    translate 0.25s var(--ease-out),
    background 0.25s,
    color 0.25s;
}
.menu-drawer-cta:hover {
  translate: 0 -1px;
  background: var(--accent);
  color: var(--accent-contrast);
}
.menu-drawer-cta svg {
  width: 28px;
  height: 28px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh;
  padding: clamp(96px, 12vw, 150px) var(--gutter) clamp(48px, 6vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(44px, 7vw, 120px);
  align-items: center;
  position: relative;
}

.hero-media {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.profile-wrapper {
  width: min(100%, 340px);
  aspect-ratio: 1;
  position: relative;
}
.profile-wrapper::before {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(255, 92, 0, 0.14),
    transparent 74%
  );
  pointer-events: none;
}
:root[data-theme="dark"] .profile-wrapper::before {
  background: radial-gradient(
    closest-side,
    rgba(169, 155, 255, 0.12),
    transparent 74%
  );
}
.profile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transition: box-shadow 0.3s ease;
}

/* hero copy */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--copy);
  font:
    11px/1 "DM Mono",
    monospace;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.22);
  flex: none;
}
.hero-status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: hero-dot-ping 2.4s ease-out 1.4s infinite;
  pointer-events: none;
}
:root[data-theme="dark"] .hero-status-dot {
  box-shadow: 0 0 0 3px rgba(169, 155, 255, 0.25);
}

.hero-body {
  /* container for hero headline sizing */
  container-type: inline-size;
}

.hero h1 {
  /* single-line name: falls back viewport-based, refined by container width */
  font-size: clamp(34px, 5.2vw, 76px);
  font-size: clamp(28px, min(5.2vw, 11.3cqw), 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
  white-space: nowrap;
  text-wrap: balance;
  margin-bottom: 18px;
}
.hero h1 .hero-word-mask {
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  /* keep descenders/ascenders inside the clip while masking */
  padding: 0.06em 0.08em 0.04em;
  margin: -0.06em -0.08em -0.04em;
}
.hero .hero-word {
  display: inline-block;
  will-change: transform;
}
.hero h2 {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(17px, 1.9vw, 23px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  text-wrap: balance;
}
.hero-stack {
  color: var(--accent-text);
  font-size: 0.78em;
  letter-spacing: 0.02em;
}

.hero-copy-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 560px;
  margin-top: 10px;
}
.intro {
  max-width: 500px;
  color: var(--section-copy);
  line-height: 1.75;
  font-size: 15.5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font:
    600 13px Inter,
    sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    translate 0.2s var(--ease-out),
    box-shadow 0.25s;
}
.btn .icon {
  font-size: 15px;
  transition: translate 0.3s var(--ease-out);
}
.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--button-bg);
  color: var(--button-text);
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -62%;
  width: 40%;
  transform: skewX(-18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.32),
    transparent
  );
  pointer-events: none;
}
.btn-primary:hover::after {
  animation: btn-sheen 0.75s var(--ease-out);
}
@keyframes btn-sheen {
  to {
    left: 132%;
  }
}
.btn-primary:hover .icon {
  translate: 2px -2px;
}
.btn-ghost:hover .icon {
  translate: 0 2px;
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  translate: 0 -2px;
  box-shadow: var(--shadow-2);
}
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
  translate: 0 -2px;
}

.hero-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  color: var(--muted);
  font:
    11px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--copy);
  cursor: default;
  transition:
    translate 0.25s var(--ease-out),
    border-color 0.25s ease,
    color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}
.trait-chip .icon {
  font-size: 13px;
  color: var(--accent-text);
}
.trait-chip:hover {
  translate: 0 -3px;
  border-color: var(--accent-text);
  color: var(--accent-text);
  box-shadow: var(--shadow-1);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.social-links a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s,
    translate 0.2s var(--ease-out);
}
.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  translate: 0 -3px;
}

/* ============================================================
   Marquee band
   ============================================================ */
.developer-section {
  min-height: 190px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.marquee {
  width: 100%;
  overflow: hidden;
}
.marquee-track {
  width: max-content;
  display: flex;
  align-items: center;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.marquee-track span {
  flex: none;
  padding-right: clamp(40px, 6vw, 100px);
  font-size: clamp(66px, 11vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee-track span:nth-child(even) {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Content sections
   ============================================================ */
.content-section {
  padding: var(--section-y) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.section-label {
  margin-bottom: 24px;
  color: var(--accent-text);
  font:
    11px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.content-section h2 {
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 900;
  text-wrap: balance;
  margin-bottom: 22px;
}
.content-section h2 em {
  color: var(--accent-text);
  font-style: normal;
}
.content-section > p {
  max-width: 590px;
  color: var(--section-copy);
  line-height: 1.8;
  font-size: 15px;
}

/* ---------- About ---------- */
.about-stats {
  display: flex;
  gap: clamp(30px, 6vw, 88px);
  margin-top: 52px;
}
.about-stats div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-stats strong {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.about-stats span {
  color: var(--muted);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---------- Capabilities ---------- */
.capabilities-section {
  background: var(--soft);
}
.technology-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  margin-top: 52px;
  border: 1px solid var(--line);
}
.technology-group {
  background: var(--paper);
  min-height: 224px;
  padding: 26px;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    translate 0.25s var(--ease-out);
}
.technology-group:hover {
  translate: 0 -5px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.technology-group > span,
.experience-item > div > span,
.education-row span {
  color: var(--accent-text);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.technology-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 26px;
}
.technology-icons img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.technology-group h3 {
  margin-top: 22px;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Services ---------- */
.services-section {
  background: var(--paper);
}
.services-intro {
  max-width: 650px;
}
.services-context {
  margin-top: 14px;
  font-size: 13px !important;
  color: var(--copy);
}
.services-context a {
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.2s;
}
.services-context a:hover {
  color: var(--accent);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 52px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service-card {
  min-height: 250px;
  padding: 30px 30px 28px;
  background: var(--surface);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    translate 0.25s var(--ease-out);
}
.service-card:hover {
  position: relative;
  z-index: 1;
  translate: 0 -5px;
  background: var(--paper);
  box-shadow: var(--shadow-2);
}
.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--accent-text);
  font-size: 16px;
}
.service-card h3 {
  max-width: 350px;
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.service-card p {
  max-width: 420px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.service-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font:
    9px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.service-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--ink);
  font:
    600 10.5px "DM Mono",
    monospace;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.service-more .icon {
  font-size: 12px;
  transition: translate 0.2s var(--ease-out);
}
.service-more:hover {
  color: var(--accent-text);
}
.service-more:hover .icon {
  translate: 2px -2px;
}

/* Services CTA band */
.services-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin-top: 52px;
  padding: clamp(30px, 4vw, 46px);
  background: var(--ink);
  color: var(--paper);
}
.services-cta .section-label {
  display: block;
  margin-bottom: 14px;
}
.services-cta h3 {
  font-size: clamp(25px, 2.8vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.services-cta h3 em {
  color: var(--accent);
  font-style: normal;
}
.services-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: none;
}
.service-cta-primary,
.service-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  font:
    600 10.5px "DM Mono",
    monospace;
  letter-spacing: 0.6px;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    translate 0.2s var(--ease-out),
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.service-cta-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.service-cta-primary:hover {
  background: var(--accent);
  translate: 0 -2px;
  box-shadow: 0 10px 26px rgba(255, 92, 0, 0.28);
}
:root[data-theme="dark"] .service-cta-primary:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.service-cta-secondary {
  border: 1px solid color-mix(in srgb, var(--paper) 40%, transparent);
  color: var(--paper);
}
.service-cta-secondary:hover {
  translate: 0 -2px;
  background: var(--paper);
  color: var(--ink);
}
.service-cta-primary .icon,
.service-cta-secondary .icon {
  font-size: 13px;
}

/* ---------- Experience / education ---------- */
.experience-section {
  background: var(--surface);
}
.experience-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding: 32px 0;
  border-top: 1px solid var(--line);
  transition:
    padding-left 0.25s var(--ease-out),
    border-color 0.25s;
}
.experience-item:hover {
  padding-left: 14px;
  border-color: var(--accent-text);
}
.experience-item h3 {
  margin-top: 12px;
  font-size: clamp(21px, 2vw, 25px);
  letter-spacing: -0.02em;
}
.experience-item p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.experience-item > p {
  max-width: 480px;
  align-self: start;
}
.education-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: 32px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  transition:
    padding-left 0.25s var(--ease-out),
    border-color 0.25s;
}
.education-row:hover {
  padding-left: 14px;
  border-color: var(--accent-text);
}
.education-row strong {
  display: block;
  margin-top: 14px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.education-row p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.education-row p b {
  color: var(--ink);
  font-weight: 600;
}
.education-row small {
  display: inline-block;
  max-width: 480px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Projects ---------- */
.projects-section {
  background: var(--surface);
}
.projects-section > h2 {
  color: var(--accent-text);
}
.projects-heading-word {
  color: var(--ink);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1140px;
}
.project-card {
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  transition:
    box-shadow 0.3s ease,
    translate 0.3s var(--ease-out),
    border-color 0.3s ease;
}
.project-card:hover {
  translate: 0 -7px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow-2);
}
.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  transition: filter 0.35s;
}
.project-card:hover img {
  filter: saturate(1.08) contrast(1.03);
}
.project-card > div:not(.project-visual) {
  padding: 24px 26px 28px;
  position: relative;
}
.project-card > div:not(.project-visual) > span,
.more-projects-grid article > span {
  color: var(--accent-text);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.project-card h3 {
  margin: 12px 0 7px;
  font-size: 25px;
  letter-spacing: -0.02em;
}
.project-card h4 {
  margin-bottom: 12px;
  color: var(--copy);
  font-size: 12.5px;
  font-weight: 600;
}
.project-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 440px;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding: 0 !important;
}
.project-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font:
    9px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 0 !important;
}
.project-links a,
.private-repository {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font:
    10.5px "DM Mono",
    monospace;
  letter-spacing: 0.4px;
  text-decoration: none;
  text-transform: uppercase;
}
.project-links a .icon {
  font-size: 13px;
  transition: translate 0.2s var(--ease-out);
}
.project-links a:hover {
  color: var(--accent-text);
}
.project-links a:hover .icon {
  translate: 2px -2px;
}
.private-repository {
  color: var(--muted);
}

.featured-project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.featured-project img {
  height: 100%;
  min-height: 260px;
}

/* ---------- More projects ---------- */
.more-projects {
  margin-top: 76px;
}
.more-projects-toggle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font:
    600 17px Inter,
    sans-serif;
  text-align: center;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.more-projects-toggle span {
  grid-column: 2;
}
.more-projects-toggle svg {
  color: var(--accent-text);
  font-size: 15px;
}
.more-projects-toggle:hover {
  border-color: var(--accent-text);
}
.more-projects-toggle:hover span {
  color: var(--accent-text);
}

.more-projects-content {
  padding-top: 30px;
}
.more-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.more-projects-grid article,
.more-project-button {
  min-height: 200px;
  padding: 30px 55px 30px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
}
.more-projects-grid article {
  transition:
    background 0.3s ease,
    padding-left 0.3s ease,
    border-color 0.3s ease;
}
.more-projects-grid article:hover {
  background: var(--soft);
  padding-left: 14px;
  border-color: var(--accent-text);
}
.more-projects-grid article:hover h3 {
  color: var(--accent-text);
}
.more-projects-grid article:nth-child(odd),
.more-project-button:nth-child(odd) {
  padding-right: 45px;
  border-right: 1px solid var(--line);
}
.more-projects-grid article:nth-child(even),
.more-project-button:nth-child(even) {
  padding-left: 45px;
}
.more-projects-grid h3 {
  margin: 12px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
  transition: color 0.25s;
}
.more-projects-grid p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.more-project-button {
  width: 100%;
  cursor: pointer;
  transition:
    background 0.25s ease,
    padding-left 0.25s ease;
}
.more-project-button:hover {
  background: var(--soft);
  padding-left: 14px;
}
.more-project-button:hover h3 {
  color: var(--accent-text);
}
.more-project-button > span {
  color: var(--accent-text);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.more-projects-grid a {
  position: absolute;
  top: 32px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.more-projects-grid a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.more-project-button > svg {
  position: absolute;
  top: 34px;
  right: 20px;
  color: var(--accent-text);
  font-size: 15px;
  opacity: 0;
  transition:
    opacity 0.2s,
    translate 0.2s var(--ease-out);
}
.more-project-button:hover > svg,
.more-project-button:focus-visible > svg {
  opacity: 1;
  translate: 2px -2px;
}

/* ---------- Project modal ---------- */
.projects-modal {
  width: min(920px, calc(100% - 32px));
  max-height: min(840px, calc(100vh - 40px));
  padding: clamp(24px, 4vw, 42px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  opacity: 1;
}
.projects-modal[open] {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 0.3s ease,
    translate 0.34s var(--ease-out),
    overlay 0.34s ease allow-discrete,
    display 0.34s ease allow-discrete;
}
@starting-style {
  .projects-modal[open] {
    opacity: 0;
    translate: 0 16px;
  }
}
.projects-modal::backdrop {
  background: rgba(9, 10, 13, 0.8);
  backdrop-filter: blur(5px);
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.modal-header .section-label {
  display: block;
  margin-bottom: 12px;
}
.modal-header h2 {
  font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: -0.025em;
  font-weight: 900;
}
.modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition:
    rotate 0.25s var(--ease-out),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.modal-close:hover {
  rotate: 90deg;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.modal-project {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.modal-project img {
  width: 100%;
  height: clamp(180px, 26vw, 340px);
  display: block;
  object-fit: contain;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.modal-project > div {
  padding: 22px 24px 26px;
}
.modal-project > div > span {
  color: var(--accent-text);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-project h3 {
  margin: 10px 0 4px;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.modal-project h4 {
  margin: 0 0 12px;
  color: var(--copy);
  font-size: 12.5px;
}
.modal-project p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.modal-project .project-tags {
  margin-top: 18px;
}
.modal-project a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--ink);
  font:
    600 11px "DM Mono",
    monospace;
  letter-spacing: 0.4px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.modal-project a:hover {
  color: var(--accent-text);
}

/* ---------- Experiments callout ---------- */
.experiments-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  margin-top: 72px;
  padding: clamp(30px, 4vw, 48px);
  background: var(--ink);
  color: var(--paper);
}
.experiments-callout span {
  color: var(--accent);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.experiments-callout h3 {
  margin-top: 14px;
  font-size: clamp(25px, 2.8vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.experiments-callout p {
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  font-size: 13.5px;
  line-height: 1.7;
}
.experiments-callout a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: var(--paper);
  font:
    600 10.5px "DM Mono",
    monospace;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.experiments-callout a .icon {
  font-size: 13px;
  transition: translate 0.2s var(--ease-out);
}
.experiments-callout a:hover {
  color: var(--accent);
}
.experiments-callout a:hover .icon {
  translate: 2px -2px;
}

/* ---------- Contact ---------- */
.contact-section {
  background: var(--accent);
  color: var(--accent-contrast);
  border: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(400px, 1.2fr);
  align-items: start;
  gap: clamp(44px, 7vw, 110px);
}
.contact-copy .section-label {
  color: var(--accent-contrast);
  opacity: 0.75;
}
.contact-copy h2 {
  font-weight: 900;
}
.contact-copy h2 em {
  color: var(--accent-contrast);
  opacity: 0.85;
}
.contact-copy > p {
  max-width: 470px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--accent-contrast);
  opacity: 0.85;
}
.contact-link {
  color: var(--accent-contrast);
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-top: 32px;
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-contrast) 40%, transparent);
  font:
    14px "DM Mono",
    monospace;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, translate 0.2s var(--ease-out);
}
.contact-link .icon {
  font-size: 15px;
  transition: translate 0.2s var(--ease-out);
}
.contact-link:hover {
  border-color: var(--accent-contrast);
}
.contact-link:hover .icon {
  translate: 3px -3px;
}

.contact-form {
  width: 100%;
  max-width: 760px;
  margin-top: 42px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.contact-form label {
  display: block;
  margin-bottom: 18px;
}
.contact-form label span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-contrast);
  opacity: 0.8;
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent-contrast) 38%, transparent);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent-contrast);
  font:
    13.5px Inter,
    sans-serif;
  outline: none;
  resize: vertical;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: color-mix(in srgb, var(--accent-contrast) 55%, transparent);
}
.contact-form input:hover,
.contact-form textarea:hover {
  background: rgba(255, 255, 255, 0.28);
}
.contact-form input:focus,
.contact-form textarea:focus {
  background: rgba(255, 255, 255, 0.34);
  border-color: var(--accent-contrast);
  box-shadow: 0 0 0 3px rgba(28, 17, 3, 0.12);
}
.form-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  background: var(--accent-contrast);
  color: #ffffff;
  font:
    600 12.5px Inter,
    sans-serif;
  cursor: pointer;
  transition:
    translate 0.2s var(--ease-out),
    background 0.2s,
    box-shadow 0.25s;
}
.form-submit:hover {
  translate: 0 -2px;
  box-shadow: var(--shadow-2);
}
.form-submit .icon {
  font-size: 14px;
}
.form-status {
  color: var(--accent-contrast);
  font:
    11px "DM Mono",
    monospace;
  letter-spacing: 0.3px;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 30px var(--gutter) 44px;
  background: var(--surface);
  color: var(--muted);
  font:
    10.5px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  transition:
    color 0.2s ease,
    translate 0.2s ease;
}
.site-footer a:hover {
  color: var(--accent-text);
  translate: 0 -2px;
}
.site-footer .icon {
  font-size: 12px;
}

/* ---------- Floating bottom navigation (phone / tablet) ---------- */
.bottom-nav {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  width: min(420px, calc(100% - 32px));
  height: 58px;
  padding: 6px 10px;
  background: rgba(11, 12, 15, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-bottomnav);
  box-shadow: 0 12px 34px rgba(5, 6, 9, 0.35);
}
.nav-item {
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    scale 0.2s var(--ease-out);
}
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  scale: 1.06;
}
.nav-item.active {
  background: var(--accent);
  color: var(--accent-contrast);
}
.nav-item.active:hover {
  color: var(--accent-contrast);
}

/* ---------- Focus visibility ---------- */
.theme-toggle:focus-visible,
.menu-toggle:focus-visible,
.menu-drawer a:focus-visible,
.top-nav a:focus-visible,
.nav-item:focus-visible,
.btn:focus-visible,
.service-more:focus-visible,
.social-links a:focus-visible,
.project-card a:focus-visible,
.project-links a:focus-visible,
.more-projects-toggle:focus-visible,
.more-project-button:focus-visible,
.more-projects-grid a:focus-visible,
.modal-close:focus-visible,
.projects-modal a:focus-visible,
.contact-link:focus-visible,
.contact-form button:focus-visible,
.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.form-submit:focus-visible,
.site-footer a:focus-visible,
.experiments-callout a:focus-visible,
.service-cta-primary:focus-visible,
.service-cta-secondary:focus-visible,
.brand-logo:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   Responsive layers
   ============================================================ */

/* Ultra-narrow phones */
@media (max-width: 430px) {
  .hero {
    padding-inline: 20px;
  }
  .content-section {
    padding-inline: 22px;
  }
  .bottom-nav {
    width: calc(100% - 24px);
  }
}

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  body {
    background: var(--paper);
  }
  .app {
    max-width: none;
  }
  .hero {
    min-height: 0;
    display: block;
    text-align: center;
    padding: 96px 22px 44px;
  }
  .theme-toggle {
    top: 22px;
    right: 70px;
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .menu-toggle {
    top: 22px;
    right: 18px;
    width: 36px;
    height: 36px;
  }
  .menu-drawer {
    padding: 80px 16px 18px;
  }
  .menu-drawer-link {
    grid-template-columns: 24px minmax(0, 1fr) 26px;
    gap: 8px;
    padding: 11px;
    border-radius: var(--radius-md);
  }
  .menu-drawer-copy strong {
    font-size: 13.5px;
  }
  .menu-drawer-number {
    width: 24px;
    height: 24px;
  }
  .menu-drawer-arrow {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .menu-drawer-cta {
    font-size: 9.5px;
    letter-spacing: 0.5px;
    padding-left: 14px;
  }
  .menu-drawer-cta svg {
    width: 26px;
    height: 26px;
    padding: 7px;
  }
  .brand-logo {
    top: 18px;
    left: 20px;
    width: 66px;
    height: 44px;
  }
  .hero-media {
    gap: 22px;
  }
  .profile-wrapper {
    width: 186px;
  }
  .hero h1 {
    font-size: clamp(28px, 8.8vw, 34px);
    font-size: clamp(24px, min(8.8vw, 11.3cqw), 34px);
  }
  .hero h2 {
    font-size: 15.5px;
  }
  .hero-status {
    margin-bottom: 18px;
  }
  .hero-copy-stack {
    align-items: center;
  }
  .intro {
    font-size: 14px;
    line-height: 1.7;
    margin-inline: auto;
    max-width: 420px;
  }
  .social-links {
    justify-content: center;
  }
  .hero-traits {
    justify-content: center;
    max-width: none;
  }
  .hero-actions,
  .hero-copy-stack .btn {
    justify-content: center;
    width: 100%;
  }
  .hero-actions {
    flex-direction: column;
  }
  .developer-section {
    min-height: 148px;
  }
  .marquee-track span {
    font-size: 58px;
  }
  .content-section {
    padding: 68px 24px;
  }
  .content-section h2 {
    font-size: clamp(32px, 9vw, 40px);
  }
  .about-stats {
    gap: 26px;
    margin-top: 40px;
  }
  .about-stats strong {
    font-size: 27px;
  }
  .about-stats span {
    font-size: 9px;
  }
  .technology-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 40px;
  }
  .technology-group {
    min-height: 180px;
    padding: 20px;
  }
  .technology-icons {
    gap: 7px;
    margin-top: 20px;
  }
  .technology-icons img {
    width: 30px;
    height: 30px;
  }
  .technology-group h3 {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.5;
  }
  .services-grid {
    grid-template-columns: 1fr;
    margin-top: 40px;
    border-left: 0;
    border-right: 0;
  }
  .service-card {
    min-height: 0;
    padding: 24px 22px;
  }
  .service-icon {
    margin-bottom: 18px;
  }
  .services-cta {
    display: block;
    margin-top: 44px;
    padding: 30px 24px;
  }
  .services-cta-actions {
    margin-top: 26px;
  }
  .experience-item,
  .education-row {
    display: block;
    padding: 26px 0;
  }
  .experience-item > p {
    margin-top: 20px;
  }
  .education-row strong {
    display: block;
    margin-top: 12px;
  }
  .project-grid {
    display: block;
    max-width: none;
  }
  .project-card {
    margin-top: 18px;
  }
  .featured-project {
    display: block;
  }
  .featured-project img {
    min-height: 0;
  }
  .project-card img {
    aspect-ratio: auto;
    height: 190px;
  }
  .project-card > div:not(.project-visual) {
    padding: 20px 20px 22px;
  }
  .more-projects {
    margin-top: 58px;
  }
  .more-projects-grid {
    grid-template-columns: 1fr;
    border-top: 0;
  }
  .more-projects-grid article,
  .more-project-button {
    min-height: 0;
    padding: 22px 0 22px 0;
    border-right: 0;
  }
  .more-projects-grid article:hover {
    padding-left: 12px;
  }
  .more-project-button:hover {
    padding-left: 12px;
  }
  .experiments-callout {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-top: 58px;
    padding: 30px 24px;
  }
  .contact-section {
    display: block;
    padding-bottom: 110px;
  }
  .site-footer {
    padding: 24px 24px 104px;
    flex-wrap: wrap;
  }
  .bottom-nav {
    width: min(400px, calc(100% - 24px));
  }
}

/* Wider phones (between 431 and 700px): use the extra room */
@media (min-width: 431px) and (max-width: 700px) {
  .app {
    max-width: 600px;
  }
  .hero {
    padding-inline: 44px;
  }
  .content-section {
    padding-inline: 44px;
  }
  .technology-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .services-grid {
    border-inline: 1px solid var(--line);
  }
  .project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .project-card {
    margin-top: 0;
  }
  .featured-project {
    display: block;
    grid-column: span 2;
  }
  .featured-project img {
    height: 190px;
  }
  .bottom-nav {
    width: min(400px, calc(100% - 48px));
  }
  .site-footer {
    justify-content: center;
  }
}

/* ---------- Tablets (portrait / small landscape) ---------- */
@media (min-width: 701px) and (max-width: 1023px) {
  .theme-toggle {
    top: 24px;
    right: 40px;
  }
  .menu-toggle {
    top: 24px;
    right: 92px;
  }
  .menu-drawer {
    width: min(60vw, 420px);
  }
  .brand-logo {
    top: 24px;
    left: 40px;
  }
  .hero {
    min-height: clamp(640px, calc(100vh - 40px), 780px);
    padding: 56px 44px 48px;
    gap: clamp(32px, 5vw, 64px);
  }
  .profile-wrapper {
    width: min(30vw, 300px);
  }
  .hero h2 {
    font-size: 18px;
  }
  .intro {
    max-width: 100%;
  }
  .content-section {
    padding: 76px 44px;
  }
  .technology-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 44px;
  }
  .technology-group {
    min-height: 200px;
  }
  .services-grid {
    grid-template-columns: 1fr;
    border-inline: 0;
  }
  .service-card {
    border-bottom: 1px solid var(--line);
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .featured-project {
    display: block;
  }
  .experience-item,
  .education-row {
    gap: 30px;
  }
  .site-footer {
    padding: 26px 44px 104px;
  }
  .bottom-nav {
    width: 360px;
  }
  .contact-section {
    display: block;
  }
  .contact-form {
    max-width: 680px;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  /* hide the mobile chrome entirely */
  .menu-toggle,
  .menu-drawer,
  .menu-backdrop,
  .bottom-nav {
    display: none;
  }

  /* real navigation bar — 3 zones: brand | centered links | actions */
  .site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    height: var(--header-h);
    padding-inline: clamp(28px, 4vw, 52px);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition:
      background 0.25s ease,
      border-color 0.25s ease,
      box-shadow 0.25s ease;
  }
  .site-header.is-scrolled {
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border-bottom-color: var(--line);
    box-shadow: var(--shadow-1);
  }
  .brand-logo {
    position: static;
    display: flex;
    align-items: center;
    align-self: center;
    justify-self: start;
    width: auto;
    height: 40px;
    margin-inline-end: 8px;
  }
  .brand-logo img {
    width: auto;
    height: 100%;
  }

  .top-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    justify-self: center;
  }
  .header-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
  }
  .top-nav-link {
    position: relative;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    color: var(--copy);
    font:
      500 13.5px Inter,
      sans-serif;
    text-decoration: none;
    transition:
      color 0.2s,
      background 0.2s;
  }
  .top-nav-link::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 5px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
  }
  .top-nav-link:hover {
    color: var(--ink);
  }
  .top-nav-link:hover::after {
    transform: scaleX(1);
  }
  .top-nav-link.active {
    color: var(--accent-text);
  }
  .top-nav-link.active::after {
    transform: scaleX(1);
  }
  .top-nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-text);
    font:
      600 12.5px Inter,
      sans-serif;
    text-decoration: none;
    transition:
      background 0.2s,
      color 0.2s,
      translate 0.2s var(--ease-out),
      box-shadow 0.25s;
  }
  .top-nav-cta:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    translate: 0 -1px;
    box-shadow: var(--shadow-2);
  }
  .top-nav-cta.active {
    background: var(--accent);
    color: var(--accent-contrast);
  }

  .theme-toggle {
    position: relative;
    top: auto;
    right: auto;
  }

  /* keep anchors clear of the sticky bar */
  [id] {
    scroll-margin-top: calc(var(--header-h) + 14px);
  }

  /* hero composition */
  .hero {
    min-height: calc(100svh - var(--header-h));
    padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(56px, 7vw, 96px);
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }
  .hero-media {
    gap: 30px;
  }
  .profile-wrapper {
    width: min(32vw, 380px);
  }

  /* desktop grids */
  .content-section > *,
  .hero > * {
    min-width: 0;
  }
  .project-grid {
    max-width: 1200px;
  }
  .site-footer {
    padding-bottom: 44px;
  }

  /* contact split */
  .contact-form {
    margin-top: 0;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-ready .reveal-item,
  .js-ready .reveal-item.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js-ready .reveal-item.reveal-from-left,
  .js-ready .reveal-item.reveal-project {
    transform: none;
  }
  /* entrance choreography: no delays, no blur, content instantly visible */
  .js-ready .hero-status,
  .js-ready .profile-wrapper,
  .js-ready .hero-word,
  .js-ready .hero h2,
  .js-ready .hero .social-links,
  .js-ready .social-links a,
  .js-ready .hero .intro,
  .js-ready .hero-actions,
  .js-ready .trait-chip {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .hero-status-dot::after {
    animation: none;
  }
  .menu-drawer,
  .menu-drawer .menu-drawer-link {
    transition: none;
    transform: none;
  }
  .menu-drawer:not(.is-open) {
    visibility: hidden;
  }
  .project-card:hover,
  .technology-group:hover,
  .service-card:hover,
  .btn:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .top-nav-cta:hover,
  .trait-chip:hover,
  .theme-toggle:hover,
  .menu-drawer-cta:hover,
  .menu-drawer-link:hover .menu-drawer-arrow,
  .social-links a:hover,
  .form-submit:hover,
  .service-card:hover,
  .service-cta-primary:hover,
  .service-cta-secondary:hover,
  .projects-modal:not([open]),
  .modal-close:hover {
    translate: none;
    transform: none;
  }
  .top-nav-link::after {
    transition: none;
  }
  .projects-modal,
  .projects-modal[open] {
    opacity: 1;
    translate: none;
  }
}
