/* === Anything Hosted — base styles === */

/* Self-hosted fonts so we don't rely on Google Fonts being reachable. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-italic.woff2') format('woff2');
}

:root {
  --bg: #fafaf7;
  --bg-soft: #f1efe9;
  --bg-card: #ffffff;
  --line: rgba(28, 28, 28, 0.10);
  --line-strong: rgba(28, 28, 28, 0.22);
  --fg: #131313;
  --fg-muted: rgba(19, 19, 19, 0.62);
  --fg-faint: rgba(19, 19, 19, 0.38);
  --accent: #3b6cff;
  --signal: #1d8a4f;

  --font-display: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;

  --pad-x: clamp(24px, 5vw, 96px);
  --section-y: 140px;
  --container: 1320px;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

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

/* ---------- layout primitives ---------- */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--fg-faint);
}

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

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: backdrop-filter 200ms ease, background 200ms ease, border-color 200ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  position: relative;
  padding: 4px 0;
  transition: color 180ms ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a .idx {
  color: var(--fg-faint);
  margin-right: 6px;
  font-size: 10px;
}
.nav-cta {
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.nav-cta:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.nav-cta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--signal) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--signal) 60%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

@media (max-width: 800px) {
  .nav-links { display: none; }
}
@media (max-width: 700px) {
  .nav-cta { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding-top: 180px;
  padding-bottom: 80px;
  position: relative;
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-meta-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.meta-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}
.meta-item span { color: var(--fg); margin-left: 6px; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 8.4vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-top: 36px;
  text-wrap: balance;
}
.hero h1 .serif {
  color: var(--accent);
  display: inline-block;
  padding: 0 4px;
}
.hero h1 .blink {
  display: inline-block;
  width: 0.42em;
  height: 0.78em;
  background: var(--accent);
  vertical-align: -8%;
  margin-left: 0.08em;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink {
  to { opacity: 0; }
}

.hero-sub {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 56px;
  align-items: end;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-sub p {
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--fg-muted);
  max-width: 56ch;
  text-wrap: pretty;
}
.hero-sub p strong { color: var(--fg); font-weight: 500; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--line-strong);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--fg-muted); }
.btn .arrow { transition: transform 220ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

@media (max-width: 800px) {
  .hero-sub { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- status strip ---------- */
.status-strip {
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}
.status-cell {
  padding: 6px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.status-cell:last-child { border-right: 0; }
.status-cell:first-child { padding-left: 6px; }
.status-cell .label { color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.status-cell .value { color: var(--fg); }
.status-cell .value.live { color: var(--signal); display: inline-flex; align-items: center; gap: 8px; }
.status-cell .value.live::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
}
@media (max-width: 900px) {
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-cell { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 6px; }
  .status-cell:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---------- section header ---------- */
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
  align-items: end;
  padding-bottom: 48px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  font-weight: 400;
  text-wrap: balance;
}
.section-head h2 .serif { color: var(--accent); }
.section-head p {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 52ch;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- services ---------- */
.services {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}
.service {
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr 80px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 220ms ease;
}
.service:hover { background: var(--bg-soft); }
.service .num {
  padding: 36px 0 36px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
}
.service .title {
  padding: 36px 24px 36px 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.service .title small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-top: 10px;
}
.service .desc {
  padding: 42px 36px 36px 0;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 52ch;
}
.service .desc .tags {
  margin-top: 18px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.service .desc .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.service .plus {
  align-self: center;
  justify-self: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.service:hover .plus { background: var(--accent); border-color: var(--accent); color: var(--bg); transform: rotate(45deg); }

@media (max-width: 900px) {
  .service { grid-template-columns: 40px 1fr 40px; }
  .service .desc { grid-column: 1 / -1; padding: 0 0 32px 0; }
}

@media (max-width: 700px) {
  .service { grid-template-columns: 40px 1fr; }
  .service .plus { display: none; }
}

/* ---------- process ---------- */
.process {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.process-step {
  background: var(--bg);
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  position: relative;
}
.process-step .step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.process-step .step-title {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 500;
  margin-bottom: 2px;
}
.process-step p {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 1100px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .process-grid { grid-template-columns: 1fr; }
}

/* ---------- stack ---------- */
.stack {
  border-top: 1px solid var(--line);
}
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.stack-col h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.stack-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 14px;
}
.stack-list li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.stack-list li::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .stack-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- case studies ---------- */
.cases {
  border-top: 1px solid var(--line);
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.case {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color 200ms ease, transform 220ms ease;
  min-height: 220px;
  position: relative;
}
.case-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}
.case > *:not(.case-link) { position: relative; z-index: 2; pointer-events: none; }
.case .stack-row span { pointer-events: auto; }
.case-visit {
  color: var(--fg-faint);
  transition: color 200ms ease;
}
.case:hover .case-visit { color: var(--accent); }
.case:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.case-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.case h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 500;
  line-height: 1.15;
}
.case p {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.5;
}
.case-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.case-footer .stack-row { display: flex; gap: 8px; }
@media (max-width: 1000px) {
  .case-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .case-grid { grid-template-columns: 1fr; }
}

/* ---------- about ---------- */
.about {
  border-top: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}
.about-copy p {
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.4;
  color: var(--fg);
  margin-bottom: 24px;
  text-wrap: pretty;
}
.about-copy p.muted { color: var(--fg-muted); font-size: 17px; line-height: 1.55; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stat {
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
}
.stat .v {
  font-size: 44px;
  letter-spacing: -0.03em;
  font-weight: 500;
  line-height: 1;
  color: var(--fg);
}
.stat .v .unit { color: var(--accent); margin-left: 2px; }
.stat .l {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- contact ---------- */
.contact {
  border-top: 1px solid var(--line);
}
.contact-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: end;
}
.contact h2 {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  font-weight: 400;
  text-wrap: balance;
}
.contact h2 .serif { color: var(--accent); }
.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.contact-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.contact-row .l {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact-row .v { font-size: 18px; }
.contact-row .v a { border-bottom: 1px solid var(--line); transition: border-color 180ms ease; }
.contact-row .v a:hover { border-color: var(--accent); }
@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--pad-x);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-muted);
}
.footer .col { display: flex; gap: 24px; flex-wrap: wrap; }
.footer .col a:hover { color: var(--fg); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- grid backdrop in hero ---------- */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.65;
}
