/* ============================================================
   Ragno v4 — shared base for the "original web" iterations.
   Layout + components; colors come from each page's token file.
   Adds over v3 base: hero web canvas layer, right-aligned brand
   (nav mark lives top-right, always complete), per-style hooks
   via body classes (.style-linear / .style-editorial / .style-brutal).
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: inherit; }

/* ------------------------------ nav ------------------------------ */
/* row-reverse: links on the left, brand + static mark top-right */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--nav-bg, color-mix(in srgb, var(--bg) 78%, transparent));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 15px;
}

.nav__mark { width: 30px; height: 31px; flex: none; }

.nav__links { display: flex; gap: 26px; }

.nav__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link:hover { color: var(--accent); }

/* ------------------------------ hero ------------------------------ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 64px;
  position: relative;
  overflow: hidden;
}

/* the original RagnoWeb canvas, behind the mark + wordmark */
.hero__web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero > *:not(.hero__web) { position: relative; z-index: 1; }

.hero__mark {
  width: min(38vh, 360px);
  aspect-ratio: 611 / 619;
}

.hero__word {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 7vw, 84px);
  letter-spacing: 0.06em;
  line-height: 1;
}

.hero__sub {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero__tag {
  margin: 34px 0 0;
  max-width: 30ch;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
}

.hero__tag em { color: var(--accent); font-style: normal; }

.hero__cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 52px;
  background: var(--hairline);
  overflow: hidden;
  z-index: 1;
}

.hero__cue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: cue 2.2s var(--ease-in-out) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-100%); }
  55%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* --------------------------- shared blocks --------------------------- */
.block { padding: clamp(72px, 12vw, 140px) 24px; position: relative; }

.wrap { max-width: 1180px; margin: 0 auto; }

.kicker {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.statement {
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: var(--tracking-display);
}

.statement em { color: var(--accent); font-style: normal; }

.muted { color: var(--muted); }

/* ------------------------------ work ------------------------------ */
.work { border-top: 1px solid var(--hairline); }

.work__head { margin-bottom: 48px; }

.work__head .muted { max-width: 52ch; margin: 0; }

.work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--raise);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius, 10px);
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card__media img,
.card:hover .card__media video { transform: scale(1.04); }

.card__body {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card__head { display: flex; gap: 16px; align-items: baseline; }

.card__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.card__kind {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__blurb { margin: 0; font-size: 15px; color: var(--muted); flex: 1; }

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

.card__stack li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
}

/* ------------------------------ contact ------------------------------ */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--btn-radius, 999px);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.btn--solid { background: var(--accent); color: var(--on-accent); }

.btn--ghost { color: var(--accent); background: transparent; }

.btn:hover { transform: translateY(-2px); }

.btn--ghost:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.btn--solid:hover { filter: brightness(1.08); }

/* ------------------------------ footer ------------------------------ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 28px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer__brand { display: flex; align-items: center; gap: 10px; }

.footer__mark { width: 22px; height: 23px; }

.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 900px) {
  .work__grid { grid-template-columns: 1fr; }
  .nav__links { gap: 18px; }
  .hero__mark { width: min(52vw, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__cue::after { animation: none; }
  .card, .card__media img, .card__media video, .btn { transition: none; }
}
