/* =========================================================
   UBQT — Editorial + Technical aesthetic
   Warm cream, deep ink, burnt-rust accent.
   Fraunces (display) + Geist (body) + JetBrains Mono (technical)
   ========================================================= */

:root {
  --paper: #efe8d8;
  --paper-soft: #e8dfca;
  --ink: #15130f;
  --ink-soft: #3a3530;
  --muted: #857a68;
  --rust: #b34a1f;
  --rust-deep: #8a3510;
  --ochre: #c69043;
  --line: rgba(21, 19, 15, 0.14);
  --line-strong: rgba(21, 19, 15, 0.35);

  --grid-gap: clamp(16px, 2vw, 24px);
  --pad-x: clamp(20px, 5vw, 72px);

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-serif: "Instrument Serif", "Fraunces", serif;
  --font-body: "Geist", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.075 0 0 0 0 0.06 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* Dot grid corner frame */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(21, 19, 15, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, transparent 35%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, transparent 35%, black 100%);
  opacity: 0.55;
}

main,
header,
footer,
section {
  position: relative;
  z-index: 2;
}

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

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

/* ---------- Typography primitives ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--rust);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}

h2 {
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.02;
}

h3 {
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.035em;
  font-weight: 400;
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 60;
}

.logo .wordmark em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}

.logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  transform: translateY(-1px);
  background: var(--ink);
  color: var(--paper);
}

.logo small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 4px;
  align-self: baseline;
  transform: translateY(-3px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

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

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1px;
  width: 0;
  background: var(--rust);
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
}

.nav-cta {
  border: 1px solid var(--ink);
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink) !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}

.nav-cta::after {
  display: none;
}

@media (max-width: 780px) {
  .nav a:not(.nav-cta) {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(60px, 10vh, 120px) var(--pad-x) clamp(40px, 8vh, 80px);
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  align-items: end;
}

.hero-title {
  grid-column: 1 / 13;
  font-family: var(--font-display);
  font-size: clamp(46px, 8.4vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 60;
}

.hero-title .line-2 {
  display: block;
  padding-left: clamp(20px, 7vw, 110px);
}

.hero-title .ligature {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}

.hero-title .amp {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rust);
  display: inline-block;
  transform: translateY(-0.08em);
}

.hero-meta {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  padding-top: 24px;
}

.hero-meta p {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.hero-side {
  grid-column: 8 / 13;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.hero-side .cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-side .cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero-side .cell-value {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  line-height: 1.1;
}

.hero-ticker {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
  padding: 10px 0;
  display: flex;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  padding-left: 40px;
  animation: marquee 42s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.ticker-track span::after {
  content: "✦";
  color: var(--rust);
  margin-left: 40px;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Hero blinking dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rust);
  animation: pulse 1.6s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(179, 74, 31, 0.6);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 74, 31, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(179, 74, 31, 0); }
}

@media (max-width: 780px) {
  .hero-meta,
  .hero-side {
    grid-column: 1 / 13;
  }
  .hero-side {
    grid-template-columns: 1fr 1fr;
  }
  .hero-title .line-2 {
    padding-left: 20px;
  }
}

/* ---------- Section frame ---------- */

.section {
  padding: clamp(80px, 12vh, 140px) var(--pad-x);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--grid-gap);
  align-items: end;
  margin-bottom: clamp(40px, 6vh, 72px);
}

.section-head .index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head .index b {
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
}

@media (max-width: 780px) {
  .section-head {
    grid-template-columns: 1fr;
  }
}

/* ---------- Services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.service {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 0 32px;
  border-top: 1px solid var(--ink);
  position: relative;
  transition: transform 0.4s ease;
}

.service:hover {
  transform: translateY(-4px);
}

.service .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.service h3 {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
  font-weight: 400;
}

.service h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rust);
  font-weight: 400;
}

.service p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 44ch;
}

.service ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service li {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.service-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-soft);
  margin-bottom: 6px;
  transition: background 0.4s ease, color 0.4s ease;
}

.service:hover .service-icon {
  background: var(--ink);
  color: var(--paper);
}

.service-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}

@media (max-width: 780px) {
  .service {
    grid-column: span 12;
  }
}

/* ---------- Process ---------- */

.process {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  align-items: start;
}

.process-lead {
  grid-column: 1 / 6;
  position: sticky;
  top: 120px;
}

.process-lead h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rust);
}

.process-steps {
  grid-column: 7 / 13;
  display: flex;
  flex-direction: column;
}

.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.step:last-child {
  border-bottom: none;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--rust);
  letter-spacing: 0.14em;
  padding-top: 8px;
}

.step h3 {
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 400;
}

.step p {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 52ch;
}

@media (max-width: 780px) {
  .process-lead,
  .process-steps {
    grid-column: 1 / 13;
  }
  .process-lead {
    position: static;
  }
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  align-items: start;
}

.about-lead {
  grid-column: 1 / 8;
}

.about-lead p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.2;
  color: var(--ink);
  max-width: 22ch;
  font-weight: 400;
}

.about-lead p .accent {
  color: var(--rust);
}

.about-meta {
  grid-column: 9 / 13;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

.about-meta .row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-meta .row .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-meta .row .v {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  grid-column: 1 / 13;
  margin-top: clamp(40px, 8vh, 80px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat .big {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.stat .big em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rust);
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 780px) {
  .about-lead,
  .about-meta {
    grid-column: 1 / 13;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Contact ---------- */

.contact {
  padding: clamp(100px, 14vh, 180px) var(--pad-x);
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(239, 232, 216, 0.09) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
}

.contact-inner {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  align-items: end;
}

.contact h2 {
  grid-column: 1 / 9;
  font-size: clamp(48px, 8vw, 132px);
  line-height: 0.94;
  color: var(--paper);
  letter-spacing: -0.03em;
}

.contact h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ochre);
  font-weight: 400;
}

.contact-side {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 8px;
}

.contact-side .kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-side .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 232, 216, 0.55);
}

.contact-side .v {
  color: var(--paper);
  font-size: 15px;
}

.email-block {
  grid-column: 1 / 13;
  margin-top: clamp(50px, 8vh, 90px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 32px;
  border-top: 1px solid rgba(239, 232, 216, 0.18);
}

.email-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ochre);
}

.email-link {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 84px);
  color: var(--paper);
  letter-spacing: -0.025em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  position: relative;
  transition: color 0.3s ease;
}

.email-link::after {
  content: "↗";
  font-family: var(--font-mono);
  font-size: 0.5em;
  color: var(--ochre);
  transition: transform 0.3s ease;
  display: inline-block;
}

.email-link:hover {
  color: var(--ochre);
}

.email-link:hover::after {
  transform: translate(6px, -6px);
}

@media (max-width: 780px) {
  .contact h2,
  .contact-side {
    grid-column: 1 / 13;
  }
}

/* ---------- Footer ---------- */

.footer {
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 32px var(--pad-x) 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.footer .col-brand {
  grid-column: 1 / 5;
}

.footer .col-links {
  grid-column: 6 / 9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer .col-meta {
  grid-column: 10 / 13;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.footer a:hover {
  color: var(--rust);
}

@media (max-width: 780px) {
  .footer > * {
    grid-column: 1 / 13;
    text-align: left;
  }
}

/* ---------- Legal pages (privacy, terms) ---------- */

.legal {
  padding: clamp(60px, 9vh, 120px) var(--pad-x) clamp(80px, 12vh, 140px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.legal-sidebar {
  grid-column: 1 / 4;
  position: sticky;
  top: 120px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-sidebar .sidebar-head {
  color: var(--rust);
  margin-bottom: 10px;
}

.legal-sidebar a {
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.legal-sidebar a:hover {
  color: var(--ink);
  border-bottom-color: var(--rust);
}

.legal-body {
  grid-column: 5 / 12;
  max-width: 72ch;
}

.legal-body h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.legal-body h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--rust);
}

.legal-body .updated {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: clamp(40px, 6vh, 72px);
}

.legal-body h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.01em;
  margin-top: 48px;
  margin-bottom: 14px;
  font-weight: 400;
}

.legal-body h2::before {
  content: attr(data-num) "  /  ";
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--rust);
  vertical-align: 0.4em;
}

.legal-body p,
.legal-body li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.legal-body ul {
  padding-left: 20px;
  margin: 0 0 1em;
}

.legal-body a {
  color: var(--rust);
  border-bottom: 1px solid color-mix(in srgb, var(--rust) 40%, transparent);
}

.legal-body a:hover {
  border-bottom-color: var(--rust);
}

@media (max-width: 780px) {
  .legal-sidebar,
  .legal-body {
    grid-column: 1 / 13;
  }
  .legal-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ---------- Reveal on load ---------- */

.reveal {
  animation: reveal 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.48s; }
.delay-5 { animation-delay: 0.60s; }
