@charset "UTF-8";

/* ==========================================================================
   Tokens — palette, type and spacing follow the codebucks27 reference design
   (dark #1b1b1b, light #f5f5f5, primary #B63E96 / #58E6D9, Montserrat).
   ========================================================================== */
:root {
  --light: #f5f5f5;
  --dark: #1b1b1b;
  --bg: var(--light);
  --fg: var(--dark);
  --fg-soft: rgba(27, 27, 27, 0.75);
  --fg-faint: rgba(27, 27, 27, 0.1);
  --primary: #b63e96;
  --on-primary: #ffffff;
  --circular: repeating-radial-gradient(rgba(0, 0, 0, 0.4) 2px, var(--light) 5px, var(--light) 100px);
  --header-bg: rgba(245, 245, 245, 0.86);
  --font: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  --gutter: 8rem;
  --header-space: 5.25rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: var(--dark);
  --fg: var(--light);
  --fg-soft: rgba(245, 245, 245, 0.75);
  --fg-faint: rgba(245, 245, 245, 0.12);
  --primary: #58e6d9;
  --on-primary: #1b1b1b;
  --circular: repeating-radial-gradient(rgba(255, 255, 255, 0.5) 2px, var(--dark) 8px, var(--dark) 100px);
  --header-bg: rgba(27, 27, 27, 0.86);
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-weight: 500;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--primary); color: var(--on-primary); }

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 400;
  top: 1rem;
  left: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--fg);
  color: var(--bg);
}

.container {
  width: 100%;
  max-width: 1536px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-top: 9rem; }

/* ==========================================================================
   Page-load transition (reference TransitionEffect: primary, light, dark wipes)
   ========================================================================== */
.page-transition span {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  transform-origin: left center;
  animation: wipe 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.page-transition span:nth-child(1) { z-index: 302; background: #b63e96; }
.page-transition span:nth-child(2) { z-index: 301; background: #f5f5f5; animation-delay: 0.2s; }
.page-transition span:nth-child(3) { z-index: 300; background: #1b1b1b; animation-delay: 0.4s; }

@keyframes wipe {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); visibility: hidden; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  transition: box-shadow 0.3s ease, background-color 0.35s ease;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--fg-faint); }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1536px;
  margin-inline: auto;
  /* Fixed height: the sticky header stays in flow, so changing its padding on scroll would shift the page. */
  padding: 1.25rem var(--gutter);
}

.site-nav { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-socials { display: none; }

.nav-link { position: relative; font-weight: 500; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.is-active::after { width: 100%; }

.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #1b1b1b;
  color: #f5f5f5;
  font-size: 1.5rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), font-size 0.3s var(--ease-out);
}
:root[data-theme='dark'] .logo { border-color: var(--light); }
.logo:hover { animation: logo-rainbow 1s linear infinite; }
.site-header.is-scrolled .logo { width: 3.25rem; height: 3.25rem; font-size: 1.2rem; }

@keyframes logo-rainbow {
  0%, 100% { background: #121212; }
  20% { background: rgb(131, 58, 180); }
  40% { background: rgb(253, 29, 29); }
  60% { background: rgb(252, 176, 69); }
  80% { background: rgb(131, 58, 180); }
}

.header-tools { display: flex; align-items: center; gap: 0.35rem; }

.social-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  transition: transform 0.2s var(--ease-spring);
}
.social-icon svg { width: 1.5rem; height: 1.5rem; }
.social-icon:hover { transform: translateY(-3px); }
.social-icon:active { transform: scale(0.9); }

.language-toggle {
  height: 2.25rem;
  min-width: 2.75rem;
  margin-left: 0.5rem;
  padding: 0 0.7rem;
  border: 1.5px solid var(--fg);
  border-radius: 999px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.language-toggle:hover { background: var(--fg); color: var(--bg); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: 0.35rem;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  transition: transform 0.4s var(--ease-spring), background-color 0.35s ease;
}
.theme-toggle:hover { transform: rotate(-18deg) scale(1.06); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 1.3rem;
  height: 1.3rem;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s ease;
}
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
:root[data-theme='dark'] .theme-toggle .icon-sun { opacity: 1; transform: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

.menu-toggle { display: none; }

/* ==========================================================================
   Shared type and controls
   ========================================================================== */
.page-title {
  margin-bottom: 4rem;
  font-size: clamp(2.5rem, 5.6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-align: center;
}

.section-title {
  margin-bottom: 1rem;
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
}

.section-lede {
  max-width: 44rem;
  margin: 0 auto 5rem;
  color: var(--fg-soft);
  font-size: 1.125rem;
  text-align: center;
}
.page-title + .section-lede { margin-top: -2rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.625rem 1.5rem;
  border: 2px solid var(--fg);
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.button svg { width: 1.2rem; height: 1.2rem; }
.button-solid { background: var(--fg); color: var(--bg); }
.button-solid:hover { background: var(--bg); color: var(--fg); }
.button-outline { background: transparent; color: var(--fg); }
.button-outline:hover { background: var(--fg); color: var(--bg); }

.text-button {
  font-size: 1.125rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  transition: color 0.2s ease;
}
.text-button:hover { color: var(--primary); }

.pulse-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2.2s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); }
  80%, 100% { box-shadow: 0 0 0 0.6rem color-mix(in srgb, var(--primary) 0%, transparent); }
}

/* Offset "block shadow" card from the reference: a darker plate peeking out right and bottom. */
.card {
  --card-radius: 1.5rem;
  position: relative;
  isolation: isolate;
  border-radius: var(--card-radius);
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: var(--card-border, 1px) solid var(--fg);
  border-radius: inherit;
  background: var(--bg);
  transition: background-color 0.35s ease;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: -0.75rem;
  z-index: -2;
  width: 101%;
  height: 103%;
  border-radius: calc(var(--card-radius) + 1rem);
  background: var(--fg);
}

/* ==========================================================================
   Motion primitives (word-by-word headlines, reveal on scroll)
   ========================================================================== */
.word { display: inline-block; }
.js .animated-text .word { opacity: 0; transform: translateY(50px); }
.js .animated-text.is-visible .word {
  animation: word-in 0.65s var(--ease-out) both;
  animation-delay: calc(var(--base-delay, 0s) + var(--i, 0) * 80ms);
}
@keyframes word-in {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: none; }
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s var(--ease-out), transform 0.9s var(--ease-spring);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive — breakpoints mirror the reference (xl 1279, lg 1023, md 767, sm 639, xs 479)
   ========================================================================== */
@media (max-width: 1279px) {
  :root { --gutter: 6rem; }
  .header-inner { padding-inline: 3rem; }
  .nav-links { gap: 1.35rem; }
}

@media (max-width: 1023px) {
  :root { --gutter: 4rem; --header-space: 5rem; }

  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .header-inner { padding: 1.25rem var(--gutter); }
  .menu-toggle {
    position: relative;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .menu-toggle span { width: 1.5rem; height: 2px; border-radius: 2px; background: var(--fg); transition: transform 0.3s ease, opacity 0.3s ease; }
  .menu-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Reference mobile menu: a centred blurred panel. The header drops its backdrop-filter
     above so this fixed panel is positioned against the viewport rather than the header. */
  .site-nav {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 70;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    min-width: min(70vw, 28rem);
    padding: 5rem 2rem;
    border-radius: 0.75rem;
    background: rgba(27, 27, 27, 0.92);
    color: #f5f5f5;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: opacity 0.25s ease, transform 0.35s var(--ease-spring), visibility 0.35s;
  }
  :root[data-theme='dark'] .site-nav { background: rgba(245, 245, 245, 0.8); color: #1b1b1b; }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
  /* The panel inverts the page colours, so the focus ring must invert too. */
  .site-nav :focus-visible { outline-color: #f5f5f5; }
  :root[data-theme='dark'] .site-nav :focus-visible { outline-color: #1b1b1b; }
  .nav-links { flex-direction: column; gap: 1.25rem; font-size: 1.25rem; }
  .nav-socials { display: flex; gap: 0.75rem; }
  .header-tools .social-icon { display: none; }
}

@media (max-width: 767px) {
  :root { --gutter: 2rem; }
  .section { padding-top: 6rem; }
  .page-title { margin-bottom: 3rem; }
  .page-title + .section-lede { margin-top: -1.5rem; }
  .section-lede { margin-bottom: 3.5rem; font-size: 1rem; }
}

@media (max-width: 479px) {
  :root { --gutter: 1.25rem; }
  .header-inner { padding-inline: var(--gutter); }
  .button, .text-button { font-size: 1rem; }
  .card::before { right: -0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .page-transition { display: none; }
}
