/* =========================
   VARIABLES
========================= */
:root {
  /* Layout tokens */
  --radius: 22px;
  --max: 1100px;

  /* Typography */
  --font-sans: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Fraunces", ui-serif, Georgia, serif;

  /* Core palette */
  --bg: #f6f7fb;
  --bg-top: #fbfcff;
  --text: #111318;
  --muted: rgba(17, 19, 24, .72);

  /* Surfaces / borders / shadows */
  --card: rgba(255, 255, 255, .70);
  --card-strong: rgba(255, 255, 255, .92);
  --card-mid: rgba(255, 255, 255, .78);
  --card-soft: rgba(255, 255, 255, .55);
  --card-soft-2: rgba(255, 255, 255, .45);

  --border: rgba(17, 19, 24, .10);
  --border-soft: rgba(17, 19, 24, .06);
  --border-btn: rgba(17, 19, 24, .12);

  --shadow: 0 18px 60px rgba(17, 19, 24, .10);

  /* Header / footer glass */
  --glass-header: rgba(246, 247, 251, .55);
  --glass-header-strong: rgba(246, 247, 251, .72);
  --glass-blur: 14px;

  /* Background gradients (exact values from your bg-wrap) */
  --bg-rad-1: rgba(255, 216, 120, .30);
  --bg-rad-2: rgba(160, 200, 255, .28);
  --bg-rad-3: rgba(255, 140, 200, .22);

  /* Blur layer */
  --blur-backdrop: 28px;
  --blur-tint: rgba(255, 255, 255, .18);

  /* Buttons */
  --btn-bg: rgba(255, 255, 255, .78);
  --btn-bg-hover: rgba(255, 255, 255, .92);
  --btn-border: rgba(17, 19, 24, .12);
  --btn-shadow-hover: 0 14px 34px rgba(17, 19, 24, .12);
  --btn-primary-bg: rgba(0, 0, 0, .9);
  --btn-primary-text: #ffffff;

  /* Project cards */
  --project-bg: rgba(255, 255, 255, .62);
  --project-bg-hover: rgba(255, 255, 255, .75);
  --project-border: rgba(17, 19, 24, .10);
  --project-shadow: 0 18px 55px rgba(17, 19, 24, .10);
  --project-shadow-hover: 0 26px 70px rgba(17, 19, 24, .14);
  --project-img-bg: #f2f3f7;

  /* Tags */
  --tag-text: rgba(17, 19, 24, .76);
  --tag-bg: rgba(255, 255, 255, .60);
  --tag-border: rgba(17, 19, 24, .10);

  /* Footer links */
  --footer-link-text: rgba(17, 19, 24, .82);
  --footer-link-bg: rgba(255, 255, 255, .45);

  /* Logo shadow */
  --logo-shadow: drop-shadow(0 4px 10px rgba(0, 0, 0, .12));

  /* Greeting */
  --greeting-duration: 520ms;

  /* Burst particles */
  --burst-blend: multiply;

  /* Do not press button */
  --danger-red-1: #ff5a5a;
  --danger-red-2: #b40000;
  --danger-red-shadow: #6b0000;
  --danger-text: #2b0000;

  /* Wand overlay */
  --wand-shadow: drop-shadow(0 24px 70px rgba(17, 19, 24, .25));
  --wand-hint-bg: rgba(255, 255, 255, .65);
  --wand-hint-border: rgba(17, 19, 24, .12);
  --wand-hint-text: rgba(17, 19, 24, .85);
  --wand-progress: rgba(17, 19, 24, .6);

  /* Flashbang */
  --flash: #fff;

  /* Chaos mode */
  --chaos-bg: #0b0f1a;
  --chaos-dim: rgba(5, 8, 14, 0.70);
}

/* =========================
   BASE / RESET
========================= */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;

  /* IMPORTANT:
     Removed perspective/transform-style from body because it breaks fixed overlays (wand/hint). */
}

/* =========================
   BACKGROUND + BLUR LAYER
========================= */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 10% 10%, var(--bg-rad-1), transparent 60%),
    radial-gradient(900px 700px at 90% 20%, var(--bg-rad-2), transparent 55%),
    radial-gradient(900px 700px at 50% 95%, var(--bg-rad-3), transparent 55%),
    linear-gradient(var(--bg-top), var(--bg));
}

.shape {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  opacity: .9;
  filter: saturate(1.1);
  will-change: transform;
  mix-blend-mode: var(--burst-blend);
  animation: none;
}

.shape.is-sparkle {
  border-radius: 14px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
      50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.blur-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(var(--blur-backdrop));
  -webkit-backdrop-filter: blur(var(--blur-backdrop));
  background: var(--blur-tint);
}

/* =========================
   LAYOUT
========================= */
.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

main {
  padding-top: 110px;
  /* height of header + breathing room */
  padding-bottom: 60px;
}

/* =========================
   HEADER
========================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;

  padding: 16px 0;
  background: var(--glass-header);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  filter: var(--logo-shadow);
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

nav a:hover {
  color: var(--text);
  background: var(--card-soft);
  transform: translateY(-1px);
}

nav a.is-active {
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
}

/* =========================
   HERO
========================= */
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
  padding: 40px 0;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -.03em;
}

.subline {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 60ch;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn,
.btn:visited,
.btn:hover,
.btn:active,
.btn:focus {
  color: inherit;
  text-decoration: none;
}

/* If you have a primary hero button */
.btn.primary,
.btn.primary:visited,
.btn.primary:hover,
.btn.primary:active,
.btn.primary:focus {
  color: var(--btn-primary-text);
  /* lock text color */
}

/* iOS tap highlight fix */
.btn {
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
  background: var(--btn-bg-hover);
}

.btn.primary {
  border: none;
  background: var(--btn-primary-bg);
}

/* Hero photo card */
.hero-card {
  width: 320px;
  height: 320px;
  padding: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 24px;
  background: var(--card-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(17, 19, 24, .14);
}

/* ✅ Fix: ensure hero never "hovers" */
.hero-card:hover {
  transform: none !important;
}

.avatar {
  width: 100%;
  height: 100%;
  max-width: 280px;
  max-height: 280px;
  border-radius: 18px;
  object-fit: cover;
}

.mini {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}

/* Centered hero helpers */
.hero-centered {
  display: flex;
  justify-content: center;
  text-align: center;
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 680px;
}

.cta-center {
  justify-content: center;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(56px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 10px 0 12px;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

#greeting {
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  font-variant-ligatures: none;
}

.g-char {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  perspective: 600px;
}

.g-face {
  display: inline-block;
  transform-origin: 50% 60%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

@keyframes charSpin {
  0% {
    transform: rotateX(0deg);
    opacity: 1;
  }

  50% {
    transform: rotateX(90deg);
    opacity: 0;
  }

  100% {
    transform: rotateX(360deg);
    opacity: 1;
  }
}

.g-face.spin {
  animation: charSpin var(--greeting-duration) cubic-bezier(.2, .8, .2, 1) both;
}

/* =========================
   SECTIONS
========================= */
.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-sans);
  text-align: center;
  font-size: clamp(28px, 4vw, 36px);
  margin: 0 auto 12px;
  letter-spacing: -.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffdd77, #ff7fd1, #7aa8ff);
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* =========================
   PROJECTS GRID
========================= */
/* Make cards keep a consistent size; layout wraps instead */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 18px;
  align-items: start;
}

/* Card scales by breakpoint (not by random stretching) */
.project {
  width: 100%;
  max-width: 520px;
  /* aspect-ratio: 4 / 5; */
  /* controls whole card shape */
  justify-self: center;

  border-radius: 22px;
  background: var(--project-bg);
  border: 1px solid var(--project-border);
  box-shadow: var(--project-shadow);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  position: relative;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--project-shadow-hover);
  background: var(--project-bg-hover);
}

/* ✅ Fix: disable hover lift on touch devices (phones) */
@media (hover: none) {
  .project:hover {
    transform: none;
    box-shadow: var(--project-shadow);
    background: var(--project-bg);
  }
}

.project::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, .12) 40%,
      rgba(255, 255, 255, .22) 100%);
  opacity: .9;
}

/* Image follows the card with fixed ratio */
.project-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  /* fixed forever */
  height: auto;
  /* do NOT override in media queries */
  object-fit: contain;
  /* no cropping */
  display: block;
  background: var(--project-img-bg);
  /* subtle neutral backdrop */
}

/* Content */
.project-content {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--tag-text);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
}

.project h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.project p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

.project a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  margin-top: auto;
}

.project a span {
  opacity: .7;
}

/* =========================
   FOOTER
========================= */
footer {
  margin-top: 54px;
  padding: 22px 0 34px;
  background: var(--glass-header);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--border-soft);
}

.footer-inner {
  display: grid;
  gap: 10px;
  align-items: start;
}

.footer-centered {
  text-align: center;
}

.footer-title {
  font-family: var(--font-serif);
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: -.02em;
  color: rgba(17, 19, 24, .92);
}

.footer-email {
  margin: 6px 0 16px;
}

.footer-email a {
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  color: rgba(17, 19, 24, .9);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.footer-links a {
  color: var(--footer-link-text);
  font-weight: 800;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--footer-link-bg);
  margin: 0 8px;
}

.footer-links a:hover {
  background: rgba(255, 255, 255, .80);
}

.copyright {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* Footer logo fade */
.footer-logo {
  height: 44px;
  width: auto;
  margin: 0 auto 22px;
  display: block;
  animation: logoFade 2.5s ease-in-out infinite;
  opacity: .9;
}

@keyframes logoFade {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* =========================
   BLAST PARTICLES
========================= */
.burst-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ps, 12px);
  height: var(--ps, 12px);
  border-radius: 999px;
  background: var(--pc, rgba(255, 255, 255, .9));
  filter: blur(.2px) saturate(1.15);
  opacity: .95;
  pointer-events: none;
  will-change: transform, opacity;
  mix-blend-mode: var(--burst-blend);
}

.burst-particle.spark {
  border-radius: 12px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
      50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* =========================
   MOBILE / TABLET HAMBURGER NAV
========================= */
.nav-links {
  display: flex;
  gap: 6px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--btn-border);
  background: var(--card-soft);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(17, 19, 24, .85);
  margin: 4px 0;
  border-radius: 999px;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-menu {
  background: var(--glass-header-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--border-soft);
}

.mobile-menu-inner {
  display: grid;
  gap: 10px;
  padding: 14px 0 16px;
}

.mobile-link {
  text-decoration: none;
  color: rgba(17, 19, 24, .85);
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-soft);
}

.mobile-link:hover {
  background: rgba(255, 255, 255, .85);
}

.mobile-link.is-active {
  background: rgba(255, 255, 255, .80);
}

@media (max-width:900px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.nav-toggle.is-open .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================
   RESPONSIVE
========================= */

/* ✅ Extra-small phones: let the card grow with content so "View project" stays visible */
@media (max-width:375px) {
  .project {
    aspect-ratio: auto;
    /* stop forcing height */
    height: auto;
    /* allow natural height */
    min-height: 0;
    /* safety */
  }

  .project-content {
    padding: 16px;
  }

  .project p {
    font-size: 14px;
    /* optional: helps fit better */
  }

  .project a {
    margin-top: 12px;
    /* ensure space above button/link */
  }
}




@media (max-width:380px) {
  .project {
    aspect-ratio: auto;
    /* stop forcing height */
    height: auto;
    /* allow natural height */
    min-height: 0;
    /* safety */
  }

  .hero-name {
    font-size: clamp(28px, 10vw, 40px) !important;
  }

  .g-char {
    width: 0.88em !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shape {
    animation: none;
  }

  .btn,
  .project {
    transition: none;
  }
}

@media (max-width:480px) {
  .project {
    aspect-ratio: auto;
    /* stop forcing height */
    height: auto;
    /* allow natural height */
    min-height: 0;
    /* safety */
  }

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

  .project {
    max-width: 100%;
  }
}

@media (max-width:600px) {
  .project {
    max-width: 100%;
  }

  /* ✅ removed project-img height override (keeps ratio consistent) */

  .hero-name {
    line-height: 1.12 !important;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}

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

  .grid {
    grid-template-columns: 1fr;
    /* single column */
  }

  .project {
    max-width: 440px;
  }
}

@media (min-width:1400px) {
  :root {
    --max: 1280px;
    /* was 1100px */
  }

  header {
    padding: 18px 0;
    /* slightly nicer on large screens */
  }

  .project {
    max-width: 560px;
    /* cards can be a bit wider */
  }
}

@media (min-width:1700px) {
  :root {
    --max: 1400px;
  }

  .project {
    max-width: 600px;
  }
}





/* =========================
   TESTIMONIAL CAROUSEL (SAFE)
========================= */
/* =========================
   TESTIMONIAL CAROUSEL (FIXED: ARROWS OUTSIDE + RESPONSIVE MARGINS)
========================= */

/* wrapper follows your container rhythm */
.tms{
  margin-top: 54px;
}

/* Make the whole carousel follow same side gutters as .container */
.tms-shell{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  position: relative;
}

/* Card behaves like project cards: centered, max width, fluid */
.tms-card{
  position: relative;
  width: 100%;
  max-width: 980px;               /* similar to your earlier intent */
  margin: 0 auto;

  border-radius: var(--radius);
  border: 1px solid var(--project-border);
  background: var(--project-bg);
  box-shadow: var(--project-shadow);

  overflow: hidden;               /* keeps grid overlay + slide content clean */
}

/* subtle grid (inside card only) */
.tms-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.08;
  background-image:
    linear-gradient(to right, rgba(17,19,24,.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,19,24,.35) 1px, transparent 1px);
  background-size: 90px 90px;
}

/* viewport */
.tms-viewport{
  overflow:hidden;
  touch-action: pan-y; /* keep vertical scroll, allow horizontal swipe */
}

/* track */
.tms-track{
  display:flex;
  transform: translate3d(0,0,0);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

/* slide */
.tms-slide{
  flex: 0 0 100%;
  padding: clamp(20px, 3vw, 42px);
  text-align: center;
  position: relative;
  z-index: 1;
}

.tms-avatar{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.9);
  margin: 4px auto 16px;
  display:block;
}

.tms-quote{
  margin: 0 auto 16px;
  max-width: 62ch;
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.55;
  color: rgba(17,19,24,.92);
}

.tms-name{
  margin: 0;
  font-weight: 900;
  color: rgba(17,19,24,.92);
}

.tms-role{
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(17,19,24,.60);
}

/* dots */
.tms-dots{
  display:flex;
  gap: 10px;
  justify-content:center;
  padding: 16px 16px 18px;
  position: relative;
  z-index: 2;
}

.tms-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(17,19,24,.25);
  cursor: pointer;
}

.tms-dot.is-active{
  background: rgba(17,19,24,.82);
}

/* =========================
   ARROWS OUTSIDE THE CARD
   - arrows are positioned relative to .tms-shell (NOT the card)
   - card stays clean; text never covered
========================= */

.tms-arrow{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  display:grid;
  place-items:center;

  font-size: 32px;
  line-height: 1;
  color: rgba(17,19,24,.75);
  cursor: pointer;

  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.tms-arrow:hover{
  background: var(--card-strong);
  transform: translateY(-50%) translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
}

/* push arrows OUTSIDE card edge */
.tms-prev{ left: -56px; }
.tms-next{ right: -56px; }

/* On smaller screens, bring arrows back IN so they never go off-screen */
@media (max-width: 1200px){
  .tms-prev{ left: 10px; }
  .tms-next{ right: 10px; }

  /* when arrows are inside, give slide a little extra side padding */
  .tms-slide{ padding-left: 56px; padding-right: 56px; }
}

/* phones */
@media (max-width: 520px){
  .tms-arrow{
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 28px;
  }
  .tms-slide{
    padding-left: 52px;
    padding-right: 52px;
    padding-top: 22px;
    padding-bottom: 18px;
  }
}

/* ultra small */
@media (max-width: 360px){
  .tms-arrow{ width: 36px; height: 36px; font-size: 26px; }
  .tms-slide{ padding-left: 46px; padding-right: 46px; }
  .tms-quote{ font-size: 14px; }
}

.tms-name a{
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.tms-name a:hover{
  text-decoration: underline;
}




/* =========================
   GAMIFICATION: DO NOT PRESS
========================= */

/* =========================
   DO NOT PRESS — EMERGENCY BUTTON
========================= */

.dont-press {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;

  width: 140px;
  height: 90px;
  padding: 0;

  border: none;
  background: none;
  cursor: pointer;

  perspective: 800px;
}

/* RED BUTTON TOP */
.dont-press .button-top {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(0);

  width: 72px;
  height: 48px;
  border-radius: 50%;

  background:
    radial-gradient(circle at 30% 30%, var(--danger-red-1), var(--danger-red-2) 70%);

  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, .35),
    inset 0 -4px 8px rgba(0, 0, 0, .45),
    0 8px 0 var(--danger-red-shadow);

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--danger-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .3);

  transition:
    transform .12s ease,
    box-shadow .12s ease;
}

/* HOVER — SLIGHT PRESS */
.dont-press:hover .button-top {
  transform: translateX(-50%) translateY(3px);

  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, .35),
    inset 0 -4px 8px rgba(0, 0, 0, .45),
    0 5px 0 var(--danger-red-shadow);
}

/* ACTIVE — FULL PRESS */
.dont-press:active .button-top {
  transform: translateX(-50%) translateY(8px);

  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, .55),
    0 1px 0 var(--danger-red-shadow);
}

/* Disable hover lift on touch devices */
@media (hover:none) {
  .dont-press:hover .button-top {
    transform: translateX(-50%) translateY(0);
  }
}

/* =========================
   WAND OVERLAY — ALWAYS CENTERED (NO SCROLL)
   - This stays fixed to the viewport even when the page scrolls
========================= */
#wandLayer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;

  /* IMPORTANT: hidden by default */
  display: none;

  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* When JS shows it (hidden removed) */
#wandLayer:not([hidden]) {
  display: flex;
}

#wandLayer .wand {
  position: relative;
  font-size: 80px;
  filter: var(--wand-shadow);

  /* IMPORTANT */
  transform-origin: 72% 32%;
  /* tip leads the motion */
  will-change: transform;
}

/* One-time dramatic cast when wand appears */
.wand.is-casting {
  animation: wandCast 920ms cubic-bezier(.2, .9, .2, 1) both;
}

/* Subtle looping motion while waiting for spell */
.wand.is-idle {
  animation: wandIdle 1600ms ease-in-out infinite;
}

@keyframes wandCast {
  0% {
    transform: translate3d(0, 10px, 0) rotate(-18deg) rotateX(12deg);
  }

  30% {
    transform: translate3d(-10px, -8px, 0) rotate(-36deg) rotateX(18deg);
  }

  60% {
    transform: translate3d(14px, -18px, 0) rotate(26deg) rotateX(-14deg);
  }

  78% {
    transform: translate3d(4px, -6px, 0) rotate(12deg) rotateX(-6deg);
  }

  100% {
    transform: translate3d(0, 0, 0) rotate(0deg) rotateX(0deg);
  }
}

/* Figure-8 idle motion (syncs with glowPulse at 1600ms) */
@keyframes wandIdle {
  0% {
    transform: translate3d(0px, 0px, 0) rotate(-10deg);
  }

  12.5% {
    transform: translate3d(10px, -6px, 0) rotate(6deg);
  }

  25% {
    transform: translate3d(18px, 2px, 0) rotate(14deg);
  }

  37.5% {
    transform: translate3d(10px, 10px, 0) rotate(4deg);
  }

  50% {
    transform: translate3d(0px, 0px, 0) rotate(-10deg);
  }

  62.5% {
    transform: translate3d(-10px, -6px, 0) rotate(-2deg);
  }

  75% {
    transform: translate3d(-18px, 2px, 0) rotate(-14deg);
  }

  87.5% {
    transform: translate3d(-10px, 10px, 0) rotate(-4deg);
  }

  100% {
    transform: translate3d(0px, 0px, 0) rotate(-10deg);
  }
}

/* Glow at the tip */
.wand-glow {
  position: absolute;
  right: -120px;
  top: -120px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  opacity: var(--glowA, 0);
  background: rgba(255, 255, 255, .95);
  filter: blur(10px);
  box-shadow:
    0 0 var(--glowB, 0px) rgba(255, 255, 255, .95),
    0 0 var(--glowC, 0px) rgba(255, 255, 255, .85);
}

/* =========================
   GLOW SYNC WITH WAND MOTION
   - keeps your JS intensity vars working
   - adds a synced pulse on top
========================= */
.wand-glow::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  filter: blur(14px);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.wand.is-idle .wand-glow {
  animation: glowPulse 1600ms ease-in-out infinite;
}

.wand.is-idle .wand-glow::after {
  animation: glowBloom 1600ms ease-in-out infinite;
}

.wand.is-casting .wand-glow {
  animation: glowCast 920ms cubic-bezier(.2, .9, .2, 1) both;
}

.wand.is-casting .wand-glow::after {
  animation: glowBloomCast 920ms cubic-bezier(.2, .9, .2, 1) both;
}

@keyframes glowPulse {
  0% {
    transform: scale(0.92);
  }

  25% {
    transform: scale(1.05);
  }

  50% {
    transform: scale(0.95);
  }

  75% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(0.92);
  }
}

@keyframes glowBloom {
  0% {
    opacity: 0.05;
    transform: scale(0.90);
  }

  25% {
    opacity: 0.22;
    transform: scale(1.10);
  }

  50% {
    opacity: 0.10;
    transform: scale(0.96);
  }

  75% {
    opacity: 0.26;
    transform: scale(1.14);
  }

  100% {
    opacity: 0.05;
    transform: scale(0.90);
  }
}

@keyframes glowCast {
  0% {
    transform: scale(0.9);
  }

  35% {
    transform: scale(1.15);
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1.0);
  }
}

@keyframes glowBloomCast {
  0% {
    opacity: 0.08;
    transform: scale(0.9);
  }

  40% {
    opacity: 0.38;
    transform: scale(1.25);
  }

  75% {
    opacity: 0.18;
    transform: scale(1.10);
  }

  100% {
    opacity: 0.00;
    transform: scale(1.0);
  }
}

/* Hint */
#wandLayer .spell-hint {
  position: relative;
  transform: none;
  padding: 14px 20px;
  text-align: center;
  border-radius: 16px;
  background: var(--wand-hint-bg);
  border: 1px solid var(--wand-hint-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  font-weight: 900;
  font-size: 18px;
  color: var(--wand-hint-text);
}

.spell-hint .progress {
  margin-left: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--wand-progress);
}

/* =========================
   FLASHBANG
========================= */
.flashbang {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: var(--flash);
  opacity: 0;
  pointer-events: none;
}

.flashbang.is-flash {
  transition: opacity 220ms ease;
  opacity: 1;
}

.flashbang.is-fade {
  transition: opacity 1000ms ease;
  opacity: 0;
}

/* =========================
   CHAOS DROPLET FALL (PAGE)
========================= */
body.chaos {
  background: var(--chaos-bg);
}

body.chaos header,
body.chaos main,
body.chaos footer {
  filter: brightness(0.92) saturate(0.9);
}

body.chaos .bg-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--chaos-dim);
}

body.chaos .blur-layer {
  transform: none !important;
  filter: none !important;
}

body.chaos .drop {
  transform-origin: 50% 0%;
  will-change: transform, opacity, filter;

  transition-property: transform, opacity, filter;
  transition-duration: 2600ms;
  transition-timing-function: cubic-bezier(.12, .02, .10, 1);
  transition-delay: var(--d, 0ms);

  transform: perspective(1200px) translate3d(0, 22vh, 0) rotateX(76deg) rotateZ(-6deg) scale(0.55);
  opacity: 0.94;
  filter: blur(.15px);
}

body.chaos .drop {
  animation:
    dropletRumble 650ms ease-in-out 1,
    dropletThud 520ms cubic-bezier(.2, .9, .2, 1) 1;
  animation-delay:
    var(--d, 0ms),
    calc(var(--d, 0ms) + 1900ms);
}

@keyframes dropletRumble {
  0% {
    transform: perspective(1200px) translate3d(0, 0, 0) rotateX(0) rotateZ(0) scale(1);
  }

  12% {
    transform: perspective(1200px) translate3d(2px, 1px, 0) rotateX(8deg) rotateZ(-2deg) scale(.98);
  }

  24% {
    transform: perspective(1200px) translate3d(-3px, 1px, 0) rotateX(14deg) rotateZ(2deg) scale(.98);
  }

  36% {
    transform: perspective(1200px) translate3d(3px, -1px, 0) rotateX(18deg) rotateZ(-2deg) scale(.98);
  }

  52% {
    transform: perspective(1200px) translate3d(-2px, 2px, 0) rotateX(22deg) rotateZ(2deg) scale(.98);
  }

  70% {
    transform: perspective(1200px) translate3d(2px, -2px, 0) rotateX(26deg) rotateZ(-2deg) scale(.98);
  }

  100% {
    transform: perspective(1200px) translate3d(0, 22vh, 0) rotateX(76deg) rotateZ(-6deg) scale(0.55);
  }
}

@keyframes dropletThud {
  0% {}

  45% {
    transform: perspective(1200px) translate3d(0, calc(22vh + 8px), 0) rotateX(78deg) rotateZ(-6deg) scale(0.55);
  }

  78% {
    transform: perspective(1200px) translate3d(0, calc(22vh - 5px), 0) rotateX(74deg) rotateZ(-6deg) scale(0.55);
  }

  100% {}
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}
/* Hide gamification button on touch devices (mobile + tablet) */
@media (hover: none) and (pointer: coarse){
  .dont-press{
    display: none !important;
  }
}


