/* ==========================================================
   Bloom's Archive — styles
   Colours come from config.js (accent / accent2); the rest
   is tuned here.
   ========================================================== */

:root {
  --bg: #08080c;
  --bg-2: #0f0f16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f0f5;
  --muted: #9a97a6;
  --faint: #5f5c6b;
  --accent: #ff5c8a;
  --accent-2: #8b5cf6;
  --ok: #3ddc97;
  --warn: #f5b84b;
  --bad: #ff5c5c;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

/* Cross-document page transitions where the browser supports them */
@view-transition { navigation: auto; }

/* ---------- Background layers ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.bg__orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .32;
  will-change: transform;
}
.bg__orb--a { width: 46vmax; height: 46vmax; background: var(--accent); top: -18vmax; left: -12vmax; animation: drift-a 28s ease-in-out infinite alternate; }
.bg__orb--b { width: 40vmax; height: 40vmax; background: var(--accent-2); bottom: -20vmax; right: -14vmax; animation: drift-b 32s ease-in-out infinite alternate; }
.bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg__grain {
  position: absolute; inset: -50%; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-12vmax, -8vmax) scale(.95); } }
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-5%,3%); }
  40% { transform: translate(4%,-4%); } 60% { transform: translate(-3%,5%); }
  80% { transform: translate(5%,2%); } 100% { transform: translate(0,0); }
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
main { padding-top: 112px; padding-bottom: 80px; }
section + section { margin-top: 112px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: calc(100% - 32px); max-width: var(--maxw);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 18px;
  background: rgba(14, 14, 20, .62);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background .3s, border-color .3s;
}
.nav.is-scrolled { background: rgba(10, 10, 14, .85); border-color: var(--border-strong); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand__mark { width: 28px; height: 28px; transition: transform .8s var(--ease); }
.brand:hover .brand__mark { transform: rotate(180deg); }

.nav__links { position: relative; display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  position: relative; z-index: 1; display: block;
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; color: var(--muted); transition: color .25s;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__pill {
  position: absolute; z-index: 0; top: 0; height: 100%;
  border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border);
  transition: left .45s var(--ease), width .45s var(--ease), opacity .3s;
  opacity: 0;
}
.nav__toggle { display: none; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.03em; line-height: 1.05; margin: 0; font-weight: 600; }
.h-hero { font-size: clamp(44px, 8.5vw, 112px); }
.h-page { font-size: clamp(40px, 6.5vw, 80px); }
.h-section { font-size: clamp(28px, 3.6vw, 42px); }
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: -200% center; } }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 620px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head p { margin: 10px 0 0; color: var(--muted); }

/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: transform .35s var(--ease), background .3s, border-color .3s, box-shadow .3s;
  will-change: transform;
}
.btn:hover { background: var(--surface-2); border-color: rgba(255,255,255,.28); }
.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 40px -10px var(--accent);
}
.btn--primary:hover { box-shadow: 0 14px 50px -8px var(--accent); background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { min-height: calc(100vh - 200px); display: flex; flex-direction: column; justify-content: center; padding: 40px 0 20px; }
.hero h1 { margin: 22px 0 26px; max-width: 12ch; }
.hero .lead { margin: 0 0 38px; }
.hero__word { display: inline-block; opacity: 0; transform: translateY(40%) rotate(3deg); filter: blur(8px); animation: word-in .9s var(--ease) forwards; }
@keyframes word-in { to { opacity: 1; transform: none; filter: none; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 72px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 22px 24px; }
.stat__value { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.stat__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); padding: 18px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { font-family: var(--font-display); font-size: clamp(22px, 3vw, 34px); color: var(--faint); white-space: nowrap; display: flex; align-items: center; gap: 48px; transition: color .3s; }
.marquee__item:hover { color: var(--text); }
.marquee__item::after { content: "✦"; font-size: .55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; display: flex; flex-direction: column;
  padding: 26px; border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease), border-color .3s, background .3s;
  transform-style: preserve-3d;
  isolation: isolate;
  overflow: hidden;
}
.card::before { /* spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%);
}
.card::after { /* glowing border */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent), var(--accent-2) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.card:hover { background: var(--surface-2); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card.is-tilting { transition: transform .12s linear, border-color .3s, background .3s; }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent-2) 30%, transparent));
  border: 1px solid var(--border-strong);
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 22px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card__foot { margin-top: auto; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.card__arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); transition: transform .4s var(--ease), background .3s; }
.card__arrow svg { width: 14px; height: 14px; }
.card:hover .card__arrow { transform: rotate(-45deg); background: var(--text); color: var(--bg); }
.card--disabled { cursor: default; }
.card--disabled .card__icon { filter: grayscale(1); opacity: .6; }
.card--disabled h3 { color: var(--muted); }

/* Status pill */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--muted); white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill--online i { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite; }
.pill--online { color: var(--ok); }
.pill--offline i { background: var(--bad); }
.pill--offline { color: var(--bad); }
.pill--soon i { background: var(--warn); }
.pill--checking i { background: var(--muted); animation: blink 1s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 70%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes blink { 50% { opacity: .3; } }

/* Featured (big) service card on home */
.feature {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; padding: 0; min-height: 340px;
}
.feature__body { padding: 40px; display: flex; flex-direction: column; }
.feature__body h3 { font-size: clamp(32px, 4vw, 48px); margin: 18px 0 12px; }
.feature__visual { position: relative; border-left: 1px solid var(--border); overflow: hidden; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 70%); }
.reel { position: absolute; inset: -10% -20%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; transform: rotate(-12deg); }
.reel__col { display: flex; flex-direction: column; gap: 12px; animation: reel-up 18s linear infinite; }
.reel__col:nth-child(even) { animation-name: reel-down; }
.reel__tile { aspect-ratio: 2 / 3; border-radius: 10px; border: 1px solid var(--border); }
@keyframes reel-up { to { transform: translateY(-50%); } }
@keyframes reel-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }

/* Projects */
.project h3 { font-size: 26px; }
.project__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-size: 13px; color: var(--muted); transition: border-color .3s, color .3s, transform .3s var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.project__next { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); font-size: 14px; color: var(--muted); }
.project__next b { color: var(--text); font-weight: 500; }
.project__num { font-family: var(--font-mono); font-size: 13px; color: var(--faint); }

.ghost {
  border-style: dashed; border-color: var(--border-strong); background: transparent; min-height: 220px;
  justify-content: flex-start; align-items: flex-start;
}
.ghost__q {
  font-family: var(--font-display); font-size: 64px; line-height: 1; font-weight: 600;
  background: linear-gradient(110deg, var(--faint) 30%, var(--text) 50%, var(--faint) 70%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 3.5s ease-in-out infinite; margin-bottom: 18px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* About */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about__text p { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.about__intro { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; letter-spacing: -.015em; color: var(--text) !important; }
.avatar {
  position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--border-strong);
  background: conic-gradient(from 180deg at 50% 50%, var(--accent), var(--accent-2), var(--accent));
  display: grid; place-items: center;
}
.avatar::after { content: ""; position: absolute; inset: 2px; border-radius: 26px; background: radial-gradient(circle at 30% 20%, #1a1622, var(--bg) 70%); }
.avatar__letter { position: relative; z-index: 1; font-family: var(--font-display); font-size: clamp(110px, 16vw, 180px); font-weight: 600; letter-spacing: -.06em; }
.avatar__ring { position: absolute; z-index: 1; inset: 14%; border-radius: 50%; border: 1px dashed var(--border-strong); animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 18px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { background: var(--bg-2); padding: 16px 18px; }
.fact span { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.fact b { font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* Page header */
.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 18px 0 18px; }

/* CTA band */
.cta { text-align: center; padding: 72px 24px; border-radius: 28px; border: 1px solid var(--border); background: radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface); }
.cta h2 { margin: 14px 0 26px; }
.cta .btns { justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0 40px; color: var(--faint); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }
.footer__time { font-family: var(--font-mono); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Page transition curtain ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  display: grid; place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path .7s var(--ease);
}
.curtain__mark { width: 56px; height: 56px; animation: spin 2.4s linear infinite; opacity: .9; transition: opacity .3s; }
.curtain.is-open { clip-path: inset(0 0 100% 0); }
.curtain.is-open .curtain__mark { opacity: 0; }
.curtain.is-closing { clip-path: inset(0 0 0 0); transition: clip-path .55s var(--ease-in); }
.curtain.is-closing.from-bottom { clip-path: inset(100% 0 0 0); transition: none; }
html.no-js .curtain { display: none; }

/* ---------- Custom cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 2000; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cursor {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1px solid rgba(255,255,255,.55);
  display: grid; place-items: center;
  transition: opacity .3s, width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .3s, border-color .3s;
  mix-blend-mode: difference;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #000; opacity: 0; transition: opacity .2s; }
.has-cursor .cursor, .has-cursor .cursor-dot { opacity: 1; }
.cursor.is-hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: #fff; border-color: #fff; }
.cursor.is-hover.has-label .cursor__label { opacity: 1; }
.cursor.is-down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor-trail { position: fixed; top: 0; left: 0; z-index: 1999; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--accent); pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr; }
  .feature__visual { min-height: 220px; border-left: 0; border-top: 1px solid var(--border); }
  .about { grid-template-columns: 1fr; }
  .about__side { max-width: 420px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .wrap { padding-inline: 16px; }
  .nav { top: 10px; width: calc(100% - 20px); padding: 8px 8px 8px 14px; flex-wrap: wrap; border-radius: 26px; }
  .nav__toggle {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  }
  .nav__toggle span, .nav__toggle span::before, .nav__toggle span::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; transition: transform .3s var(--ease), background .3s; }
  .nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
  .nav__toggle span::before { top: -5px; } .nav__toggle span::after { top: 5px; }
  .nav.is-open .nav__toggle span { background: transparent; }
  .nav.is-open .nav__toggle span::before { transform: translateY(5px) rotate(45deg); }
  .nav.is-open .nav__toggle span::after { transform: translateY(-5px) rotate(-45deg); }
  .nav__links { display: none; width: 100%; flex-direction: column; padding: 8px 0 4px; }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { padding: 12px 10px; font-size: 17px; }
  .nav__pill { display: none; }
  main { padding-top: 96px; }
  section + section { margin-top: 80px; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .feature__body { padding: 26px; }
  .stats { margin-top: 48px; }
  .stat { padding: 18px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .btn { padding: 13px 18px; }
}

@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-dot, .cursor-trail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__word { opacity: 1; transform: none; filter: none; }
}
