/* ============================================================
   dogoda. - Core site styles (shared across all pages)
   Depends on tokens.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: var(--cream); }

/* ---------- Layout primitives ---------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { max-width: var(--maxw-text); }
.section { padding-block: clamp(3.5rem, 2rem + 7vw, 8rem); position: relative; }
.section-tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.stack > * + * { margin-top: var(--s-3); }
.flow > * + * { margin-top: 1.1em; }

/* ---------- Type ----------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 1.6em; height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.eyebrow.no-tick::before { display: none; }
.eyebrow.muted { color: var(--mute); }
.eyebrow.ink { color: var(--ink); }

h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
.display {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.h1 { font-family: var(--display); font-weight: 800; font-size: var(--fs-h1); line-height: 0.98; letter-spacing: -0.025em; }
.kicker { font-family: var(--sans); font-weight: 600; font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; }
.lead {
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.body { color: var(--ink-soft); text-wrap: pretty; }
.hl { color: var(--red); font-weight: 600; }
.muted { color: var(--mute); }
.data { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.caption {
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ---------- The dogoda wordmark (live text) -------------- */
.mark {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--red);
  line-height: 0.9;
  display: inline-flex;
  align-items: baseline;
}
.mark .dot {
  width: 0.16em; height: 0.16em;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.05em;
  align-self: flex-end;
  margin-bottom: 0.12em;
}
.mark.reversed { color: var(--cream); }
.mark.reversed .dot { background: var(--red); }
.mark.on-red { color: var(--cream); }
.mark.on-red .dot { background: var(--cream); }

/* ---------- Texture (pencil/paper, 15%) ------------------ */
.texture::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(135deg, rgba(42,31,27,0.022) 0, rgba(42,31,27,0.022) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(45deg, rgba(42,31,27,0.015) 0, rgba(42,31,27,0.015) 1px, transparent 1px, transparent 7px);
  mix-blend-mode: multiply;
}
.texture-hero::after { opacity: 1; }

/* ---------- Buttons -------------------------------------- */
.btn {
  --btn-fg: var(--cream);
  --btn-bg: var(--red);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 1.05em 1.6em;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  isolation: isolate;
}
.btn .arr { transition: transform 0.4s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .arr { transform: translateX(4px); }
.btn:active { transform: translateY(0); }

.btn.ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--rule);
}
.btn.ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.btn.ghost:hover { color: var(--cream); border-color: var(--ink); }
.btn.ghost:hover::before { transform: scaleX(1); }

.btn-text {
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.5em;
  min-height: 44px;
  color: var(--ink);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease), gap 0.3s var(--ease);
}
.btn-text .arr { transition: transform 0.35s var(--ease); }
.btn-text:hover { border-color: var(--red); }
.btn-text:hover .arr { transform: translateX(4px); }
.btn-text.on-red:hover { border-color: var(--cream); }

/* ---------- Pills / chips -------------------------------- */
.chip {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.62em 0.95em;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 0.5em;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.chip.data { color: var(--sage); border-color: color-mix(in oklab, var(--sage) 35%, var(--rule)); }
.chip.mono { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em; }

/* ---------- Cards ---------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  position: relative;
}
.card.flush { padding: 0; overflow: hidden; }
.hairline { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Surfaces ------------------------------------- */
.surface-paper { background: var(--paper); }
.surface-sand  { background: var(--sand); }
.surface-red   { background: var(--red); color: var(--cream); }
.surface-ink   { background: var(--ink); color: var(--cream); }
.surface-red .lead, .surface-ink .lead { color: rgba(241,240,237,0.86); }
.surface-red .display, .surface-red .title, .surface-red .h1, .surface-ink .display, .surface-ink .title, .surface-ink .h1 { color: var(--cream); }
.surface-ink .eyebrow { color: var(--red); }
.surface-red .eyebrow { color: var(--cream); opacity: 0.78; }

/* ============================================================
   Header / navigation
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in oklab, var(--cream) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: clamp(64px, 5vw, 86px);
}
.nav-brand { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.045em; color: var(--red); display: inline-block; white-space: nowrap; }
.nav-brand .dot { width: 0.16em; height: 0.16em; background: var(--red); border-radius: 50%; display: inline-block; margin-left: 0.04em; vertical-align: baseline; }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.4rem); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 0.4em 0;
  transition: color 0.3s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1.5px;
  background: var(--red); transition: right 0.35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { right: 0; }
.nav-cta { display: inline-flex; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(82vw, 360px);
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.5rem; padding: var(--gutter);
    background: var(--paper); border-left: 1px solid var(--rule);
    transform: translateX(100%); transition: transform 0.5s var(--ease);
    z-index: 90;
  }
  .nav-links a { font-size: 1.05rem; }
  .nav-links.open { transform: translateX(0); }
  .nav-cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; justify-content: center;
    width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; z-index: 95;
  }
  .nav-toggle span { height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.4s var(--ease), opacity 0.3s var(--ease); }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: var(--cream); position: relative; overflow: hidden; }
.site-footer .wrap { position: relative; z-index: 1; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-5); padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.footer-mark { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 1rem + 10vw, 7rem); line-height: 0.9; letter-spacing: -0.04em; color: var(--cream); }
.footer-mark .dot { width: 0.14em; height: 0.14em; background: var(--red); border-radius: 50%; display: inline-block; margin-left: 0.04em; }
.footer-tag { font-family: var(--mono); font-size: var(--fs-small); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(241,240,237,0.55); margin-top: var(--s-3); }
.footer-nav { display: flex; flex-direction: column; gap: 0.9rem; }
.footer-nav a { font-family: var(--mono); font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(241,240,237,0.72); width: fit-content; transition: color 0.3s var(--ease), padding-left 0.3s var(--ease); }
.footer-nav a:hover { color: var(--cream); padding-left: 0.4em; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding-block: var(--s-4); border-top: 1px solid rgba(241,240,237,0.14); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: rgba(241,240,237,0.45); text-transform: uppercase; }
.footer-bottom a { color: rgba(241,240,237,0.6); transition: color 0.3s; }
.footer-bottom a:hover { color: var(--red); }
@media (max-width: 680px) { .footer-top { grid-template-columns: 1fr; gap: var(--s-4); } }
.footer-social { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(241,240,237,0.55); margin-top: var(--s-3); transition: color 0.3s var(--ease); }
.footer-social:hover { color: var(--red); }

/* ============================================================
   Scroll reveal
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* shared page intro spacing under fixed header */
.page-top { padding-top: clamp(7rem, 5rem + 8vw, 12rem); }

/* small helpers */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.grid { display: grid; gap: var(--s-4); }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.wrap-flex { flex-wrap: wrap; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Focus visible --------------------------------- */
.btn:focus-visible,
.btn-text:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.nav-links a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.contact-link:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
