/* THE LOOKS. Sections are in the same order as the page, top to bottom. */


/* ---------- COLORS & FONTS ----------
   Change a value here and it changes everywhere it's used. */
:root {
  --bg: #08070d;
  --surface: rgba(255, 255, 255, 0.04);         /* card background */
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(207, 181, 255, 0.4);
  --text: #f6f4fb;
  --text-dim: #a29fb4;                          /* greyer text */
  --accent: #cfb5ff;                            /* the lavender */
  --accent-rgb: 207, 181, 255;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;   /* the pretty italic font */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ---------- PAGE BASICS ---------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

html {
  scrollbar-gutter: stable;   /* no layout shift when the intro releases the scroll lock */
  scroll-behavior: smooth;
  scroll-padding-top: 100px;   /* so the top bar doesn't cover headings when you click a link */
}

/* Lenis smooth scrolling rules */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dedicated hardware-accelerated background layer: eliminates full-screen repaints during scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(46% 38% at 8% 4%, rgba(255, 255, 255, 0.13), transparent 72%),
    radial-gradient(42% 40% at 96% 18%, rgba(176, 146, 255, 0.2), transparent 72%),
    radial-gradient(55% 45% at 50% 108%, rgba(207, 181, 255, 0.17), transparent 70%),
    radial-gradient(30% 28% at 78% 62%, rgba(255, 255, 255, 0.06), transparent 72%),
    radial-gradient(34% 30% at 4% 72%, rgba(120, 90, 220, 0.2), transparent 72%),
    linear-gradient(180deg, #14101f 0%, #0b0911 42%, #08070d 100%);
  transform: translateZ(0);
  will-change: transform;
  contain: strict;
}

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

/* Italic words (<em>) use the serif font and the purple */
em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}


/* ---------- QUICK PAGE INTRO (Cinematic Apple Glass Aperture) ---------- */
html.intro-active,
html.intro-active body {
  overflow: hidden !important;
}

.page-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(65% 55% at 50% 50%, rgba(207, 181, 255, 0.12) 0%, transparent 70%),
    #08070d;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  transition: transform 0.75s cubic-bezier(0.76, 0, 0.24, 1),
              opacity 0.5s ease;
  will-change: transform;
}

.page-intro.intro-dismissed {
  transform: translateY(-100%);
  pointer-events: none;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.95), 0 0 60px rgba(var(--accent-rgb), 0.2);
}

.intro-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, opacity;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2) 0%, rgba(140, 100, 255, 0.06) 45%, transparent 70%);
  pointer-events: none;
  animation: introGlowPulse 2s ease-in-out infinite alternate;
}

.intro-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 48px 38px;
  width: min(90vw, 420px);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 28px 70px -10px rgba(0, 0, 0, 0.8),
    0 0 40px -10px rgba(var(--accent-rgb), 0.16);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  animation: introContentIn 0.6s var(--ease) forwards;
  transition: transform 0.35s var(--ease), opacity 0.3s ease;
}

.page-intro.intro-dismissed .intro-card {
  transform: translateY(-24px) scale(0.96);
  opacity: 0;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: introDotPulse 1.2s infinite ease-in-out;
}

.intro-title {
  font-size: clamp(48px, 9vw, 64px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 12px;
}

.intro-dot-accent {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.65);
}

.intro-sub {
  margin: 0 0 22px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.intro-progress {
  width: 120px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.intro-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.4) 0%, var(--accent) 70%, #ffffff 100%);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8);
  border-radius: 999px;
  animation: introProgressFill 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

@keyframes introContentIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes introProgressFill {
  0% {
    width: 0%;
  }
  60% {
    width: 75%;
  }
  100% {
    width: 100%;
  }
}

@keyframes introDotPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes introGlowPulse {
  from {
    transform: translate3d(-50%, -50%, 0) scale(0.92);
    opacity: 0.8;
  }
  to {
    transform: translate3d(-50%, -50%, 0) scale(1.08);
    opacity: 1;
  }
}


/* ---------- TOP BAR (floating pill) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  pointer-events: none;      /* only the pill itself is clickable */
}

.nav-inner {
  pointer-events: auto;
  max-width: 1112px;
  margin: 0 auto;
  padding: 10px 12px 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(20, 16, 32, 0.66);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
  will-change: transform;
  contain: layout style;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14px;
  color: var(--text-dim);
}

.nav-links a {
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.nav-cta:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}


/* ---------- HERO ---------- */
.hero > .presence {
  grid-column: 1 / -1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 34px 56px;
  align-items: center;
  padding: 34px 0 56px;
}


.presence:hover {
  border-color: var(--border-hover);
}

.presence-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.presence-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.presence-top strong {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.presence-handle {
  font-size: 14px;
  color: var(--text-dim);
}

.presence-arrow {
  font-size: 18px;
  color: var(--text-dim);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.presence:hover .presence-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-cue::before,
.scroll-cue::after {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22));
}

.scroll-cue::after {
  transform: scaleX(-1);
}

.presence {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100%, 640px);
  padding: 14px 24px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.avatar-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background-color: #1a1626;
  background-size: cover;
  background-position: center;
}

/* The online/idle/dnd dot. Starts grey; script.js changes the color. */
.status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border: 3px solid #1a1626;   /* ring that separates the dot from the avatar */
  border-radius: 50%;
  background-color: #747e8c;
}

.status-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Small uppercase label above headings */
.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(46px, 6.6vw, 90px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
  color: #fff;
}

/* last word picks up the lavender, like a gradient fade */
h1 .word:last-child {
  color: #ddd2ff;
}

h1 em {
  font-size: 1.08em;   /* serif letters look a bit small next to Inter, so bump them up */
  letter-spacing: -0.02em;
}

/* Headline words slide up out of a mask, one after another (from website 6) */
.word {
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  padding: 0 0.08em 0.14em;
  margin: 0 -0.08em -0.14em;
}

.word > span {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  transform-origin: left bottom;
  will-change: transform;
}

html.ready .hero .word > span,
.visible .word > span {
  transform: none;
  transition: transform 1.05s var(--ease-out) calc(var(--i, 0) * 80ms + 140ms);
}

.lead {
  max-width: 560px;
  margin: 28px 0 0;
  font-size: 18px;
  color: var(--text-dim);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.btn-primary {
  background: #f1ecff;
  border-color: #f1ecff;
  color: #14101f;
  font-weight: 600;
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 34px rgba(var(--accent-rgb), 0.32);
}


/* ---------- SECTIONS (shared by About, Projects, Expertise, Contact) ---------- */
.section {
  padding: 104px 0 24px;   /* a little more breathing room between sections */
}

h2 {
  margin: 0;
  font-size: clamp(36px, 5.6vw, 64px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

h2 em {
  font-size: 1.08em;
}

h2 .accent {
  color: var(--accent);
}

.section-sub,
.body-text {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: 17px;
  color: var(--text-dim);
}


/* ---------- CARDS ---------- */
.card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  position: relative;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

/* The hover shadow is pre-painted once and only its opacity is animated (no per-frame blur repaints) */
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(var(--accent-rgb), 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px) translateZ(0);
  z-index: 2;
}

.card:hover::after {
  opacity: 1;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* glowing purple dot (used on the "Biggest project" label) */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.desc {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
}

.meta {
  margin: 20px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* Clickable card links */
.card-link {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-header .card-label {
  margin: 0;
}

.card-arrow {
  font-size: 16px;
  color: var(--text-dim);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.card-link:hover .card-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Organized member count footer */
.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.featured-footer {
  margin-top: 32px;
  padding-top: 24px;
}

.card-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  color: var(--accent);
  opacity: 0.9;
  flex-shrink: 0;
}

.stat-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-text strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  transition: color 0.25s var(--ease);
}

.stat-text span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-link:hover .stat-text strong {
  color: var(--accent);
}

.card-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  white-space: nowrap;
}

.card-link:hover .card-hint {
  color: #14101f;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}

/* The big featured card (Kaizen) — same surface & background as current cards */
.featured {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  gap: 32px 48px;
  align-items: stretch;
  margin-top: 36px;
  padding: 38px 42px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.featured::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(var(--accent-rgb), 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.featured:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px) translateZ(0);
}

.featured:hover::after {
  opacity: 1;
}

/* Ambient glow disabled so Kaizen card background matches current cards cleanly */
.feat-ambient-glow {
  display: none;
}

.feat-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

/* Top bar with badges and role chip */
.feat-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feat-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feat-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.feat-badge-flagship {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.feat-badge-flagship svg {
  color: #f7d070;
  filter: drop-shadow(0 0 6px rgba(247, 208, 112, 0.6));
}

.feat-badge-live {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.22);
}

.feat-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
  animation: introDotPulse 1.4s ease-in-out infinite;
}

/* Role chip with the operations-lead icon */
.feat-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feat-role-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

/* Title group */
.feat-title-group {
  margin-top: 8px;
}

.feat-title {
  margin: 0;
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: #ffffff;
}

.feat-title-dot {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.6);
}

.feat-role-sub {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

.feat-desc {
  margin: 4px 0 0;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Right side stats + CTA */
.feat-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.feat-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.feat-stat-card {
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.featured:hover .feat-stat-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.feat-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.feat-stat-header {
  display: flex;
  align-items: baseline;
}

.feat-stat-val {
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-plus {
  font-size: 0.7em;
  margin-left: 2px;
  opacity: 0.85;
}

.feat-stat-lbl {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Apple-style floating CTA pill */
.feat-cta-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #000;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 #ffffff;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s var(--ease);
}

.featured:hover .feat-cta-btn {
  background: #ffffff;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
}

.feat-cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 13px;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.featured:hover .feat-cta-arrow {
  transform: translate(2px, -2px);
  background: #111;
}


/* The row of numbers inside the featured card */
.stats {
  display: flex;
  gap: 44px;
  margin-top: 30px;
}

.stats strong {
  display: block;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stats span {
  font-size: 13px;
  color: var(--text-dim);
}


/* ---------- COMMUNITIES MARQUEE ---------- */
.marquee-section {
  padding: 44px 0 12px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.marquee-label {
  margin: 0 0 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.marquee {
  overflow: hidden;
  contain: layout paint;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: marquee 35s linear infinite;
}

/* script.js pauses the marquee while it is off-screen */
.marquee.is-offscreen .marquee-track {
  animation-play-state: paused;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marquee-group li {
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: rgba(246, 244, 251, 0.4);
  transition: color 0.3s ease;
}

.marquee-group li::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 48px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.marquee-group li:hover {
  color: var(--text);
}

@keyframes marquee {
  to { transform: translate3d(-50%, 0, 0); }
}


/* ---------- NUMBERS (TRACK RECORD) ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 36px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  contain: layout style;
  padding: 34px 22px;
  border-right: 1px solid var(--border);
}

.stat:first-child {
  padding-left: 0;
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat span {
  display: block;
  margin-top: 10px;
  max-width: 180px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}


/* ---------- PROJECTS ---------- */
.group-title {
  margin: 56px 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Projects Carousel Header & Nav */
.projects-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 18px;
}

.projects-carousel-header .group-title {
  margin: 0;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* "View all" toggle button */
.btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-view-all:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-view-all.active {
  color: #14101f;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 14px rgba(var(--accent-rgb), 0.35);
}

.view-all-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
}

.btn-view-all.active .view-all-count {
  background: rgba(8, 7, 13, 0.2);
}

.carousel-arrow-group {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}

.carousel-arrow-group.hidden {
  display: none;
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.carousel-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--accent);
  transform: translateY(-1px);
}

.carousel-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Horizontal Card Slider */
.card-slider-wrapper {
  position: relative;
}

.card-slider {
  display: flex;
  gap: 18px;
  overflow-x: hidden; /* SLIDE POSSIBLE ONLY BY BUTTON */
  overflow-y: hidden;
  touch-action: pan-y; /* Prevent touch horizontal swiping */
  overscroll-behavior-y: auto;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 16px 4px 22px 4px;
  margin: -16px -4px 0 -4px;
}

/* When in grid view ("view all") */
.card-slider.is-grid-view {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  overflow: visible;
  touch-action: auto;
  padding: 16px 4px 22px 4px;
  margin: -16px -4px 0 -4px;
}

.card-slider.is-grid-view .card {
  flex: unset;
  min-width: unset;
}

/* On desktop in slide view, exactly 3 cards fit side-by-side */
.card-slider:not(.is-grid-view) .card {
  flex: 0 0 calc((100% - 36px) / 3);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Subtle fade on right edge */
.slider-fade-edge {
  display: none;   /* script.js still toggles .hidden on it; the fade itself is a mask below */
}

.card-slider-wrapper:has(.slider-fade-edge:not(.hidden)):not(:has(.is-grid-view)) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 52px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 52px), transparent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* "Previous" list: one bordered line per project */
.rows {
  border-top: 1px solid var(--border);
}

.row {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 90px;   /* name | description | tag (fixed width so rows line up) */
  align-items: center;
  gap: 32px;
  padding: 26px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.3s var(--ease);
}

.row:hover {
  background: var(--surface);
}

.row h5 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.row-role {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--accent);
}

.row-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.tag {
  justify-self: end;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
}


/* ---------- EXPERTISE (Apple Bento Grid) ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 36px;
}

.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  border-radius: 24px;
  background:
    radial-gradient(110% 100% at 50% 0%, rgba(var(--accent-rgb), 0.08), transparent 70%),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 16px 40px -10px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
}

.skill-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 34px rgba(var(--accent-rgb), 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.skill-card:hover {
  transform: translateY(-4px) translateZ(0);
  background:
    radial-gradient(110% 100% at 50% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%),
    rgba(255, 255, 255, 0.045);
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 24px 60px -12px rgba(0, 0, 0, 0.8),
    0 0 32px -8px rgba(var(--accent-rgb), 0.22);
}

.skill-card:hover::after {
  opacity: 1;
}

.skill-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.skill-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.skill-card:hover .skill-icon-wrap {
  transform: scale(1.08);
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 20px rgba(var(--accent-rgb), 0.35);
}

.skill-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.skill-card:hover .skill-badge {
  color: #ffffff;
  border-color: rgba(var(--accent-rgb), 0.4);
}

.skill-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #ffffff;
}

.skill-desc {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  flex-grow: 1;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.skill-tags span {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.skill-card:hover .skill-tags span {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.12);
}


/* ---------- DISCORD MOCKUPS (server design + roles) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: center;
}

#roles .split {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.split-text .body-text {
  max-width: 460px;
}

.tags-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.tags-line li {
  padding: 9px 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.tags-line li:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(var(--accent-rgb), 0.08);
  transform: translateY(-2px);
}

.layouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  align-items: start;
}

.layout-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.layout-col:nth-child(2) {
  margin-top: 36px;
}

.layout {
  margin: 0;
}

/* Discord-style category card (used for the channel layouts AND the role lists) */
.dc {
  position: relative;
  padding: 13px 10px 11px;
  color: #a7a3b8;
  /* faint lavender wash from the top, like light catching the panel */
  background:
    radial-gradient(130% 90% at 50% -20%, rgba(var(--accent-rgb), 0.1), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.022));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);   /* hairline highlight along the top edge */
  font-weight: 500;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

/* hover glow is pre-painted once; only its opacity animates */
.dc::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), 0 0 38px rgba(var(--accent-rgb), 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.dc:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
}

.dc:hover::after {
  opacity: 1;
}

.dc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 8px;
  padding: 2px 4px 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #cfcbe0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);   /* separates the category from its channels */
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.dc:hover .dc-head {
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.28);
}

.dc-head > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dc-head svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.dc:hover .dc-head svg {
  opacity: 0.95;
}

/* the chevron by the category name flips on hover, like a Discord category opening */
.dc:hover .dc-head > span svg {
  transform: rotate(180deg);
}

.dc-list {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dc-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 9px;
  cursor: default;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* hovering a row (like hovering a channel in Discord) */
.dc-list li:hover {
  background: rgba(var(--accent-rgb), 0.13);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.18);
  transform: translateX(3px);
}

.dc-list .ci {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #7f7b92;
  transition: color 0.2s var(--ease);
}

.dc-list li:hover .ci {
  color: var(--accent);
}

/* role icons in the role cards */
.dc-list .ri {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: contain;
  transition: transform 0.25s var(--ease);
}

.dc-list li:hover .ri {
  transform: scale(1.14) rotate(-3deg);
}

/* Role cards (.dc-roles): the ranks show as a wrapped row of chips instead of a
   channel list, so the two kinds of mockup read differently at a glance. */
.dc-roles {
  padding: 8px 7px 7px;
}

.dc-roles .dc-list {
  display: block;
  padding: 2px 3px 3px;
}

.dc-roles .dc-list li {
  max-width: 100%;
  padding: 4px 11px 4px 4px;
  font-size: 12px;
  color: #d7d3e6;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.dc-roles .dc-list li:hover {
  background: rgba(var(--accent-rgb), 0.13);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
  transform: translateX(3px);
}

.dc-roles .dc-list .ri {
  width: 18px;
  height: 18px;
  border-radius: 50%;   /* role icons read as little round badges on the chips */
}

.layout figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 8px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.layout figcaption b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.note {
  max-width: 620px;
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .featured {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  #roles .split-text {
    order: -1;
  }
}

@media (max-width: 600px) {
  .layouts {
    grid-template-columns: 1fr;
  }

  .layout-col:nth-child(2) {
    margin-top: 0;
  }

  .nav-inner {
    padding-left: 20px;
  }

  .presence {
    padding-right: 18px;
  }
}


/* ---------- CONTACT ---------- */
.contact {
  padding-bottom: 40px;
  text-align: center;
}

.contact h2 {
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: -0.04em;
}

.contact .body-text {
  max-width: 520px;
  margin: 20px auto 0;
}


/* ---------- CONTACT FORM ---------- */
.contact-layout {
  position: relative;
  max-width: 720px;
  margin: 52px auto 0;
  text-align: left;
}

/* soft purple glow behind the card */
.contact-layout::before {
  content: "";
  position: absolute;
  inset: -160px -180px;
  z-index: -1;
  /* every gradient fades to fully transparent well inside the box, so there is no visible edge */
  background:
    radial-gradient(45% 30% at 50% 24%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(26% 22% at 80% 80%, rgba(var(--accent-rgb), 0.1), transparent 70%);
  pointer-events: none;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(var(--accent-rgb), 0.4);
  transition: text-decoration-color 0.2s;
}

.inline-link:hover {
  text-decoration-color: var(--accent);
}

.form-card {
  padding: 40px;
  border: 1px solid transparent;
  border-radius: 28px;
  /* dark fill + a thin gradient outline that fades from purple to nearly invisible */
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(var(--accent-rgb), 0.07), transparent 70%) padding-box,
    linear-gradient(#0e0c16, #0e0c16) padding-box,
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.42), rgba(255, 255, 255, 0.07) 35%, rgba(255, 255, 255, 0.05) 65%, rgba(var(--accent-rgb), 0.3)) border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.form-card form {
  display: grid;
  gap: 22px;
}

.form-card form[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.field legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.hint {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #6c6a7e;
}

.field input[type="text"]:hover,
.field input[type="email"]:hover,
.field textarea:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field textarea:focus {
  outline: none;
  background: rgba(8, 7, 13, 0.85);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14);
}

.field.invalid input,
.field.invalid textarea {
  border-color: #ff8a9b;
}

.field-error {
  display: none;
  margin: 8px 0 0;
  font-size: 13px;
  color: #ff8a9b;
}

.field.invalid .field-error {
  display: block;
}

/* Service picker: pill toggles instead of a dropdown */
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.chip {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 11px 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.chip:hover span {
  color: var(--text);
  border-color: var(--border-hover);
}

.chip input:checked + span::before {
  content: "✓";
  margin-right: 7px;
  font-size: 12px;
}

.chip input:checked + span {
  color: #14101f;
  font-weight: 600;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.24);
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.25);
}

.chips-field.invalid .chip span {
  border-color: #ff8a9b;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.form-note strong {
  color: var(--text);
  font-weight: 500;
}

.form-note.error {
  color: #ff8a9b;
}

.form-note.error a {
  text-decoration: underline;
}

.btn-send {
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn-send:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

button.btn {
  font-family: inherit;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

button.btn.btn-primary {
  color: #14101f;
  background: #f1ecff;
}

/* Shown in place of the form after a successful send */
.form-success {
  padding: 36px 0;
  text-align: center;
}

.form-success[hidden] {
  display: none;
}

.form-success:focus {
  outline: none;
}

.success-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  font-size: 22px;
  color: #14101f;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.35);
}

.form-success h3 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.form-success h3 em {
  font-size: 1.08em;
}

.form-success p {
  max-width: 380px;
  margin: 0 auto 26px;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .form-card {
    padding: 26px 20px;
    border-radius: 24px;
  }

  .chips {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .form-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    text-align: center;
  }

  .btn-send {
    width: 100%;
    padding: 14px 22px;
  }

  .contact-layout::before {
    inset: -120px -24px;
  }
}


/* ---------- FOOTER ---------- */
.footer {
  max-width: 1160px;
  margin: 80px auto 0;
  padding: 28px max(24px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0;
}


/* ---------- NO HOVER WORK WHILE SCROLLING ----------
   script.js sets .is-scrolling during scroll; hover repaints are skipped until it stops. */
@media (hover: hover) {
  html.is-scrolling .page,
  html.is-scrolling .nav {
    pointer-events: none;
  }
}


/* ---------- FADE-IN ON SCROLL (script.js adds these classes) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease-out), transform 0.95s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Grouped reveal (the Discord mockup cards): the whole grid waits for its section,
   then each card slides up in turn using its own --d delay. */
.reveal-group .layout {
  opacity: 0;
  transform: translateY(30px) scale(0.985);
  transition: opacity 0.9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.reveal-group.visible .layout {
  opacity: 1;
  transform: none;
}

/* Cards also animate on hover; make sure the fade-in doesn't slow that down */
.card.reveal.visible,
.featured.reveal.visible {
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

/* If someone has "reduce motion" turned on in their system, skip the animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal-group .layout { opacity: 1; transform: none; transition: none; }
  .word > span { transform: none !important; transition: none !important; }
  .page-intro { display: none !important; }
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; }
  .marquee-group[aria-hidden="true"] { display: none; }
}


/* ---------- TABLETS & PHONES ---------- */
@media (max-width: 860px) {
  .stats-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat {
    padding: 28px 20px;
  }

  .stat:nth-child(odd) {
    padding-left: 0;
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .card-slider:not(.is-grid-view) .card {
    flex: 0 0 calc((100% - 18px) / 2);
    min-width: 0;
  }

  .card-grid,
  .skills {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row {
    grid-template-columns: 1fr auto;   /* name | tag, description underneath */
    gap: 10px 16px;
  }

  .row-desc {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .stat {
    padding: 22px 14px;
  }

  .stat span {
    max-width: none;
    font-size: 12px;
  }

  .card-slider:not(.is-grid-view) .card {
    flex: 0 0 100%;
    min-width: 0;
  }

  .card-slider.is-grid-view {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;     /* no room for the links on a phone */
  }

  .hero {
    padding-top: 28px;
  }

  .featured {
    padding: 24px 20px;
    border-radius: 24px;
    gap: 24px;
  }

  .feat-top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    gap: 30px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .skill-card {
    padding: 24px 20px;
  }

  .intro-card {
    padding: 36px 24px;
    border-radius: 26px;
  }

  /* Prevents iOS Safari from auto-zooming and shifting layout on focus */
  .field input[type="text"],
  .field input[type="email"],
  .field textarea {
    font-size: 16px;
  }
}
