/* Flowshift — warm-neutral terminal aesthetic */

:root {
  /* Light (default) */
  --bg: #f2ece0;          /* cream */
  --bg-2: #ebe3d2;        /* sand */
  --bg-3: #e3d8c1;        /* deeper sand */
  --ink: #1a1613;         /* near-black, warm */
  --ink-2: #3a322a;
  --ink-3: #6b5f50;       /* muted */
  --rule: #1a1613;
  --rule-soft: rgba(26, 22, 19, 0.14);
  --accent: #d24a1e;      /* burnt orange, from logo */
  --accent-ink: #f2ece0;
  --ok: #4a6b3a;          /* olive green */
  --warn: #a65d1c;
  --paper: #faf5ea;       /* card */
  --grid: rgba(26, 22, 19, 0.06);
}

[data-theme="dark"] {
  --bg: #15120f;
  --bg-2: #1c1915;
  --bg-3: #24201a;
  --ink: #f0e8d8;
  --ink-2: #d9cdb6;
  --ink-3: #8a7e6a;
  --rule: #f0e8d8;
  --rule-soft: rgba(240, 232, 216, 0.14);
  --accent: #ff7a3a;
  --accent-ink: #15120f;
  --ok: #9dba7a;
  --warn: #e8a35c;
  --paper: #1c1915;
  --grid: rgba(240, 232, 216, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv02", "cv11";
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.serif {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Layout */
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

.rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
}

.rule-soft {
  height: 1px;
  background: var(--rule-soft);
  width: 100%;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 18px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo-mark {
  height: 34px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--ink-2);
  justify-self: start;
  margin-left: 12px;
}
.nav-links a {
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::before {
  content: "[";
  opacity: 0;
  margin-right: 4px;
  transition: opacity 0.15s;
}
.nav-links a::after {
  content: "]";
  opacity: 0;
  margin-left: 4px;
  transition: opacity 0.15s;
}
.nav-links a:hover::before,
.nav-links a:hover::after { opacity: 1; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.lang-toggle button {
  padding: 6px 10px;
  color: var(--ink-3);
}
.lang-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--rule);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--rule); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Hero */
.hero {
  position: relative;
  padding: 64px 0 0;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 56px;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ink-3);
}

.hero h1 {
  font-size: clamp(44px, 6.2vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}
.hero h1 .italic {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.hero h1 .muted {
  color: var(--ink-3);
  font-weight: 400;
}

.hero-sub {
  margin-top: 28px;
  font-size: 16px;
  max-width: 52ch;
  color: var(--ink-2);
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule-soft);
}

/* Terminal visual */
.terminal {
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
  font-size: 12px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.term-bar .dots {
  display: flex; gap: 6px;
}
.term-bar .dots span {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--rule);
}
.term-bar .status {
  display: flex; align-items: center; gap: 8px;
  color: var(--ok);
}
.term-bar .status::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  animation: pulse 2s ease-in-out infinite;
}

.term-body {
  padding: 18px 18px 12px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.term-line {
  display: grid;
  grid-template-columns: 48px 58px 1fr;
  gap: 12px;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(4px);
  animation: fadeUp 0.5s ease forwards;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-line .t { color: var(--ink-3); }
.term-line .who {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border: 1px solid var(--rule-soft);
  height: fit-content;
  align-self: start;
  margin-top: 2px;
}
.term-line[data-who="agent"] .who { color: var(--accent); border-color: var(--accent); }
.term-line[data-who="slack"] .who { color: var(--ink-2); }
.term-line[data-who="cal"]   .who { color: var(--ok); border-color: var(--ok); }
.term-line[data-who="inbox"] .who { color: var(--ink-3); }

.term-line .msg { color: var(--ink); }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

.term-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

.term-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.term-metrics > div {
  padding: 14px 16px;
  border-right: 1px solid var(--rule);
}
.term-metrics > div:last-child { border-right: 0; }
.term-metrics .k {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.term-metrics .v {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-top: 6px;
  color: var(--ink);
}
.term-metrics .v .unit {
  font-size: 13px;
  color: var(--ink-3);
  margin-left: 4px;
}

/* Ticker */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  font-size: 13px;
  letter-spacing: 0.15em;
}
.ticker-track {
  display: flex;
  gap: 48px;
  padding: 14px 0;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  width: max-content;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 24px;
}
.ticker-track span::after {
  content: "✦";
  color: var(--accent);
  margin-left: 48px;
}
@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* Section header */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: start;
}
.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.section-title {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  font-weight: 500;
}
.section-title .italic {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  color: var(--accent);
}
.section-sub {
  color: var(--ink-2);
  max-width: 58ch;
  font-size: 15px;
}

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.service {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 32px 28px 36px;
  background: var(--bg);
  position: relative;
  transition: background 0.25s ease;
}
.service:hover { background: var(--paper); }
.service-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 32px;
}
.service-code {
  font-weight: 600;
  color: var(--ink);
}
.service h3 {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  font-weight: 500;
}
.service-tag {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 20px;
}
.service-body {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 24px;
}
.service-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px dashed var(--rule-soft);
}
.service-bullets li {
  padding: 10px 0;
  display: flex;
  gap: 12px;
  font-size: 13px;
  border-bottom: 1px dashed var(--rule-soft);
  color: var(--ink);
}
.service-bullets li::before {
  content: "→";
  color: var(--accent);
  font-weight: 500;
}

/* Process */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.process-step {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 24px 32px;
  position: relative;
  min-height: 240px;
  background: var(--bg);
  transition: background 0.2s ease;
}
.process-step:hover { background: var(--paper); }
.process-step .n {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  margin-bottom: 40px;
}
.process-step h4 {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 500;
}
.process-step .d {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 38ch;
}
.process-step::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 24px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  opacity: 0.4;
}

/* Slider */
.compare {
  position: relative;
  border: 1px solid var(--rule);
  overflow: hidden;
  user-select: none;
  aspect-ratio: 16 / 8;
  background: var(--bg-2);
}
.compare-pane {
  position: absolute;
  inset: 0;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.compare-pane.before {
  background: var(--bg-3);
  color: var(--ink-2);
}
.compare-pane.after {
  background: var(--ink);
  color: var(--bg);
  clip-path: inset(0 0 0 50%);
}
.compare-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.compare-label::before {
  content: "";
  width: 8px; height: 8px;
  border: 1px solid currentColor;
}
.compare-pane.after .compare-label::before { background: var(--accent); border-color: var(--accent); }

.compare-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 48px;
}
.compare-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid currentColor;
  padding-top: 10px;
  opacity: 0.95;
}
.compare-stat .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.compare-stat .value {
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.02em;
  font-family: "Instrument Serif", serif;
  font-style: italic;
  line-height: 1;
}

.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  cursor: ew-resize;
  z-index: 10;
}
.compare-handle::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--accent);
  background: var(--bg);
  border-radius: 50%;
}
.compare-handle::after {
  content: "⇔";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
}
.compare-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, 38px);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  white-space: nowrap;
  animation: hintPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, 38px); }
  50% { opacity: 1; transform: translate(-50%, 42px); }
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.contact > div {
  padding: 40px 36px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.contact-title {
  font-size: clamp(36px, 4.5vw, 64px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 24px;
  font-weight: 500;
}
.contact-title .italic {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  color: var(--accent);
}
.contact-sub {
  color: var(--ink-2);
  max-width: 42ch;
  margin-bottom: 40px;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule-soft);
  font-size: 15px;
  align-items: baseline;
}
.contact-row .k {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.contact-row a:hover { color: var(--accent); }

/* Footer */
.footer {
  padding: 40px 0 32px;
  font-size: 12px;
  color: var(--ink-3);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  border-bottom: 0;
}
.footer .brand { color: var(--ink); }

/* Frame corners */
.corner-frame {
  position: absolute;
  pointer-events: none;
  inset: 16px;
  z-index: 2;
}
.corner-frame::before,
.corner-frame::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
}
.corner-frame::before {
  top: 0; left: 0;
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.corner-frame::after {
  bottom: 0; right: 0;
  border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .services, .process-grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer { grid-template-columns: 1fr; }
}
