/* =========================================================
   Dr. Murat Millidere — millidere.com
   ========================================================= */

/* ---------- Self-hosted typography (subsetted, Turkish-safe) ---------- */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Space Grotesk'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/space-grotesk-500.woff2') format('woff2'); }
@font-face { font-family:'Space Grotesk'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/space-grotesk-600.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/jetbrains-mono-400.woff2') format('woff2'); }

:root {
  --bg: #07090f;
  --bg-2: #0b101c;
  --surface: #0f1626;
  --surface-2: #131c30;
  --line: #1c2640;
  --line-strong: #2a3756;
  --ink: #f2f5fb;
  --ink-2: #c9d3e6;
  --ink-3: #b3becd;           /* WCAG AA fix: was #8a97b3 */
  --ink-4: #a8b4cf;           /* WCAG AA fix: was #5d6a86 (was 3.33 ratio, now 8.68) */
  --accent: #6cc4ff;
  --accent-strong: #38bdf8;
  --gold: #f5c777;
  --gold-soft: rgba(245, 199, 119, 0.12);
  --glow: rgba(108, 196, 255, 0.18);
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1180px;
  --pad: clamp(20px, 4vw, 56px);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--ink); }

/* ---------- Page background gradient mesh ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(245, 199, 119, 0.06), transparent 65%),
    radial-gradient(900px 700px at 50% 110%, rgba(56, 189, 248, 0.06), transparent 70%);
  pointer-events: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(28, 38, 64, 0.6);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(56,189,248,0.10), rgba(56,189,248,0.02));
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { font-size: 15px; }
.nav-links { display: none; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--ink-3); }
.nav-links a:hover { color: var(--ink); }
@media (min-width: 760px) {
  .nav-links { display: inline-flex; }
}

/* ---------- Layout ---------- */
.section {
  padding: clamp(72px, 10vw, 130px) var(--pad);
  position: relative;
}
.section-alt { background: linear-gradient(180deg, rgba(15, 22, 38, 0.55), rgba(15, 22, 38, 0)); }
.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-head { margin-bottom: 56px; }
.section-head.center { text-align: center; }
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.section-sub {
  color: var(--ink-3);
  font-size: 17px;
  max-width: 640px;
  margin: 0;
}
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(60px, 12vw, 130px) var(--pad) clamp(60px, 10vw, 110px);
  min-height: 88vh;
  display: flex;
  align-items: center;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 28px;
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #58e389;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(88, 227, 137, 0.18);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(88, 227, 137, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(88, 227, 137, 0.05); }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 8.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero-title .accent {
  background: linear-gradient(180deg, #f5c777 0%, #c89a4d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 22px;
  letter-spacing: -0.005em;
}
.hero-lede {
  max-width: 680px;
  color: var(--ink-3);
  font-size: clamp(16px, 1.4vw, 18px);
  margin: 0 0 38px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(180deg, #f5c777, #d4a25a);
  color: #221705;
  box-shadow: 0 12px 28px -12px rgba(245, 199, 119, 0.55);
}
.btn-primary:hover { transform: translateY(-1px); color: #221705; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: #3b4b73; color: var(--ink); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  max-width: 620px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-num {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.meta-label {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 920px) {
  .about-grid { grid-template-columns: 1.45fr 1fr; gap: 64px; align-items: start; }
}
.about-text p {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 18px;
}
.about-text strong { color: var(--ink); font-weight: 600; }
.about-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: sticky;
  top: 90px;
}
.card-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(42, 55, 86, 0.7);
  font-size: 14px;
}
.card-row:last-child { border-bottom: 0; }
.card-row .k {
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-family: var(--font-mono);
  padding-top: 2px;
}
.card-row .v { color: var(--ink-2); }
.card-row .v a { color: var(--accent); }

/* ---------- Grids & tiles ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.tile {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: rgba(108, 196, 255, 0.35);
  background: linear-gradient(180deg, #111a2e, #15203a);
}
.tile-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  margin-bottom: 18px;
}
.tile-icon svg { width: 22px; height: 22px; }
.tile h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.tile p {
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent);
}
.tl-item {
  position: relative;
  padding: 0 0 36px 50px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
}
.tl-period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.tl-head h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.tl-org {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 12px;
}
.tl-body > p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
  max-width: 720px;
}
.tl-body strong { color: var(--ink); font-weight: 600; }

/* ---------- Papers ---------- */
.papers {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.paper {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 22, 38, 0.6);
  transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.paper:hover {
  border-color: rgba(245, 199, 119, 0.35);
  background: rgba(20, 28, 50, 0.7);
}
.paper-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.paper-body h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.paper-authors {
  color: var(--ink-2);
  font-size: 13.5px;
  margin: 0 0 4px;
}
.paper-venue {
  color: var(--ink-4);
  font-size: 13px;
  font-style: italic;
  margin: 0 0 6px;
}
.paper-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-top: 4px;
}
.papers-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
}
@media (max-width: 560px) {
  .paper { grid-template-columns: 60px 1fr; gap: 14px; padding: 18px; }
}

/* ---------- Programmes ---------- */
.prog {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(15, 22, 38, 0.4) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .25s ease, border-color .25s ease;
}
.prog:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 199, 119, 0.32);
}
.prog-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.prog h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.prog p {
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Contact ---------- */
.section-contact {
  padding-bottom: clamp(80px, 12vw, 140px);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
}
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .contact-grid { grid-template-columns: repeat(4, 1fr); } }
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 22, 38, 0.6);
  color: var(--ink);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(20, 30, 56, 0.8);
  color: var(--ink);
}
.contact-icon {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.10);
  border-radius: 10px;
}
.contact-icon svg { width: 20px; height: 20px; }
.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact-value {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
  padding: 28px var(--pad) 40px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}
.footer-sep { opacity: 0.5; }

/* ---------- Scroll-reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Focus ---------- */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  #bg-canvas { display: none; }
}

/* ---------- Mobile polish ---------- */
@media (max-width: 540px) {
  .hero-meta { grid-template-columns: 1fr; gap: 14px; }
  .meta-item { flex-direction: row; align-items: baseline; gap: 12px; }
  .about-card { position: static; }
}

/* =========================================================
   Hero — 3D scene mount (WebGL airfoil)
   ========================================================= */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.hero-copy { min-width: 0; position: relative; z-index: 1; }
.hero-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 280px;
  pointer-events: none;
}
.hero-scene > canvas,
.hero-scene > img,
.hero-scene > svg { width: 100%; height: 100%; display: block; }

@media (max-width: 860px) {
  .hero { position: relative; overflow: hidden; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.28;
    aspect-ratio: auto;
    min-height: 0;
  }
}

/* =========================================================
   Visualisations — engineering-styled inline figures
   ========================================================= */
.viz-frame {
  margin: 28px 0 8px;
  padding: 18px 20px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 22, 38, 0.45);
  position: relative;
}
.viz-frame svg { width: 100%; height: auto; display: block; }
.viz-caption {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 12px;
}
.viz-trajectory-frame { max-width: 760px; }
.viz-trajectory-frame svg { aspect-ratio: 2 / 1; }
.viz-envelope-frame { max-width: 360px; margin-left: auto; margin-right: 0; }
.viz-envelope-frame svg { aspect-ratio: 7 / 5; }
.viz-histogram-frame { max-width: 420px; }
.viz-histogram-frame svg { aspect-ratio: 7 / 2; }

/* Programme schematic per .prog card */
.prog { position: relative; }
.prog-schematic {
  width: 64px; height: 64px;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 14px;
  display: block;
}
.prog-schematic object { width: 100%; height: 100%; pointer-events: none; }
@media (min-width: 720px) {
  .prog-schematic {
    position: absolute;
    top: 22px; right: 22px;
    width: 72px; height: 72px;
    margin-bottom: 0;
  }
  .prog h3, .prog-meta { padding-right: 88px; }
}

/* =========================================================
   Motion stack (Lenis smooth scroll, reveals, cursor, loader)
   namespaced — coexists with the original .reveal pipeline
   ========================================================= */

html.motion-loading { overflow: hidden; }
html.motion-loading body { overflow: hidden; }

.motion-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--bg, #07090f);
  color: var(--ink, #f2f5fb);
  will-change: opacity;
}
.motion-loader-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.motion-loader-monogram {
  width: 36px; height: 36px;
  color: var(--accent, #6cc4ff);
  border: 1px solid var(--line-strong, #2a3756);
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(56,189,248,0.10), rgba(56,189,248,0.02));
  opacity: 0;
}
.motion-loader-monogram svg { width: 22px; height: 22px; }
.motion-loader-track {
  position: relative; width: 200px; height: 1px;
  background: rgba(245, 199, 119, 0.08);
  border-radius: 1px; overflow: hidden;
}
.motion-loader-line {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(245,199,119,0), rgba(245,199,119,0.95) 50%, rgba(245,199,119,0));
}

.motion-scroll-progress {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 2px; z-index: 60;
  pointer-events: none;
  background: rgba(245, 199, 119, 0.06);
}
.motion-scroll-progress-fill {
  display: block; width: 100%; height: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(245,199,119,0) 0%, rgba(245,199,119,0.85) 35%, rgba(245,199,119,1) 70%, rgba(245,199,119,0.85) 100%);
  will-change: transform;
}

.nav.nav-scrolled {
  background: rgba(7, 9, 15, 0.88);
  border-bottom-color: rgba(28, 38, 64, 0.9);
  box-shadow: 0 6px 24px -18px rgba(0, 0, 0, 0.7);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .motion-reveal {
    opacity: 0; transform: translateY(16px);
    transition: opacity .8s cubic-bezier(.22,.61,.36,1) var(--motion-reveal-delay, 0ms),
                transform .8s cubic-bezier(.22,.61,.36,1) var(--motion-reveal-delay, 0ms);
    will-change: opacity, transform;
  }
  .motion-reveal.motion-reveal-in { opacity: 1; transform: none; }
  .motion-reveal-eyebrow {
    display: inline-block; opacity: 0; transform: translateX(-20px);
    transition: opacity .7s cubic-bezier(.22,.61,.36,1) 80ms,
                transform .7s cubic-bezier(.22,.61,.36,1) 80ms;
  }
  .motion-reveal-eyebrow.motion-reveal-in { opacity: 1; transform: none; }
}

body.has-custom-cursor,
body.has-custom-cursor * { cursor: none !important; }
body.has-custom-cursor input,
body.has-custom-cursor textarea,
body.has-custom-cursor [contenteditable="true"] { cursor: text !important; }

.motion-cursor-dot,
.motion-cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  opacity: 0; transition: opacity .25s ease;
  will-change: transform;
}
.motion-cursor-dot.is-visible,
.motion-cursor-ring.is-visible { opacity: 1; }
.motion-cursor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink, #f2f5fb);
  transition: opacity .2s ease, background-color .2s ease, transform .05s linear;
}
.motion-cursor-dot.is-hidden { opacity: 0; }
.motion-cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(242, 245, 251, 0.6);
  border-radius: 50%; background: transparent;
  transition: width .25s cubic-bezier(.22,.61,.36,1),
              height .25s cubic-bezier(.22,.61,.36,1),
              border-color .25s ease, background-color .25s ease,
              border-radius .25s ease, opacity .25s ease;
}
.motion-cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--accent, #6cc4ff);
  background: rgba(108, 196, 255, 0.06);
}
.motion-cursor-ring.is-reticle {
  width: 28px; height: 28px; border-radius: 0;
  border-color: var(--accent, #6cc4ff); background: transparent;
}
.motion-cursor-ring.is-reticle::before,
.motion-cursor-ring.is-reticle::after { content: ''; position: absolute; background: var(--accent, #6cc4ff); }
.motion-cursor-ring.is-reticle::before { left: 50%; top: -6px; bottom: -6px; width: 1px; transform: translateX(-50%); }
.motion-cursor-ring.is-reticle::after { top: 50%; left: -6px; right: -6px; height: 1px; transform: translateY(-50%); }

@media (pointer: coarse), (hover: none) {
  .motion-cursor-dot,
  .motion-cursor-ring { display: none !important; }
  body.has-custom-cursor,
  body.has-custom-cursor * { cursor: auto !important; }
}

.motion-magnetic { will-change: transform; transition: transform .25s cubic-bezier(.22,.61,.36,1); }

html.motion-focus *:focus { outline: none; }
html.motion-focus a:focus-visible,
html.motion-focus button:focus-visible,
html.motion-focus [role="button"]:focus-visible,
html.motion-focus .btn:focus-visible,
html.motion-focus .tile:focus-visible,
html.motion-focus .paper:focus-visible,
html.motion-focus .prog:focus-visible,
html.motion-focus .contact-card:focus-visible {
  outline: 2px solid var(--accent, #6cc4ff);
  outline-offset: 3px; border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(108, 196, 255, 0.15), 0 8px 28px -16px rgba(108, 196, 255, 0.55);
  transition: box-shadow .18s ease, outline-color .18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .motion-reveal,
  .motion-reveal-eyebrow { opacity: 1 !important; transform: none !important; transition: none !important; }
  .motion-loader { display: none !important; }
  .motion-cursor-dot,
  .motion-cursor-ring { display: none !important; }
  body.has-custom-cursor,
  body.has-custom-cursor * { cursor: auto !important; }
  .motion-magnetic { transform: none !important; transition: none !important; }
  .nav.nav-scrolled { transition: none !important; }
}
