/* ==========================================================================
   Katari Studios — Marketing Site
   Shares the Katari design system with katari.ai (Space Grotesk · Newsreader ·
   IBM Plex Mono; layered dark surfaces; scroll-driven rise motion), with
   AZURE as the studio's signature accent — cohesive with the katari.ai
   flagship's cool palette.
   Surfaces #080B0E / #0D1114 / #131A20 / #1B242C · text #F2F6F8 / #C7D3DB /
   #8FA3AE / #7C8994 · cyan #63E5F1 · azure #54BCED · indigo #647DED ·
   hairline rgba(255,255,255,.10)
   Motion: 400/900ms cubic-bezier(.32,0,.16,1)
   ========================================================================== */

:root {
  --bg-deep: #080B0E;
  --bg: #0D1114;
  --card: #131A20;
  --card-2: #1B242C;

  --text: #F2F6F8;
  --text-2: #C7D3DB;
  --text-3: #8FA3AE;
  --text-4: #7C8994; /* raised from #5C6A73 to meet WCAG AA (>=4.5:1) on all surfaces */

  --cyan: #63E5F1;
  --azure: #54BCED;
  --indigo: #647DED;
  --accent: #54BCED;       /* primary studio accent (azure) */

  --hair: rgba(255, 255, 255, 0.10);
  --hair-strong: rgba(255, 255, 255, 0.18);
  --grad: linear-gradient(90deg, var(--cyan), var(--azure));

  --font-sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --container: 1160px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
::selection { background: rgba(84, 188, 237, 0.32); color: var(--text); }

a { color: var(--accent); text-decoration: none; }

/* ---------- Shared bits ---------- */

.grad-text {
  color: var(--accent); /* fallback: visible solid color if background-clip:text is unsupported */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text { color: transparent; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.serif-italic {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 104px 32px;
}

.section-head { max-width: 640px; }

.section-title {
  margin: 14px 0 0;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--text);
  font-weight: 600;
}

.section-sub {
  margin: 16px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-3);
  max-width: 56ch;
}

.lead {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 56ch;
}

/* per-accent code labels + links */
.code-cyan { color: var(--cyan); }
.code-azure { color: var(--azure); }
.code-indigo { color: var(--indigo); }
.link-cyan { color: var(--cyan); }
.link-azure { color: var(--azure); }
.link-indigo { color: var(--indigo); }

/* ---------- Accessibility ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scroll-driven reveal (progressive enhancement) ---------- */

@keyframes krRise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.rise {
  animation: krRise 0.9s cubic-bezier(0.32, 0, 0.16, 1) both;
}
@supports (animation-timeline: view()) {
  .rise {
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
  .rise-32 { animation-range: entry 0% entry 32%; }
  .rise-33 { animation-range: entry 0% entry 33%; }
  .rise-34 { animation-range: entry 0% entry 34%; }
  .rise-36 { animation-range: entry 0% entry 36%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; }
}

/* ==========================================================================
   NAV
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(13, 17, 20, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.brand-name {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.brand-sub { color: var(--accent); margin-left: 2px; }

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-link { font-size: 13.5px; color: var(--text-3); transition: color 0.2s; }
.nav-link:hover { color: var(--text); }

.nav-cta {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  padding: 9px 16px;
  border: 1px solid rgba(84, 188, 237, 0.45);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-cta:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-grad-lg {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  color: #06090C;
  padding: 13px 24px;
  border-radius: 8px;
  background: var(--grad);
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-grad-lg:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(84, 188, 237, 0.28);
}

.btn-ghost-lg {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  padding: 13px 24px;
  border-radius: 8px;
  border: 1px solid var(--hair-strong);
  transition: border-color 0.2s, transform 0.2s;
}
.btn-ghost-lg:hover { border-color: var(--accent); transform: translateY(-2px); }

.btn-lg { padding: 15px 30px; font-size: 15.5px; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero { position: relative; overflow: hidden; }
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 480px at 50% -12%, rgba(84, 188, 237, 0.12), transparent 62%),
    radial-gradient(760px 380px at 82% 8%, rgba(84, 188, 237, 0.07), transparent 66%);
}
.hero-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 32px 72px;
}
.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.hero-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-3);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 7px 15px;
}
.hero-title {
  margin: 0;
  max-width: 900px;
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
.hero-title .serif-italic { font-weight: 400; letter-spacing: -0.01em; }
.hero-sub {
  margin: 0;
  max-width: 640px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-2);
}
.hero-ctas { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }

/* ---- portfolio marquee ---- */
.marquee {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 18px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 40px;
  width: max-content;
  animation: krMarquee 30s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-4);
  white-space: nowrap;
}
.marquee-dot { color: var(--accent); opacity: 0.6; font-size: 8px; }
@keyframes krMarquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ==========================================================================
   STUDIO / ABOUT
   ========================================================================== */

.studio-section { border-top: 1px solid rgba(255, 255, 255, 0.06); background: var(--bg-deep); }
.studio-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}
.studio-body .lead { color: var(--text-2); }
.studio-note {
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-3);
  max-width: 56ch;
}
.studio-note .serif-italic { color: var(--text-2); }

.stats {
  display: flex;
  gap: 48px;
  margin: 44px 0 0;
  flex-wrap: wrap;
}
.stat { margin: 0; display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat-label { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-4); }

/* ==========================================================================
   VENTURES
   ========================================================================== */

.ventures-section { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.ventures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 52px;
}
.venture {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  padding: 30px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.venture:hover {
  transform: translateY(-4px);
  border-color: var(--hair-strong);
}
.venture-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.venture-code { font-family: var(--font-mono); font-size: 12px; }
.venture-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-4);
}
.venture-name { margin: 0 0 10px; font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.venture-desc { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--text-3); }
.venture-link {
  margin-top: auto;
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
}
.venture-link:hover { opacity: 0.75; }

/* ==========================================================================
   APPROACH
   ========================================================================== */

.approach-section { border-top: 1px solid rgba(255, 255, 255, 0.06); background: var(--bg-deep); }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 52px 0 0;
  padding: 0;
  list-style: none;
}
.step {
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  padding: 28px;
}
.step-num { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; }
.step-name { margin: 14px 0 10px; font-size: 19px; font-weight: 600; color: var(--text); }
.step-desc { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-3); }

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-section {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.contact-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(820px 380px at 50% 128%, rgba(84, 188, 237, 0.13), transparent 64%);
}
.contact-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 116px 32px 120px;
  text-align: center;
}
.contact-title { margin: 14px 0 0; font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.contact-sub { margin: 16px auto 32px; max-width: 46ch; font-size: 15.5px; line-height: 1.65; color: var(--text-3); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer { border-top: 1px solid var(--hair); background: var(--bg-deep); }
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 32px 36px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-blurb { margin: 0; max-width: 34ch; font-size: 14px; line-height: 1.6; color: var(--text-4); }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-h {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-4);
}
.footer-col a { font-size: 14px; color: var(--text-3); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-legal {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 32px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-4);
}

/* ==========================================================================
   404
   ========================================================================== */

.notfound {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 32px;
}
.notfound-code {
  margin: 0;
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.notfound-line {
  margin: 0;
  max-width: 460px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-2);
}
.notfound-sub { margin: 0 0 6px; max-width: 460px; font-size: 14px; line-height: 1.65; color: var(--text-3); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .studio-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .section-inner { padding: 80px 24px; }
  .hero-inner { padding: 84px 24px 52px; }
  .nav-inner { padding: 0 20px; }
  .ventures-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--hair);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  .nav-cta { margin-top: 14px; text-align: center; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .stats { gap: 32px; }
}
