/* =========================================================
   Claustar — shared design system
   Glass-morphism + modern legal aesthetic
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* palette — light / paper base */
  --ink-0: #f9f9f7;
  /* page bg (was dark) — now warm paper */
  --ink-1: #f2f2ef;
  --ink-2: #e0e0db;
  --ink-3: #d1d1cb;
  --paper: #1c1c1c;
  /* text (was paper) — now warm near-black */
  --paper-dim: rgba(28, 28, 28, 0.72);
  --paper-faint: rgba(28, 28, 28, 0.48);
  --paper-faintest: rgba(28, 28, 28, 0.28);

  /* accent — monochrome, mapped to ink so old "sage" refs become dark */
  --sage: #a67c52;
  --sage-deep: #a67c52;
  --sage-glow: rgba(166, 124, 82, 0.12);
  --accent: #243342;
  --accent-dim: rgba(36, 51, 66, 0.72);

  /* glass (on light bg — tint toward ink) */
  --glass: rgba(28, 28, 28, 0.04);
  --glass-strong: rgba(28, 28, 28, 0.08);
  --glass-border: rgba(28, 28, 28, 0.12);
  --glass-border-soft: rgba(28, 28, 28, 0.06);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* type */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* radii + shadow */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-lg: 0 20px 60px rgba(28, 28, 28, 0.08);
  --shadow-md: 0 8px 28px rgba(28, 28, 28, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  color: var(--paper);
  background: var(--ink-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}

/* =========================================================
   Ambient background (non-hero pages)
   ========================================================= */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(28, 28, 28, 0.04), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(28, 28, 28, 0.03), transparent 50%),
    var(--ink-0);
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}

.ambient::before {
  top: -20%;
  left: -20%;
  background: radial-gradient(circle, rgba(28, 28, 28, 0.06), transparent 60%);
}

.ambient::after {
  bottom: -30%;
  right: -20%;
  background: radial-gradient(circle, rgba(28, 28, 28, 0.04), transparent 60%);
  animation-delay: -12s;
}

.ambient .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 28, 28, 0.033) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 28, 28, 0.033) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5%, 3%) scale(1.1);
  }
}

/* Video bg (landing hero) — light theme: hide the video, use soft paper gradient */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, #fbf8ee, transparent 55%),
    radial-gradient(ellipse at 85% 90%, #eee8d7, transparent 60%),
    linear-gradient(180deg, #f7f5ee, #efece3);
}

.bg-video video {
  display: none;
}

.bg-video video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 104%;
  min-height: 104%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: saturate(1.05);
}

.bg-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(247, 245, 238, 0.25) 60%, rgba(247, 245, 238, 0.55) 100%),
    linear-gradient(to bottom, rgba(247, 245, 238, 0.15), transparent 30%, transparent 70%, rgba(247, 245, 238, 0.4));
}

/* =========================================================
   Navigation
   ========================================================= */
.nav-wrap {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
  animation: fadeDown .9s cubic-bezier(.2, .7, .2, 1) .1s both;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  box-shadow: var(--glass-inner);
  transition: background .25s ease;
}

.logo-mark:hover {
  background: var(--glass-strong);
}

.logo-mark .glyph {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background-image: url('icon-black.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 8px rgba(28, 28, 28, 0.08));
}

.logo-mark .glyph {
  font-size: 0;
  color: transparent;
}

.logo-mark .word {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md), var(--glass-inner);
  position: relative;
}

.nav a.nav-link,
.nav a.nav-signin {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  color: var(--paper);
  letter-spacing: 0.01em;
  transition: color .2s ease;
  z-index: 1;
  white-space: nowrap;
}

.nav a.nav-signin {
  color: var(--paper-dim);
  padding-left: 18px;
}

.nav a.active {
  color: var(--ink-0);
}

.nav-pill {
  position: absolute;
  top: 6px;
  height: calc(100% - 12px);
  background: rgba(28, 28, 28, 0.08);
  border: 1px solid rgba(28, 28, 28, 0.12);
  border-radius: var(--r-pill);
  transition: left .35s cubic-bezier(.2, .8, .2, 1),
    width .35s cubic-bezier(.2, .8, .2, 1),
    opacity .25s ease;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.nav:hover .nav-pill {
  opacity: 1;
}

.nav .cta {
  background: var(--accent);
  color: var(--ink-0);
  padding: 10px 16px 10px 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  border-radius: var(--r-pill);
  transition: background .25s ease, transform .25s ease;
  font-size: 14px;
}

.nav .cta:hover {
  background: #000;
  transform: translateY(-1px);
}

.nav .cta .arr {
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  display: inline-block;
}

.nav .cta:hover .arr {
  transform: translate(2px, -2px);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--paper);
  position: relative;
}

.hamburger span::before,
.hamburger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.5px;
  background: var(--paper);
}

.hamburger span::before {
  top: -5px;
}

.hamburger span::after {
  top: 5px;
}

/* =========================================================
   Typography helpers
   ========================================================= */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--accent);
}

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

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--paper-faint);
  vertical-align: middle;
  margin-right: 10px;
}

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--paper-dim);
  text-wrap: pretty;
}

.h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  color: var(--accent);
}

/* text-mask reveal */
.line {
  display: block;
  overflow: hidden;
}

.line.revealed {
  overflow: visible;
}

.line>span {
  display: inline-block;
  transform: translateY(110%);
  animation: riseIn 1s cubic-bezier(.2, .75, .2, 1) forwards;
}

@keyframes riseIn {
  to {
    transform: translateY(0);
  }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--paper);
  box-shadow: var(--glass-inner);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
  border-color: rgba(28, 28, 28, 0.308);
}

.btn .arr {
  display: inline-block;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.btn:hover .arr {
  transform: translate(2px, -2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink-0);
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(36, 51, 66, 0.12), var(--glass-inner);
}

.btn-primary:hover {
  background: var(--accent-dim);
  border-color: transparent;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 14px 18px;
}

.btn-ghost:hover {
  background: var(--glass);
  border-color: var(--glass-border-soft);
}

/* =========================================================
   Glass card
   ========================================================= */
.card {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-inner);
  padding: 28px;
  transition: background .3s ease, transform .3s ease, border-color .3s ease;
}

.card:hover {
  background: var(--glass-strong);
  border-color: rgba(28, 28, 28, 0.242);
}

.card-hover:hover {
  transform: translateY(-3px);
}

/* Badge pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--paper-dim);
  box-shadow: var(--glass-inner);
}

.badge .tag {
  background: var(--paper);
  color: var(--ink-0);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =========================================================
   Layout
   ========================================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 120px 0;
  position: relative;
}

.section-sm {
  padding: 80px 0;
}

.section-head {
  max-width: 740px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-head .eyebrow {
  margin-bottom: 16px;
  display: inline-block;
}

.section-head .lede {
  margin-top: 20px;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  position: relative;
  padding: 80px 0 32px;
  border-top: 1px solid var(--glass-border-soft);
  background: rgba(247, 245, 238, 0.6);
  backdrop-filter: blur(10px);
}

.footer .f-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer .tag {
  max-width: 340px;
  color: var(--paper-dim);
  font-size: 14px;
  margin-top: 20px;
  line-height: 1.6;
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: 20px;
  font-weight: 500;
}

.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer ul a {
  color: var(--paper);
  font-size: 14px;
  transition: color .2s ease;
  position: relative;
}

.footer ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--paper);
  transition: width .3s ease;
}

.footer ul a:hover::after {
  width: 100%;
}

.footer .f-bot {
  padding-top: 28px;
  border-top: 1px solid var(--glass-border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--paper-faint);
}

.footer .socials {
  display: flex;
  gap: 10px;
}

.footer .socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  transition: background .2s ease, transform .25s ease;
}

.footer .socials a:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
}

/* =========================================================
   Entry animations
   ========================================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .75, .2, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger helpers */
.stagger>* {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp .8s cubic-bezier(.2, .7, .2, 1) forwards;
}

.stagger>*:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
  animation-delay: 0.12s;
}

.stagger>*:nth-child(3) {
  animation-delay: 0.19s;
}

.stagger>*:nth-child(4) {
  animation-delay: 0.26s;
}

.stagger>*:nth-child(5) {
  animation-delay: 0.33s;
}

.stagger>*:nth-child(6) {
  animation-delay: 0.40s;
}

/* =========================================================
   Utility
   ========================================================= */
.placeholder-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background:
    repeating-linear-gradient(135deg,
      rgba(28, 28, 28, 0.044) 0 12px,
      rgba(28, 28, 28, 0.077) 12px 24px),
    var(--ink-2);
  display: grid;
  place-items: center;
  color: var(--paper-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--glass-border-soft);
  margin: 0;
}

/* =========================================================
   Bento Grid Component
   ========================================================= */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 20px;
}

.bento-card {
  padding: 36px 32px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}

.bento-card:hover {
  background: var(--glass-strong);
  transform: translateY(-2px);
}

.bento-card h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--accent);
  position: relative;
  z-index: 2;
}

.bento-card p {
  color: var(--paper-dim);
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  z-index: 2;
}

.bento-card .icon-wrap {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(28, 28, 28, 0.05);
  display: grid;
  place-items: center;
  color: var(--sage);
  z-index: 1;
}

/* Grid Spans for Bento */
.span-col-2 {
  grid-column: span 2;
}

.span-row-2 {
  grid-row: span 2;
}

/* Subtle decorative bg for bento */
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(244, 241, 232, 0.04), transparent 50%);
  pointer-events: none;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .nav-wrap {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .footer .f-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer .f-bot {
    flex-direction: column;
    gap: 14px;
  }

  .section {
    padding: 80px 0;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .bento-card.span-col-2 {
    grid-column: span 1;
  }

  .bento-card.span-row-2 {
    grid-row: span 1;
  }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(247, 245, 238, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 80px 24px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
  color: var(--paper);
}