/* ===== CalibreWorks — shared stylesheet ===== */
:root {
  --bg:     #0A0A0C;
  --text:   #ECEAE5;
  --muted:  #86868E;
  --faint:  #56565E;
  --line:   rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.16);
  --panel:  rgba(255,255,255,0.018);
  --accent: #6E86FF;
  --read:   #C7C5C0;
  --gutter: clamp(20px, 5vw, 28px);
  --maxw:   1240px;
  /* Warm cream — cinematic accent borrowed from the "Prisma" treatment */
  --cream:   #E1E0CC;
  --cream-2: #DEDBC8;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Minimal utility classes (replaces the old Tailwind CDN) =====
   Only the handful the site actually used. !important so they win over the
   inline display set on a couple of elements (e.g. the mobile menu button),
   matching the old utility-wins behaviour. */
.hidden { display: none !important; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
@media (min-width: 640px) { .sm\:inline-flex { display: inline-flex !important; } }
@media (min-width: 768px) { .md\:flex { display: flex !important; } .md\:hidden { display: none !important; } }
@media (min-width: 1024px) { .lg\:block { display: block !important; } }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; font-weight: 400; line-height: 1.5;
}
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

.serif { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }
.ital  { font-style: italic; }
.num   { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* Custom cursor */
body.cursor-on, body.cursor-on * { cursor: none !important; }
.cursor-root { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.cur-ring { position: fixed; top: 0; left: 0; border: 1px solid var(--line-2); border-radius: 50%; display: flex; align-items: center; justify-content: center; mix-blend-mode: difference; }
.cur-label { font-size: 10px; letter-spacing: 0.16em; color: #fff; text-transform: uppercase; }
.cur-dot { position: fixed; top: 0; left: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--text); }

/* Floating service preview */
.svc-preview { position: fixed; top: 0; left: 0; width: 320px; height: 220px; margin: -110px 0 0 28px; border-radius: 12px; overflow: hidden; pointer-events: none; z-index: 90; border: 1px solid var(--line); }

/* Ambient */
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.4; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E"); background-size: 220px; }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(620px 420px at 50% -8%, rgba(110,134,255,0.10), transparent 70%), radial-gradient(900px 600px at 100% 120%, rgba(255,255,255,0.02), transparent 70%); }

.panel { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ===== Floating glass navigation island ===== */
.nav-island {
  display: flex; flex-direction: column;
  width: 100%;                       /* mobile: fill the gutter width so the menu has room */
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: 0 10px 36px -10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  overflow: hidden;
}
@media (min-width: 768px) { .nav-island { width: auto; } }   /* desktop: hug content (compact pill) */
.nav-island.is-scrolled {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 14px 44px -12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 10px 12px 10px 22px; }
.nav-cta { transition: border-color 0.3s, background 0.3s; }
.nav-cta:hover { border-color: var(--line-2); background: rgba(255,255,255,0.08); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav-island { background: rgba(20,20,26,0.92); }
  .nav-island.is-scrolled { background: rgba(20,20,26,0.96); }
}
.label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* Marquee */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { animation: marquee 40s linear infinite; display: flex; width: max-content; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* Underline link */
.ul { position: relative; text-decoration: none; }
.ul::after { content: ''; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0; background: currentColor; transition: width 0.4s cubic-bezier(0.16,1,0.3,1); }
.ul:hover::after { width: 100%; }

/* Rotating badge */
@keyframes spin360 { to { transform: rotate(360deg); } }
.badge-rot svg { animation: spin360 22s linear infinite; }
.badge-rot text { fill: var(--muted); font-size: 12.5px; letter-spacing: 0.2em; font-family: 'Inter', sans-serif; }

/* Hero shader fade */
.hero-fade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(10,10,12,0.35) 0%, rgba(10,10,12,0) 26%, rgba(10,10,12,0) 58%, var(--bg) 100%); }

/* ===== Cinematic hero (Prisma-inspired) ===== */
/* Fractal-noise grain laid over the hero video (feTurbulence 0.85 / 3 octaves) */
.noise-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}
/* Subtler grain for section backgrounds (feTurbulence 0.9 / 4 octaves) */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* Full-bleed hero — background animation fills the whole section, no inset frame */
.hero-shell { padding: 0; }
.hero-frame { border-radius: 0; }
.hero-eyebrow { color: rgba(225,224,204,0.82); }

/* Prisma-style giant pull-up wordmark line.
   padding-bottom gives glyph descenders (g, j, italic tails) room so the
   overflow:hidden reveal-mask doesn't clip them; the matching negative margin
   keeps the two lines visually tight. */
.hero-word { display: block; overflow: hidden; padding-bottom: 0.16em; margin-bottom: -0.12em; }

/* Cream pill CTA with inset arrow puck */
.cta-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 24px; border-radius: 999px; background: var(--cream); color: #0A0A0C; font-size: 15px; font-weight: 600; text-decoration: none; transition: gap 0.3s cubic-bezier(0.16,1,0.3,1), background 0.3s; }
.cta-pill:hover { gap: 16px; }
.cta-puck { width: 40px; height: 40px; border-radius: 999px; background: #0A0A0C; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.cta-pill:hover .cta-puck { transform: scale(1.1); }

@media (max-width: 760px) {
  .hero-bottom-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
}

/* Client wall */
.cw-cell { display: flex; align-items: center; justify-content: center; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 9px; }
.field > label { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.field > label .req { color: var(--accent); }
.input {
  width: 100%; background: rgba(255,255,255,0.02); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  font-family: 'Inter', sans-serif; font-size: 15px; transition: border-color 0.3s, background 0.3s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--line-2); background: rgba(255,255,255,0.04); }
textarea.input { resize: vertical; min-height: 130px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* Blog */
.post-row { transition: background 0.35s ease; }
.post-row:hover { background: rgba(255,255,255,0.02); }
.cat-chip { transition: color 0.3s, border-color 0.3s, background 0.3s; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-cover { position: relative; overflow: hidden; }
.card-cover::after { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.10'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }

/* Article reading (prose) */
.prose { max-width: 720px; }
.prose .lead { font-size: clamp(19px,2.2vw,22px); line-height: 1.7; color: var(--text); margin: 0 0 32px; }
.prose p { font-size: 18px; line-height: 1.8; color: var(--read); margin: 0 0 24px; }
.prose h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(28px,3.2vw,42px); line-height: 1.1; letter-spacing: -0.01em; color: var(--text); margin: 52px 0 18px; scroll-margin-top: 100px; }
.prose h3 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(22px,2.4vw,28px); color: var(--text); margin: 36px 0 12px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; }
.prose li { font-size: 18px; line-height: 1.7; color: var(--read); margin-bottom: 10px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose blockquote { border-left: 2px solid var(--accent); margin: 40px 0; padding: 4px 0 4px 28px; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(24px,2.8vw,34px); line-height: 1.35; color: var(--text); }
.prose > p.dropcap:first-letter { font-family: 'Instrument Serif', Georgia, serif; font-size: 4.2em; line-height: 0.72; float: left; padding: 8px 14px 0 0; color: var(--text); }
.toc-link { display: block; padding: 7px 0 7px 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.4; transition: color 0.25s, border-color 0.25s; }
.toc-link:hover { color: var(--text); }
.toc-link.active { color: var(--text); border-left-color: var(--accent); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26262C; }

section { position: relative; z-index: 1; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Preloader + boot */
.preloader { position: fixed; inset: 0; z-index: 400; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 200; text-align: center; padding: 24px; }
.boot-spin { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.12); border-top-color: var(--accent); animation: boot-rot 0.8s linear infinite; }
@keyframes boot-rot { to { transform: rotate(360deg); } }
.boot p { color: var(--muted); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
