/*-----------------------------------------------------------------------------------
    bktan.co — modern UI layer
    Loaded after style.css. Redesigns the homepage on top of the legacy template:
    new sections use their own class names, and the few legacy hooks that must stay
    (navbar collapse, back-to-top, airtable preloader) are overridden here.
-----------------------------------------------------------------------------------*/

/*===========================
    1. TOKENS
===========================*/
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-display: "Poppins", var(--font-sans);

  --bg: #ffffff;
  --bg-subtle: #f6f7fb;
  --card: #ffffff;
  --text: #12142b;
  --text-muted: #5a6078;
  --text-faint: #8c93aa;
  --border: #e6e8f0;
  --border-strong: #d5d9e8;

  --accent: #6d45f7;
  --accent-text: #6338e8;
  --accent-soft: rgba(109, 69, 247, 0.08);
  --accent-glow: rgba(109, 69, 247, 0.25);
  --on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(16, 18, 40, 0.05), 0 2px 6px rgba(16, 18, 40, 0.04);
  --shadow-md: 0 6px 16px rgba(16, 18, 40, 0.07), 0 2px 6px rgba(16, 18, 40, 0.04);
  --shadow-lg: 0 22px 48px rgba(16, 18, 40, 0.12), 0 4px 12px rgba(16, 18, 40, 0.05);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --nav-h: 74px;
  --wrap: 1140px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0b0b12;
  --bg-subtle: #10101b;
  --card: #14141f;
  --text: #f1f2f7;
  --text-muted: #a2a5ba;
  --text-faint: #787c92;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --accent: #8f70ff;
  --accent-text: #ab90ff;
  --accent-soft: rgba(143, 112, 255, 0.14);
  --accent-glow: rgba(143, 112, 255, 0.32);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 52px rgba(0, 0, 0, 0.55);
}

/*===========================
    2. BASE
===========================*/
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-text);
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-text);
}

img {
  max-width: 100%;
  height: auto;
}

/* Visible keyboard focus everywhere — the legacy CSS removed all outlines. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

/*===========================
    3. NAVIGATION
    Scoped with .site-nav so it outranks style.css without !important.
===========================*/
.navigation.site-nav {
  padding: 0;
  background-color: transparent;
  box-shadow: none;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.navigation.site-nav.sticky {
  padding: 0;
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Fallback for browsers without color-mix() */
@supports not (background-color: color-mix(in srgb, red 50%, transparent)) {
  .navigation.site-nav.sticky {
    background-color: var(--bg);
  }
}

.navigation.site-nav .navbar {
  padding: 0;
  height: var(--nav-h);
  flex-wrap: nowrap;
}

.navigation.site-nav .navbar .navbar-brand {
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.navigation.site-nav .navbar .navbar-brand:hover {
  color: var(--text);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: 0 0 auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Nav links */
.navigation.site-nav .navbar .navbar-nav {
  align-items: center;
  gap: 2px;
}

.navigation.site-nav .navbar .navbar-nav .nav-item {
  margin: 0;
}

.navigation.site-nav .navbar .navbar-nav .nav-item a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

/* Kill the legacy vertical-bar indicator */
.navigation.site-nav .navbar .navbar-nav .nav-item a::before,
.navigation.site-nav .navbar .navbar-nav .nav-item.active a::before,
.navigation.site-nav .navbar .navbar-nav .nav-item:hover a::before {
  display: none;
  height: 0;
}

.navigation.site-nav .navbar .navbar-nav .nav-item a:hover {
  color: var(--text);
  background-color: var(--accent-soft);
}

.navigation.site-nav .navbar .navbar-nav .nav-item.active a {
  color: var(--accent-text);
  background-color: var(--accent-soft);
}

/* Theme toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Mobile toggler */
.navigation.site-nav .navbar .navbar-toggler {
  width: 38px;
  height: 38px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.navigation.site-nav .navbar .navbar-toggler .toggler-icon {
  width: 17px;
  height: 1.5px;
  margin: 2.5px 0;
  border-radius: 2px;
  background-color: var(--text);
}

@media (max-width: 991px) {
  .navigation.site-nav .navbar .navbar-toggler {
    display: flex;
  }
}

/* Mobile dropdown panel */
@media (max-width: 991px) {
  .navigation.site-nav .navbar .navbar-collapse {
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

  .navigation.site-nav .navbar .navbar-nav {
    align-items: stretch;
    gap: 2px;
  }

  .navigation.site-nav .navbar .navbar-nav .nav-item a {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 16px;
  }
}

/*===========================
    4. SECTION SHELL
===========================*/
.sec {
  padding: clamp(64px, 9vw, 112px) 0;
  scroll-margin-top: calc(var(--nav-h) + 8px);
  background-color: var(--bg);
}

.sec--subtle {
  background-color: var(--bg-subtle);
}

.sec-head {
  max-width: 640px;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}

/* Accent rule above each section title — visual rhythm without repeating
   the heading text in an eyebrow label. */
.sec-head::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    color-mix(in srgb, var(--accent) 35%, transparent) 100%
  );
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .sec-head::before {
    background: var(--accent);
  }
}

.sec-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
}

.sec-sub {
  margin: 14px 0 0;
  font-size: 17px;
  color: var(--text-muted);
}

/*===========================
    5. BUTTONS
===========================*/
.btn-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.btn-x svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.btn-x--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 22px var(--accent-glow);
}

.btn-x--primary:hover {
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px var(--accent-glow);
}

.btn-x--ghost {
  background: var(--card);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-x--ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/*===========================
    6. HERO
===========================*/
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h) + clamp(48px, 8vw, 88px)) 0
    clamp(64px, 9vw, 104px);
  background-color: var(--bg);
}

/* Ambient glow + dot grid */
.hero::before {
  content: "";
  position: absolute;
  top: -18%;
  right: -8%;
  width: 60vw;
  height: 60vw;
  max-width: 780px;
  max-height: 780px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--accent-glow) 0%,
    rgba(109, 69, 247, 0) 68%
  );
  opacity: 0.65;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    var(--border-strong) 1px,
    transparent 1px
  );
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 60% at 50% 30%,
    #000 0%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 30%,
    #000 0%,
    transparent 75%
  );
  opacity: 0.5;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 6px 15px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-eyebrow .pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex: 0 0 auto;
}

.hero-eyebrow .pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-ring 2.2s var(--ease) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 5.6vw, 3.9rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero-title .nowrap {
  white-space: nowrap;
}

.hero-title .wave {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.05em;
  transform-origin: 70% 80%;
  animation: wave 2.6s ease-in-out infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 34em;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.7;
  color: var(--text-muted);
}

.hero-lead a {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.hero-lead a:hover {
  color: var(--accent-text);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.hero-social a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-social a:hover {
  color: var(--accent-text);
}

.hero-social svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

/* Hero portrait */
.hero-media {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 420px;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: calc(var(--radius-lg) + 14px);
  background: linear-gradient(
    140deg,
    var(--accent) 0%,
    rgba(109, 69, 247, 0) 55%
  );
  opacity: 0.28;
  filter: blur(20px);
}

/*===========================
    6b. HERO PARALLAX SCENE
===========================*/
/* Six stacked plates built by tools/build-parallax.py. Each .px-l is a depth
   wrapper carrying the pointer/scroll offset that hero-parallax.js writes into
   --mx/--my as -1..1; its child carries the idle animation, so the two never
   fight over one transform. Amplitudes are in cqw (1% of the scene box) so the
   scene behaves identically at any size — and so they stay inside the motion
   budget the build script culls hidden pixels against: for any two layers,
   max --d + both sway amplitudes must stay under MARGIN (4cqw). */
.px-scene {
  --mx: 0;
  --my: 0;

  position: relative;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  /* Fitted off assets/parallax/sky.webp by tools/build-parallax.py, which prints
     these stops. Kept as a gradient rather than shipping the plate: no bytes, and
     it paints before any layer has loaded. Re-run the build if the plate changes. */
  background: linear-gradient(
    180deg,
    #048deb 0%,
    #0995ec 20%,
    #0e9eee 40%,
    #13a4ef 55%,
    #17a9f1 66%,
    #25b8f4 100%
  );
  /* after the shorthand, which would reset it: keeps the sky from tinting the
     border into a bright rim. The layers stop at the same edge anyway, since
     overflow clips to the padding box. */
  background-clip: padding-box;
}

.px-l {
  position: absolute;
  inset: 0;
  transform: translate3d(
    calc(var(--mx) * var(--d) * 1cqw),
    calc(var(--my) * var(--d) * 0.55cqw),
    0
  );
}

.px-l > * {
  position: absolute;
  display: block;
  height: auto;
  max-width: none; /* the plates over-scan the frame; the base img rule clamps */
  /* The layers are built on a 210px grid and magnified ~2x here, so the art's
     own pixels stay visible instead of being smoothed away. crisp-edges first
     for browsers that only know that keyword. */
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  animation: px-sway var(--t) ease-in-out var(--dl, 0s) infinite alternate;
}

/* A slow lateral drift, desynced per layer, reads as air moving through the
   trees; the amplitude is deliberately under half a percent of the scene. */
@keyframes px-sway {
  from {
    transform: translate3d(calc(var(--sway) * -1cqw), 0, 0);
  }
  to {
    transform: translate3d(calc(var(--sway) * 1cqw), 0, 0);
  }
}

/* Clouds tile seamlessly, so a full-tile shift on a 200%-wide strip loops
   invisibly and can run forever. */
@keyframes px-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* The character's idle strip: one frame per step, looping seamlessly because the
   last frame returns to the first frame's pose. -100% is the whole strip, so
   steps(N) lands on exactly one frame boundary each time. */
@keyframes px-idle {
  to {
    transform: translateX(-100%);
  }
}

.px-l--clouds-far,
.px-l--clouds-near {
  --d: 0.28;
}

.px-l--clouds-far > i,
.px-l--clouds-near > i {
  left: 0;
  width: 200%;
  height: 42%;
  background-repeat: repeat-x;
  background-size: 50% auto;
  animation-name: px-drift;
  animation-timing-function: linear;
  animation-direction: normal;
}

.px-l--clouds-far > i {
  top: 2%;
  background-image: url(../parallax/scene/clouds-far.webp);
  opacity: 0.72;
  --t: 190s;
}

.px-l--clouds-near > i {
  top: 8%;
  background-image: url(../parallax/scene/clouds-near.webp);
  --t: 115s;
}

.px-l--far {
  --d: 0.55;
}

.px-l--far > img {
  left: -16%;
  bottom: 34%;
  width: 132%;
  --sway: 0.16;
  --t: 13s;
}

.px-l--mid {
  --d: 1;
}

.px-l--mid > img {
  left: -13%;
  bottom: 22%;
  width: 126%;
  --sway: 0.26;
  --t: 10.5s;
  --dl: -3s;
}

.px-l--bush {
  --d: 1.6;
}

.px-l--bush > img {
  left: -11%;
  bottom: 12%;
  width: 122%;
  --sway: 0.34;
  --t: 8s;
  --dl: -1.5s;
}

.px-l--ground {
  --d: 2.2;
}

.px-l--ground > img {
  left: -31%;
  bottom: -11%;
  width: 162%;
  --sway: 0.1;
  --t: 17s;
}

/* Close to the ground's depth: the figure is standing on it, so the two have to
   swing together or he reads as sliding along the path.

   He is a 20-frame idle strip rather than a still plate, so he breathes and
   blinks whether or not the pointer ever moves. The <i> is a one-frame window
   that only clips; the strip inside it does the animating, which keeps this off
   the wrapper's parallax transform. Width, not height, sizes the window, so the
   art's own aspect ratio places him: 33.4% wide stands him on the path.
   Duration must match FRAMES x FRAME_MS in tools/build-parallax.py. */
.px-l--char {
  --d: 2.05;
}

.px-l--char > i {
  left: 33.3%;
  bottom: 0;
  width: 33.4%;
  aspect-ratio: 70 / 156;
  overflow: hidden;
  animation: none;
}

.px-l--char img {
  position: absolute;
  left: 0;
  top: 0;
  width: 2000%; /* 20 frames */
  height: 100%;
  max-width: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  animation: px-idle 4s steps(20) infinite;
}

/* Birds startled out of the trees on click. hero-parallax.js clones the
   <template> in the markup once per bird and sets the vars below; each removes
   itself when px-fly ends, so nothing accumulates. The script sits out entirely
   under reduced motion, so only offer the affordance when it will do something. */
@media (prefers-reduced-motion: no-preference) {
  .px-scene {
    cursor: pointer;
  }
}
.px-birds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.px-birds i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 5.2cqw; /* the 9px frame, a shade over the layers' magnification */
  /* linear: the acceleration is already in px-fly's stops, and an ease-out on
     top of them spends most of the flight off-canvas */
  animation: px-fly var(--dur) linear var(--dl) both;
}

.px-birds b {
  display: block;
  /* positioned, or it is not in the strip's containing-block chain and the
     overflow below would not clip it -- all four frames would show at once */
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 7;
}

.px-birds img {
  position: absolute;
  left: 0;
  top: 0;
  width: 400%; /* 4 flap frames */
  height: 100%;
  max-width: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  /* px-idle steps a strip by exactly one frame, same as the character's loop */
  animation: px-idle 0.26s steps(4) infinite;
}

/* Burst upward off the branch, then flatten into a glide as it recedes. */
@keyframes px-fly {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  /* Climbs faster than it tracks sideways, so it reads as a burst off the branch
     -- but only a little, or it clears the top edge long before the end and the
     rest of the flight happens out of shot. hero-parallax.js sizes --dx/--dy
     against these fractions. */
  35% {
    transform: translate3d(
        calc(var(--dx) * 0.22cqw),
        calc(var(--dy) * 0.38cqw),
        0
      )
      scale(0.9);
  }
  70% {
    transform: translate3d(
        calc(var(--dx) * 0.62cqw),
        calc(var(--dy) * 0.72cqw),
        0
      )
      scale(0.76);
    opacity: 1;
  }
  100% {
    transform: translate3d(calc(var(--dx) * 1cqw), calc(var(--dy) * 1cqw), 0)
      scale(0.6);
    opacity: 0;
  }
}

/* Pollen catching the light. Positions and phases come from inline vars so the
   markup stays one repeated element. */
.px-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.px-motes i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  /* one block of the layer grid, so they read as part of the art */
  width: 0.48cqw;
  height: 0.48cqw;
  background: #fff8e0;
  box-shadow: 0 0 0.5cqw rgba(255, 246, 214, 0.5);
  opacity: 0;
  animation: px-mote var(--t) linear var(--dl) infinite;
}

@keyframes px-mote {
  0% {
    transform: translate3d(0, 3cqw, 0);
    opacity: 0;
  }
  22%,
  70% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(2cqw, -7cqw, 0);
    opacity: 0;
  }
}

/* Sinks the corners so the scene reads as a lit frame rather than a flat crop. */
.px-glaze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      110% 80% at 72% 12%,
      rgba(255, 250, 226, 0.15) 0%,
      rgba(255, 250, 226, 0) 55%
    ),
    radial-gradient(
      125% 95% at 50% 32%,
      rgba(8, 22, 36, 0) 52%,
      rgba(8, 22, 36, 0.3) 100%
    );
}

html[data-theme="dark"] .px-scene {
  filter: saturate(0.9) brightness(0.84);
}

/*===========================
    7. ABOUT
===========================*/
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(24px, 3.5vw, 40px);
  align-items: start;
}

.panel {
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
}

.panel-note {
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--text-faint);
}

/* When a panel has no sub-note, the title carries the spacing itself. */
.panel-title + .contact-list,
.panel-title + .skill-groups {
  margin-top: 22px;
}

/* Contact rows */
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.contact-row:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.contact-ico svg {
  width: 18px;
  height: 18px;
}

.contact-meta {
  min-width: 0;
}

.contact-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.contact-value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Skill groups + tags */
.skill-groups {
  display: grid;
  gap: 24px;
}

.skill-group-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.tag:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/*===========================
    8. CARD GRIDS (startups + tools)
===========================*/
.card-grid {
  display: grid;
  gap: 24px;
}

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

.card-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.x-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(24px, 2.6vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

/* Accent wash that fades in on hover */
.x-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    var(--accent-soft) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}

.x-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.x-card:hover::before {
  opacity: 1;
}

.x-card > * {
  position: relative;
}

.x-card-logo {
  display: flex;
  align-items: center;
  height: 52px;
  margin-bottom: 20px;
}

.x-card-logo img {
  max-height: 46px;
  width: auto;
}

.x-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-text);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.x-card-ico svg {
  width: 22px;
  height: 22px;
}

.x-card:hover .x-card-ico {
  background: var(--accent);
  color: var(--on-accent);
}

.x-card-title {
  margin: 0 0 10px;
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--text);
}

.x-card-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

.x-card-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
}

.x-card-more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease);
}

.x-card:hover .x-card-more svg {
  transform: translateX(4px);
}

/*===========================
    9. RESOURCES (airtable embed)
===========================*/
.embed-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.embed-frame .airtable-embed {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
  background: transparent;
  transition: opacity 0.35s var(--ease);
}

/* Lightweight skeleton loader — replaces the 300px animated GIF */
.preloader-airtable {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--card);
  color: var(--text-faint);
  font-size: 14.5px;
  z-index: 2;
}

.spinner-ring {
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/*===========================
    10. FOOTER
===========================*/
.site-footer {
  position: relative;
  padding: clamp(64px, 8vw, 96px) 0 32px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  scroll-margin-top: var(--nav-h);
  text-align: center;
}

.footer-title {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700;
}

.footer-sub {
  margin: 14px auto 0;
  max-width: 40em;
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.footer-links a:hover {
  transform: translateY(-3px);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.footer-links svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  margin-top: clamp(48px, 7vw, 72px);
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-faint);
}

.footer-bottom p {
  margin: 0;
}

/*===========================
    11. BACK TO TOP
    jQuery fadeIn/fadeOut writes inline display, so keep this a block and
    centre with line-height rather than flex.
===========================*/
a.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  line-height: 44px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-muted);
  font-size: 18px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

a.back-to-top:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/*===========================
    12. RESPONSIVE
===========================*/
@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-media {
    grid-row: 1;
    max-width: 320px;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta,
  .hero-social {
    justify-content: center;
  }

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

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

@media (max-width: 575px) {
  .wrap {
    padding: 0 18px;
  }

  .hero-cta .btn-x {
    width: 100%;
  }

  .hero-social {
    gap: 14px;
  }

  .embed-frame .airtable-embed {
    height: 520px;
  }

  a.back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

/*===========================
    13. MOTION PREFERENCES
===========================*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
