/* ============================================================
   Lattice - relational workspace landing
   Light, crisp, product-forward. The colored select-chip palette
   IS the brand voice (Lattice is colored relational data).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

:root {
  --bg:        #ffffff;
  --surface:   oklch(0.985 0.003 285);
  --surface-2: oklch(0.965 0.005 285);
  --ink:       oklch(0.24 0.02 285);
  --muted:     oklch(0.475 0.02 285);
  --faint:     oklch(0.60 0.016 285);
  --line:      oklch(0.912 0.006 285);
  --line-2:    oklch(0.86 0.008 285);

  --primary:    oklch(0.55 0.19 285);
  --primary-hi: oklch(0.50 0.2 285);
  --primary-tint: oklch(0.955 0.02 285);

  /* Airtable-style chip palette: [text, bg] pairs */
  --c-blue:   oklch(0.5 0.15 250);   --c-blue-bg:   oklch(0.94 0.04 250);
  --c-green:  oklch(0.5 0.13 155);   --c-green-bg:  oklch(0.94 0.05 155);
  --c-purple: oklch(0.5 0.18 300);   --c-purple-bg: oklch(0.945 0.04 300);
  --c-orange: oklch(0.58 0.15 55);   --c-orange-bg: oklch(0.95 0.05 65);
  --c-red:    oklch(0.56 0.19 22);   --c-red-bg:    oklch(0.95 0.04 22);
  --c-teal:   oklch(0.55 0.1 200);   --c-teal-bg:   oklch(0.95 0.04 200);
  --c-pink:   oklch(0.58 0.18 350);  --c-pink-bg:   oklch(0.95 0.04 350);
  --c-gray:   oklch(0.5 0.01 285);   --c-gray-bg:   oklch(0.94 0.004 285);

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --shell: 1180px;
  --pad: clamp(1.15rem, 4vw, 2.25rem);
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px oklch(0.4 0.03 285 / 0.06), 0 1px 1px oklch(0.4 0.03 285 / 0.04);
  --shadow-md: 0 10px 30px -12px oklch(0.4 0.05 285 / 0.18), 0 2px 8px oklch(0.4 0.05 285 / 0.06);
  --shadow-lg: 0 30px 60px -20px oklch(0.35 0.06 285 / 0.28), 0 8px 20px oklch(0.35 0.06 285 / 0.08);
  --z-nav: 100;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: clamp(1rem, 0.97rem + 0.14vw, 1.06rem);
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 500; background: var(--primary); color: #fff; padding: 0.6rem 1rem; border-radius: var(--r-sm); font-weight: 600; transition: top 0.2s; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600;
  letter-spacing: -0.01em; white-space: nowrap;
  padding: 0.62rem 1.1rem; border-radius: var(--r-sm); border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px oklch(0.3 0.1 285 / 0.25); }
.btn--primary:hover { background: var(--primary-hi); transform: translateY(-1px); box-shadow: 0 8px 20px -8px oklch(0.5 0.19 285 / 0.55); }
.btn--ghost { background: var(--bg); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--faint); transform: translateY(-1px); }
.btn--lg { padding: 0.8rem 1.4rem; font-size: 1.03rem; }
.btn svg { transition: transform 0.25s var(--ease); }
.btn--primary:hover svg { transform: translateX(2px); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 0.8rem; font-weight: 500; line-height: 1;
  padding: 0.32em 0.62em; border-radius: 100px; white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.chip--blue   { color: var(--c-blue);   background: var(--c-blue-bg); }
.chip--green  { color: var(--c-green);  background: var(--c-green-bg); }
.chip--purple { color: var(--c-purple); background: var(--c-purple-bg); }
.chip--orange { color: var(--c-orange); background: var(--c-orange-bg); }
.chip--red    { color: var(--c-red);    background: var(--c-red-bg); }
.chip--teal   { color: var(--c-teal);   background: var(--c-teal-bg); }
.chip--pink   { color: var(--c-pink);   background: var(--c-pink-bg); }
.chip--gray   { color: var(--c-gray);   background: var(--c-gray-bg); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: var(--z-nav); background: oklch(1 0 0 / 0.8); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.nav--scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.55em; font-weight: 700; font-size: 1.16rem; letter-spacing: -0.02em; }
.brand__mark { width: 26px; height: 26px; flex-shrink: 0; }
.nav__links { display: flex; gap: 1.7rem; }
.nav__links a { font-size: 0.94rem; color: var(--muted); font-weight: 500; transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }
.nav__cta { display: flex; align-items: center; gap: 0.6rem; }
.nav__menu { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav__menu span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vh, 6.5rem) clamp(3rem, 7vh, 5rem); position: relative; overflow: hidden; }
.hero__grid-bg { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 72%); -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 72%); opacity: 0.5; }
.hero__inner { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 960px) { .hero__inner { grid-template-columns: 1.02fr 1.15fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--primary); background: var(--primary-tint); padding: 0.35em 0.7em; border-radius: 100px; margin-bottom: 1.4rem; }
.hero h1 { font-weight: 700; font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero__lede { margin-top: 1.4rem; font-size: clamp(1.08rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 40ch; line-height: 1.55; text-wrap: pretty; }
.hero__cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero__note { margin-top: 1.3rem; font-size: 0.9rem; color: var(--faint); }
.hero__note .mono { color: var(--muted); }

/* ---------- Grid mockup ---------- */
.mock { border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden; }
.mock__bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.mock__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mock__tabs { display: flex; gap: 0.3rem; margin-left: 0.6rem; font-size: 0.8rem; }
.mock__tab { padding: 0.2rem 0.55rem; border-radius: 6px; color: var(--muted); }
.mock__tab.is-active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.mock__grid { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.mock__grid th { text-align: left; font-weight: 500; color: var(--faint); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.mock__grid td { padding: 0.62rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.mock__grid tr:last-child td { border-bottom: 0; }
.mock__grid tr:hover td { background: var(--surface); }
.cell-name { font-weight: 500; color: var(--ink); }
.cell-link { color: var(--primary); font-weight: 500; }
.avatar { display: inline-flex; align-items: center; gap: 0.4em; color: var(--muted); }
.avatar i { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.62rem; font-weight: 700; font-style: normal; color: #fff; }
.av-1 { background: var(--c-purple); } .av-2 { background: var(--c-teal); } .av-3 { background: var(--c-orange); }

/* ---------- Section frame ---------- */
.section { padding-block: clamp(3.5rem, 8vh, 6.5rem); }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { max-width: 44rem; margin-bottom: clamp(2.2rem, 4vh, 3.4rem); }
.section__k { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--primary); margin-bottom: 0.9rem; }
.section__title { font-weight: 700; font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.8rem); line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
.section__intro { margin-top: 1rem; color: var(--muted); font-size: clamp(1.02rem, 1rem + 0.3vw, 1.16rem); max-width: 56ch; text-wrap: pretty; }

/* ---------- Views grid ---------- */
.views { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.view { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.view:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.view__ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 0.9rem; background: var(--primary-tint); color: var(--primary); }
.view h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.view p { font-size: 0.92rem; color: var(--muted); text-wrap: pretty; }

/* ---------- Split feature rows ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split--flip .split__visual { order: -1; } }
.split + .split { margin-top: clamp(3rem, 6vh, 5rem); }
.split__body h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.split__body p { margin-top: 1rem; color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.feat-list { margin-top: 1.4rem; display: grid; gap: 0.7rem; }
.feat-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.96rem; color: var(--ink); }
.feat-list svg { flex-shrink: 0; margin-top: 3px; color: var(--primary); }

/* chat mock */
.chat { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.chat__head { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); font-weight: 600; font-size: 0.9rem; }
.chat__head .dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 3px var(--c-green-bg); }
.chat__body { padding: 1.1rem; display: grid; gap: 0.9rem; }
.msg { max-width: 85%; padding: 0.7rem 0.9rem; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; }
.msg--user { justify-self: end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg--bot { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.msg--bot b { color: var(--ink); }
.chat__channels { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1.1rem 1.1rem; }

/* code mock */
.code { border-radius: var(--r-lg); border: 1px solid var(--line-2); overflow: hidden; box-shadow: var(--shadow-md); background: oklch(0.22 0.02 285); }
.code__bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid oklch(1 0 0 / 0.08); }
.code__bar .mock__dot { background: oklch(1 0 0 / 0.18); }
.code__bar span { margin-left: 0.6rem; font-family: var(--mono); font-size: 0.76rem; color: oklch(0.75 0.02 285); }
.code pre { margin: 0; padding: 1.1rem; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; color: oklch(0.9 0.01 285); }
.code .k { color: oklch(0.78 0.13 300); }
.code .s { color: oklch(0.8 0.12 150); }
.code .c { color: oklch(0.6 0.02 285); }
.code .f { color: oklch(0.8 0.12 220); }

/* ---------- Feature bento ---------- */
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.fcard { padding: 1.3rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s; }
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.fcard h4 { font-size: 1rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.fcard h4 svg { color: var(--primary); }
.fcard p { font-size: 0.9rem; color: var(--muted); text-wrap: pretty; }

/* field-type chips row */
.types { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.type-chip { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 0.3rem 0.6rem; border-radius: 6px; }

/* ---------- CTA ---------- */
.cta-band { padding-block: clamp(3.5rem, 8vh, 6rem); }
.cta-panel { border-radius: var(--r-xl); padding: clamp(2.5rem, 6vw, 4.5rem); text-align: center; position: relative; overflow: hidden; background: linear-gradient(160deg, oklch(0.5 0.2 285), oklch(0.46 0.19 300)); color: #fff; box-shadow: var(--shadow-lg); }
.cta-panel::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(oklch(1 0 0 / 0.08) 1px, transparent 1px), linear-gradient(90deg, oklch(1 0 0 / 0.08) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(90% 120% at 50% 0%, #000, transparent 70%); -webkit-mask-image: radial-gradient(90% 120% at 50% 0%, #000, transparent 70%); }
.cta-panel > * { position: relative; }
.cta-panel h2 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.cta-panel p { margin-top: 1rem; font-size: 1.1rem; color: oklch(0.95 0.03 285); max-width: 46ch; margin-inline: auto; }
.cta-panel .btn--primary { background: #fff; color: var(--primary-hi); margin-top: 2rem; }
.cta-panel .btn--primary:hover { background: oklch(0.96 0.02 285); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer .brand { font-size: 1.05rem; }
.footer__tag { font-size: 0.86rem; color: var(--faint); }
.footer__links { display: flex; gap: 1.3rem; margin-left: auto; }
.footer__links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--primary); }
.footer__legal { flex-basis: 100%; color: var(--faint); font-size: 0.82rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__cta .btn--ghost { display: none; }
  .nav__menu { display: flex; }
  .nav__links.is-open { display: flex; position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0.5rem var(--pad) 1.4rem; }
  .nav__links.is-open a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
}

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