*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg-page: #DCE8E4;
  --bg-card: rgba(255, 250, 232, 0.72);
  --bg-card-strong: rgba(255, 250, 232, 0.78);
  --bd-card: rgba(210, 175, 95, 0.45);
  --bd-card-soft: rgba(210, 175, 95, 0.30);
  --bd-card-mid: rgba(210, 175, 95, 0.38);
  --tx-primary: var(--ink);
  --tx-secondary: var(--ink-2);
  --tx-muted: var(--muted);
  --tx-accent: var(--accent);
  --bg-accent: var(--accent);
  --tx-on-accent: #fff;
  --shadow-card: 0 12px 28px rgba(160, 110, 30, 0.10);
  --shadow-form: 0 12px 32px rgba(160, 110, 30, 0.10);
  --overlay-top: rgba(120, 90, 30, 0.32);
  --overlay-bot: rgba(140, 100, 30, 0.42);
  --overlay-glow: rgba(255, 220, 140, 0.22);
  --particle-rgb: 39, 110, 80;
  --particle-glow: 0.18;
}

[data-theme="dark"] {
  --bg-page: #0A1628;
  --bg-card: rgba(252, 248, 230, 0.14);
  --bg-card-strong: rgba(252, 248, 230, 0.18);
  --bd-card: rgba(255, 245, 210, 0.32);
  --bd-card-soft: rgba(255, 245, 210, 0.22);
  --bd-card-mid: rgba(255, 245, 210, 0.26);
  --tx-primary: #E8E0C8;
  --tx-secondary: #C9C1A8;
  --tx-muted: #A39C84;
  --tx-accent: #FFE9A8;
  --bg-accent: #F5D680;
  --tx-on-accent: #1A1408;
  --shadow-card: 0 12px 28px rgba(0,0,0,0.5);
  --shadow-form: 0 12px 32px rgba(0,0,0,0.55);
  --overlay-top: rgba(8, 18, 36, 0.5);
  --overlay-bot: rgba(8, 18, 36, 0.7);
  --overlay-glow: rgba(255, 240, 200, 0.10);
  --particle-rgb: 255, 240, 200;
  --particle-glow: 0.22;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--tx-primary);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  transition: background-color 900ms cubic-bezier(0.4, 0, 0.2, 1), color 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#v6-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.v6-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 110%, var(--overlay-glow), transparent 50%),
    linear-gradient(180deg, var(--overlay-top), transparent 30%, transparent 70%, var(--overlay-bot));
  pointer-events: none;
  transition: background 400ms ease;
}

.v6-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.55;
  transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1), filter 900ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  overflow: visible;
}

.v6-clouds .blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: multiply;
  animation: cloudDrift var(--dur, 80s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
  transition: background 900ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

[data-theme="dark"] .v6-clouds {
  filter: blur(140px);
  opacity: 0.7;
}

.v6-clouds .c1 { width: 95%; height: 45%; top: -25%; left: -25%; background: rgba(140, 100, 40, 0.40); --dur: 90s; --del: 0s; }
.v6-clouds .c2 { width: 85%; height: 42%; top: -22%; left: 35%; background: rgba(160, 120, 50, 0.32); --dur: 110s; --del: -30s; }
.v6-clouds .c3 { width: 100%; height: 48%; bottom: -25%; left: -10%; background: rgba(130, 95, 35, 0.40); --dur: 130s; --del: -60s; }
.v6-clouds .c4 { width: 80%; height: 42%; bottom: -22%; left: 45%; background: rgba(150, 110, 45, 0.36); --dur: 100s; --del: -15s; }

[data-theme="dark"] .v6-clouds .c1 { background: rgba(4, 8, 18, 0.65); }
[data-theme="dark"] .v6-clouds .c2 { background: rgba(6, 10, 22, 0.60); }
[data-theme="dark"] .v6-clouds .c3 { background: rgba(4, 8, 18, 0.65); }
[data-theme="dark"] .v6-clouds .c4 { background: rgba(6, 10, 22, 0.60); }

@keyframes cloudDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8%, -3%) scale(1.08); }
  66% { transform: translate(-5%, 4%) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

.v6-head {
  position: absolute;
  top: 36px;
  left: 56px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
}

.v6-head .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Roboto Slab', serif;
  font-weight: 500;
  font-size: 16px;
}

.v6-head .brand .mark {
  width: 26px;
  height: 26px;
  background: var(--bg-accent);
  color: var(--tx-on-accent);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v6-head .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v6-head .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tx-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--bd-card-soft);
  border-radius: 999px;
}

.v6-head .pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  background: radial-gradient(circle at 35% 35%, #FFE9A8 0%, #F5B742 55%, #D89020 100%);
  box-shadow:
    0 0 12px 2px rgba(245,183,66,0.55),
    inset -1px -2px 2px rgba(180,110,20,0.4);
  animation: sunPulse 2.6s ease-in-out infinite, sunFloat 7s ease-in-out infinite;
  transition: background 400ms ease, box-shadow 400ms ease;
}

@keyframes celestialSwap {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
  45% { transform: translateY(1px) scale(0.72) rotate(90deg); opacity: 0.68; }
  100% { transform: translateY(0) scale(1) rotate(180deg); opacity: 1; }
}

@keyframes sunPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(245,183,66,0),
      0 0 10px 2px rgba(245,183,66,0.45),
      inset -1px -2px 2px rgba(180,110,20,0.4);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(245,183,66,0.10),
      0 0 20px 6px rgba(245,183,66,0.75),
      inset -1px -2px 2px rgba(180,110,20,0.4);
  }
}

@keyframes sunFloat {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-1.5px) rotate(2deg); }
  50% { transform: translateY(0.4px) rotate(-1.5deg); }
  75% { transform: translateY(-1px) rotate(1.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

[data-theme="dark"] .v6-head .pulse {
  background: radial-gradient(circle at 35% 35%, #F4F1E6 0%, #C9C4B2 55%, #8E8878 100%);
  box-shadow:
    0 0 10px 2px rgba(220,220,200,0.30),
    inset -5px -2px 0 0 rgba(10,22,40,0.98);
  animation: moonPulse 2.8s ease-in-out infinite, sunFloat 7s ease-in-out infinite;
}

.v6-head .pulse.arcing {
  animation: celestialSwap 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes moonPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(220,220,200,0),
      0 0 10px 2px rgba(220,220,200,0.30),
      inset -5px -2px 0 0 rgba(10,22,40,0.98);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(220,220,200,0.08),
      0 0 18px 5px rgba(220,220,200,0.55),
      inset -5px -2px 0 0 rgba(10,22,40,0.98);
  }
}

.v6-main {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: min(880px, calc(100% - 6rem));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.v6-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tx-accent);
  font-weight: 600;
  margin-bottom: 22px;
  opacity: 0;
  animation: v6in 0.8s ease 0.2s forwards;
}

.v6-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 7rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  color: var(--tx-primary);
  transition: color 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.v6-title > span {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  animation: v6up 0.9s cubic-bezier(0.2,0.8,0.2,1) forwards;
  transition: color 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.v6-title > span:nth-child(1) { animation-delay: 0.35s; }
.v6-title > span:nth-child(2) { animation-delay: 0.5s; color: var(--tx-accent); font-style: italic; }
.v6-title > span:nth-child(3) { animation-delay: 0.65s; }
.v6-title > span:nth-child(4) { animation-delay: 0.8s; color: var(--tx-accent); font-style: italic; }
.v6-title > span:nth-child(5) { animation-delay: 0.95s; }

.v6-title .ltr {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: ltrFloat var(--dur, 10s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
  transition: color 350ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.v6-title .ltr-0 { --dur: 9.00s; --del: -0.10s; }
.v6-title .ltr-1 { --dur: 9.70s; --del: -0.52s; }
.v6-title .ltr-2 { --dur: 10.40s; --del: -0.94s; }
.v6-title .ltr-3 { --dur: 11.10s; --del: -1.36s; }
.v6-title .ltr-4 { --dur: 11.80s; --del: -1.78s; }
.v6-title .ltr-5 { --dur: 9.35s; --del: -2.20s; }
.v6-title .ltr-6 { --dur: 10.05s; --del: -2.62s; }
.v6-title .ltr-7 { --dur: 10.75s; --del: -3.04s; }
.v6-title .ltr-8 { --dur: 11.45s; --del: -3.46s; }
.v6-title .ltr-9 { --dur: 12.15s; --del: -3.88s; }

@keyframes ltrFloat {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2.5px) rotate(1.1deg); }
  50% { transform: translateY(0.5px) rotate(-0.7deg); }
  75% { transform: translateY(-1.8px) rotate(0.9deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes v6up { to { opacity: 1; transform: translateY(0); } }
@keyframes v6in { to { opacity: 1; } }

.v6-deck {
  font-size: 17px;
  line-height: 1.65;
  color: var(--tx-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  opacity: 0;
  animation: v6in 0.8s ease 1.0s forwards;
}

.v6-form {
  position: relative;
  opacity: 0;
  animation: v6in 0.8s ease 1.15s forwards;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.v6-form .field {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bd-card);
  border-radius: 12px;
  overflow: hidden;
  padding: 4px;
  transition: border-color 200ms, background 240ms;
  box-shadow: var(--shadow-form);
}

.v6-form .field:focus-within {
  border-color: var(--bg-accent);
  box-shadow: var(--shadow-form), 0 0 0 4px rgba(var(--particle-rgb), 0.16);
}

.v6-form .cf-turnstile {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  margin-top: 0;
  max-width: 100%;
}

.v6-form input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 14px 16px;
  color: var(--tx-primary);
}

.v6-form input::placeholder {
  color: var(--tx-muted);
}

.v6-form button {
  background: var(--bg-accent);
  color: var(--tx-on-accent);
  border: 0;
  padding: 0 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  min-width: 150px;
}

.v6-form button .t1,
.v6-form button .t2 {
  display: inline-block;
  transition: transform 300ms cubic-bezier(0.2,0.8,0.2,1);
}

.v6-form button .t2 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(120%);
}

.v6-form.done button { background: #2a7a3d; }
.v6-form.done button .t1 { transform: translateY(-120%); }
.v6-form.done button .t2 { transform: translateY(0); }

.v6-form .row-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.direct-email {
  margin-top: 14px;
  padding-left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.direct-email a {
  color: var(--tx-accent);
  text-decoration: none;
  font-weight: 600;
}

.direct-email a:hover { color: var(--tx-primary); }

.v6-corner {
  position: absolute;
  bottom: clamp(16px, 3vw, 28px);
  right: clamp(16px, 4vw, 56px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(248px, calc(100% - 32px));
}

.v6-bottom-stack {
  display: contents;
}

.v6-cert {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bd-card);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  animation: v6in 0.8s ease 1.45s forwards;
}

.v6-cert .cert-seal {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--tx-accent);
}

.v6-cert .cert-seal svg {
  width: 100%;
  height: 100%;
  display: block;
}

.v6-cert .cert-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.v6-cert .cert-text strong {
  font-family: 'Roboto Slab', serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--tx-primary);
  letter-spacing: -0.005em;
}

.v6-cert .cert-text em {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 11px;
  color: var(--tx-secondary);
  margin-top: 2px;
}

.v6-cert .cert-text span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-accent);
  margin-top: 4px;
  font-weight: 600;
}

.v6-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  opacity: 0;
  animation: v6in 0.8s ease 1.3s forwards;
}

.v6-stats-left {
  position: absolute;
  bottom: clamp(16px, 3vw, 28px);
  left: clamp(16px, 4vw, 56px);
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(248px, calc(100% - 32px));
  opacity: 0;
  animation: v6in 0.8s ease 1.3s forwards;
}

.v6-stats > div,
.v6-stats-left > div {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bd-card-mid);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}

.v6-stats > div strong,
.v6-stats-left > div strong {
  display: block;
  font-family: 'Roboto Slab', serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--tx-primary);
  letter-spacing: -0.005em;
  line-height: 1.3;
  white-space: nowrap;
}

.v6-stats-left > div:not(.stat-linkedin) > strong {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.v6-stats > div span,
.v6-stats-left > div span {
  display: block;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.stat-linkedin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.li-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 350ms cubic-bezier(0.4, 0, 0.2, 1), background 250ms ease, transform 250ms ease;
}

.li-link svg {
  display: block;
}

.li-link:hover {
  background: rgba(0,0,0,0.04);
  transform: translateY(-1px);
}

[data-theme="dark"] .li-link {
  color: #F5B742;
}

[data-theme="dark"] .li-link:hover {
  background: rgba(255,255,255,0.08);
}

@media (max-width: 960px), (max-height: 720px) {
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  body {
    overflow-x: hidden;
  }

  .stage {
    position: relative;
    min-height: 100vh;
    height: auto;
  }

  #v6-canvas,
  .v6-overlay {
    position: fixed;
  }

  .v6-head {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding: 18px clamp(16px, 4vw, 56px);
  }

  .v6-head .meta {
    font-size: 9px;
    padding: 6px 10px;
  }

  .v6-main {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 720px;
    padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 56px);
    margin: 0 auto;
  }

  .v6-bottom-stack {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 0 clamp(16px, 4vw, 56px) 32px;
    width: 100%;
  }

  .v6-corner,
  .v6-stats-left {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    margin: 0 !important;
    width: min(320px, 100%) !important;
    opacity: 1 !important;
    animation: none !important;
  }

  .v6-stats-left {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .v6-cert,
  .v6-stats-left > div {
    opacity: 1 !important;
    animation: none !important;
  }
}

@media (max-width: 560px) {
  .v6-head .meta {
    font-size: 9px;
    padding: 6px 10px;
    letter-spacing: 0.14em;
  }

  .v6-form .field {
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }

  .v6-form button {
    padding: 14px;
  }

  .v6-form .row-meta {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}
