/* =========================================================
   Gati — marketing page
   One idea: a single framed canvas holding the suite, set
   like a spec sheet. Bone paper, hairline rules, one oxide
   accent that means "this exists today".
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --paper:      #f4f1ea;
  --panel:      #fbf8f2;
  --tint:       #edeadf;
  --ink:        #17150f;
  --ink-2:      #524b3f;
  --ink-3:      #746955;
  --rule:       #d8d0bf;
  --accent:     #a6401f;

  --band-bg:    #14120d;
  --band-fg:    #f1ece1;
  --band-muted: #a8a091;
  --band-rule:  #3a352c;

  --btn-bg:     var(--ink);
  --btn-fg:     var(--paper);

  --font-serif: "Iowan Old Style", "Charter", ui-serif, "Palatino Linotype",
                Palatino, "Book Antiqua", Georgia, serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
                Arial, sans-serif;
  --font-mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
                "Liberation Mono", monospace;

  --gutter:  clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;

  --noise: 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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #121110;
    --panel:      #1a1916;
    --tint:       #191815;
    --ink:        #f0ebe0;
    --ink-2:      #a9a294;
    --ink-3:      #8a8172;
    --rule:       #302d27;
    --accent:     #e2764a;

    --band-bg:    #080706;
    --band-fg:    #f0ebe0;
    --band-muted: #a9a294;
    --band-rule:  #2b2822;

    --btn-bg:     #f0ebe0;
    --btn-fg:     #14120d;
  }
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--noise);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { list-style: none; padding: 0; }
p { text-wrap: pretty; }

img, picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--paper); }

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

/* ---------- 3. Primitives ---------- */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip:focus { top: 0.75rem; }

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow__num {
  color: var(--accent);
  letter-spacing: 0.1em;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.22rem 0.42rem;
  border: 1px solid currentColor;
  color: var(--accent);
  line-height: 1.1;
}

/* Status: shape carries the meaning as much as colour. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
}
.status--dev { color: var(--accent); }
.status--dev::before { background: currentColor; }
.status--plan { color: var(--ink-3); }
.status--plan::before { border: 1px solid currentColor; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  padding: 0.85rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease;
}
.btn__out {
  font-size: 0.82em;
  opacity: 0.65;
  transform: translateY(-0.06em);
}
.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn--primary:hover {
  background: var(--accent);
  color: var(--btn-fg);
}
.btn--line {
  border-color: var(--rule);
  color: var(--ink);
}
.btn--line:hover {
  border-color: var(--ink);
  background: var(--panel);
}
.btn--quiet {
  padding: 0.6rem 0.85rem;
  font-size: 0.84rem;
  border-color: var(--rule);
  color: var(--ink);
}
.btn--quiet:hover {
  border-color: var(--ink);
  background: var(--panel);
}
.btn--invert {
  border-color: var(--band-rule);
  color: var(--band-fg);
  margin-top: 0.5rem;
}
.btn--invert:hover {
  background: var(--band-fg);
  color: var(--band-bg);
  border-color: var(--band-fg);
}

/* ---------- 4. Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex: none;
}
.brand__mark { height: 25px; width: auto; }
.brand__word {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
}
.nav {
  display: none;
  gap: 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (min-width: 760px) {
  .nav { display: flex; }
  .masthead__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding-block: 1rem;
  }
  .masthead__inner .brand { justify-self: start; }
  .nav { justify-self: center; }
  .masthead__inner .btn { justify-self: end; }
}

/* ---------- 5. Hero ---------- */
.hero {
  border-bottom: 1px solid var(--rule);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.hero__grid {
  display: grid;
  gap: 2.25rem;
  padding-block: clamp(2.5rem, 6vw, 4.75rem) 0;
}
@media (min-width: 940px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr);
    gap: 2rem 4rem;
    align-items: start;
  }
}

.eyebrow--lead { margin-bottom: 1.4rem; }

.hero__title h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 7.2vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.hero__aside { display: flex; flex-direction: column; }
@media (min-width: 940px) {
  .hero__aside { padding-top: 0.55rem; }
}
.hero__lede {
  max-width: 36ch;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink-2);
}
@media (min-width: 640px) and (max-width: 939px) {
  .hero__lede { max-width: 50ch; }
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
.hero__status {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.9rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--rule);
}
.statusline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.7rem;
}
.statusline__names {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}

.hero .canvas { margin-top: clamp(2.5rem, 5vw, 3.75rem); }

/* The canvas figure: one frame, six areas, one agent band. */
.canvas { margin: 0; }
.canvas__frame {
  border: 1px solid var(--rule);
  background: var(--panel);
}
.canvas__cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
}
@media (min-width: 560px) {
  .canvas__cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .canvas__cells { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.canvas__cell {
  background: var(--panel);
  padding: 0.8rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 5.6rem;
}
.canvas__idx {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.canvas__name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.canvas__cell .status {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.58rem;
  letter-spacing: 0.07em;
}
.canvas__agent {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  padding: 0.8rem 0.85rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.canvas__agent-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
}
.canvas__agent-note {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.canvas__cap {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ---------- 6. Sections ---------- */
.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 4rem;
}
.section__head {
  display: grid;
  gap: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}
@media (min-width: 900px) {
  .section__head {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem 4rem;
    align-items: start;
  }
}

h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.section__intro {
  font-size: 1rem;
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 52ch;
}

/* Module table */
.modules { border-top: 1px solid var(--rule); }

.module {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "idx  state"
    "head head"
    "desc desc";
  gap: 0.4rem 1rem;
  padding-block: clamp(1.4rem, 3vw, 1.9rem);
  border-bottom: 1px solid var(--rule);
}
.module__idx {
  grid-area: idx;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  padding-top: 0.6rem;
}
.module__head { grid-area: head; }
.module__state {
  grid-area: state;
  padding-top: 0.45rem;
}
.module__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
}
.module__role {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.module__desc {
  grid-area: desc;
  margin-top: 0.75rem;
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink-2);
}

@media (min-width: 700px) {
  .module {
    grid-template-columns: 3.25rem minmax(0, 1fr) 9rem;
    grid-template-areas:
      "idx head state"
      "idx desc desc";
    gap: 0 2.5rem;
    align-items: start;
  }
  .module__desc { margin-top: 0.55rem; }
  .module__state { justify-self: end; }
}

@media (min-width: 1080px) {
  .module {
    grid-template-columns: 3.25rem 15rem minmax(0, 1fr) 9.5rem;
    grid-template-areas: "idx head desc state";
    gap: 0 2.5rem;
  }
  .module__desc { margin-top: 0.5rem; }
}

/* Reasons */
.reasons { border-top: 1px solid var(--rule); }
.reason {
  display: grid;
  gap: 0.35rem;
  padding-block: clamp(1.5rem, 3vw, 2.1rem);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 780px) {
  .reason {
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 0 2.5rem;
    align-items: baseline;
  }
}
.reason__num {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1;
  color: var(--ink-3);
  font-feature-settings: "onum" 1;
}
.reason__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  letter-spacing: -0.012em;
  line-height: 1.25;
}
.reason__body p {
  margin-top: 0.55rem;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.62;
}

.pull {
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
  padding-left: clamp(1.1rem, 3vw, 2rem);
  border-left: 2px solid var(--accent);
  max-width: 60ch;
}
.pull p {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.3vw, 1.6rem);
  line-height: 1.42;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: pretty;
}

/* Agent section */
.section--tint { background: var(--tint); }

.keys {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 800px) {
  .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.key {
  background: var(--paper);
  padding: 1.35rem 1.25rem 1.6rem;
}
.key__label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.key__text {
  margin-top: 0.85rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Open-source band */
.band {
  background: var(--band-bg);
  color: var(--band-fg);
  border-top: none;
  border-bottom: 1px solid var(--rule);
}
.band .eyebrow { color: var(--band-muted); }
.band .eyebrow__num { color: var(--accent); }
.band__grid {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.6rem;
}
@media (min-width: 900px) {
  .band__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
    gap: 3rem 4rem;
    align-items: start;
  }
}
.band__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.8vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.028em;
  color: var(--band-fg);
  text-wrap: balance;
}
.band__body p {
  color: var(--band-muted);
  font-size: 1rem;
  line-height: 1.66;
  max-width: 46ch;
}
.band__body p + p { margin-top: 1rem; }
.band__body .btn { margin-top: 1.5rem; }

/* ---------- 7. Footer ---------- */
.footer {
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.75rem;
  font-size: 0.95rem;
}
.footer__inner {
  display: grid;
  gap: 1.6rem;
}
@media (min-width: 840px) {
  .footer__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2rem 3rem;
    align-items: start;
  }
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer__mark { height: 20px; width: auto; }
.footer__word {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.footer__note {
  color: var(--ink-2);
  max-width: 44ch;
  font-size: 0.95rem;
  line-height: 1.6;
}
.footer__note em { font-style: italic; color: var(--ink); }
.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.footer__nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink-2);
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.footer__nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 8. Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__title > *,
.hero__aside > * {
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero__title > :nth-child(1) { animation-delay: 0.04s; }
.hero__title > :nth-child(2) { animation-delay: 0.11s; }
.hero__aside > :nth-child(1) { animation-delay: 0.18s; }
.hero__aside > :nth-child(2) { animation-delay: 0.25s; }
.hero__aside > :nth-child(3) { animation-delay: 0.32s; }
.canvas { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.36s both; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .hero__title > *, .hero__aside > *, .canvas { animation: none; }
}
