/* ============================================
   TAQUITO PARTNER — Blueprint visual system
   ============================================ */

:root {
  --bg: #0e1113;
  --surface: #171b1e;
  --fg: #f2f0ea;
  --fg-muted: #8a8f93;
  --accent: #ff5a1f;
  --border: #2a2f33;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-text: 62ch;
  --gutter: clamp(20px, 5vw, 64px);
  --chapter-gap: clamp(96px, 16vw, 240px);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0; }

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

ul { margin: 0; padding: 0; list-style: none; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #14100b;
  padding: 12px 20px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 13px;
}
.skip-link:focus {
  left: var(--gutter);
  top: var(--gutter);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px var(--gutter);
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  padding: 14px var(--gutter);
  background: rgba(14, 17, 19, 0.86);
  backdrop-filter: blur(6px);
  border-bottom-color: var(--border);
}

.nav.is-menu-open {
  background: var(--bg);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
}

.nav__mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.nav__mark-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
}

.nav__links {
  display: flex;
  gap: clamp(16px, 2.4vw, 40px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav__links a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--fg-muted);
  transition: color 0.2s ease;
  padding: 4px 0;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--fg);
}

.nav__index {
  color: var(--accent);
  font-size: 10px;
}

.nav__cta {
  color: var(--fg) !important;
  border: 1px solid var(--border);
  padding: 8px 14px !important;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.lang-switch__btn {
  background: none;
  border: none;
  padding: 4px 2px;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.lang-switch__btn[aria-pressed="true"] {
  color: var(--accent);
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible {
  color: var(--fg);
}

.lang-switch__sep {
  color: var(--border);
  font-size: 11px;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav__toggle span {
  display: block;
  height: 1px;
  background: var(--fg);
}

.nav__sheet {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 15px;
  background: var(--bg);
}
.nav__sheet a {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
}
.nav__sheet.is-open { display: flex; }

/* ============================================
   GRID OVERLAY (exposed drafting grid)
   ============================================ */
.grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  z-index: 0;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% - (11 * 1px)) / 12),
    var(--border) calc((100% - (11 * 1px)) / 12),
    var(--border) calc((100% - (11 * 1px)) / 12 + 1px)
  );
}

@media (max-width: 900px) {
  .grid-overlay { display: none; }
}

/* ============================================
   SECTIONS / CHAPTERS
   ============================================ */
main {
  position: relative;
}

section {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Cover ---- */
.cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 140px;
  padding-bottom: clamp(40px, 6vw, 80px);
}

.cover__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 24px;
}

.cover__headline {
  font-size: clamp(2.75rem, 5vw + 1.2rem, 8rem);
  max-width: 18ch;
}

.cover__headline span {
  display: block;
}

.cover__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.cover__note {
  max-width: 42ch;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

.cover__coord {
  color: var(--fg-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ---- Plates (shared) ---- */
.plate {
  padding-top: var(--chapter-gap);
  padding-bottom: var(--chapter-gap);
  border-top: 1px solid var(--border);
}

.plate__tag {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 28px;
}

.plate h2 {
  font-size: clamp(1.9rem, 2.4vw + 1rem, 3.2rem);
  max-width: 18ch;
  margin-bottom: 40px;
}

/* Plate 01 layout */
.plate--01 .plate__body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.plate__copy h2 { margin-bottom: 24px; }

.plate__copy p {
  color: var(--fg-muted);
  max-width: var(--max-text);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.plate__list {
  display: grid;
  gap: 10px;
  font-size: 12px;
  color: var(--fg);
}

.plate__list li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.plate__list li:last-child { border-bottom: 1px solid var(--border); }

.plate__figure {
  margin: 0;
  justify-self: end;
  width: 100%;
}

.plate__figure figcaption {
  margin-top: 14px;
  font-size: 11px;
  color: var(--fg-muted);
}

@media (max-width: 900px) {
  .plate--01 .plate__body {
    grid-template-columns: 1fr;
  }
  .plate__figure { justify-self: stretch; }
}

/* ---- Diagrams (SVG) ---- */
.diagram {
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram-box {
  fill: none;
  stroke: var(--fg-muted);
  stroke-width: 1;
}
.diagram-box--core {
  stroke: var(--accent);
  stroke-width: 1.4;
}

.diagram-line {
  fill: none;
  stroke: var(--fg-muted);
  stroke-width: 1;
}

.diagram__labels text {
  fill: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

/* stroke-draw animation state, length set via JS */
.diagram-line,
.diagram-box {
  transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Plate 02 — process steps ---- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: 20px;
}

.steps__line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  overflow: visible;
}

.steps__line-path {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.step {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.step__index {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.step p {
  color: var(--fg-muted);
  font-size: 0.98rem;
  max-width: 34ch;
}

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---- Plate 03 — capability cases ---- */
.cases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.case {
  background: var(--bg);
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
}

.case__index {
  color: var(--fg-muted);
  font-size: 10px;
  margin-bottom: 18px;
}

.case .diagram--small {
  width: 100%;
  height: auto;
  margin-bottom: 22px;
}

.case h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.case p {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .cases { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cases { grid-template-columns: 1fr; }
}

/* ---- Signal / CTA ---- */
.signal {
  border-top: 1px solid var(--border);
  padding-top: var(--chapter-gap);
  padding-bottom: var(--chapter-gap);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signal p.mono {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 28px;
}

.signal h2 {
  font-size: clamp(2rem, 4vw + 1rem, 4.5rem);
  max-width: 16ch;
  margin: 0 auto 24px;
}

.signal__note {
  color: var(--fg-muted);
  max-width: 48ch;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 40px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  transition: background 0.25s ease, color 0.25s ease;
}

.cta:hover,
.cta:focus-visible {
  background: var(--accent);
  color: #14100b;
}

.cta__corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
}
.cta__corner--tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.cta__corner--tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.cta__corner--bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.cta__corner--br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.cta--secondary {
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.cta--secondary .cta__corner { border-color: var(--border); }
.cta--secondary:hover,
.cta--secondary:focus-visible {
  background: transparent;
  color: var(--fg);
  border-color: var(--accent);
}
.cta--secondary:hover .cta__corner,
.cta--secondary:focus-visible .cta__corner {
  border-color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(48px, 8vw, 80px) var(--gutter) 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.site-footer__index {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  font-size: 12px;
}

.site-footer__address {
  font-style: normal;
  color: var(--fg);
  line-height: 1.5;
}

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

.site-footer__label {
  color: var(--fg-muted);
  font-size: 10px;
  margin-bottom: 6px;
}

.site-footer__col a {
  color: var(--fg);
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-footer__col a:hover,
.site-footer__col a:focus-visible {
  border-color: var(--accent);
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--fg-muted);
}

@media (max-width: 900px) {
  .site-footer__index { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .site-footer__index { grid-template-columns: 1fr; gap: 24px; }
}

/* ============================================
   LEGAL PAGES (terms / privacy)
   ============================================ */
.legal {
  max-width: var(--max-text);
  margin: 0 auto;
  padding: clamp(120px, 18vw, 180px) var(--gutter) var(--chapter-gap);
}

.legal__tag {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 24px;
}

.legal h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  margin-bottom: 12px;
}

.legal__updated {
  color: var(--fg-muted);
  font-size: 13px;
  margin-bottom: 56px;
}

.legal h2 {
  font-size: 1.3rem;
  margin-top: 48px;
  margin-bottom: 16px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.legal ul {
  padding-left: 20px;
  margin-bottom: 16px;
}
.legal li {
  list-style: disc;
  margin-bottom: 8px;
}

.legal a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
}
.legal a:hover,
.legal a:focus-visible {
  color: var(--accent);
}

.legal strong { color: var(--fg); }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transform: none;
    transition: opacity 0.4s ease;
  }
}

/* ============================================
   CURSOR COORDINATE READOUT (desktop only)
   ============================================ */
.coord-readout {
  position: fixed;
  z-index: 300;
  top: 0;
  left: 0;
  font-size: 10px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translate(-9999px, -9999px);
  white-space: nowrap;
}
.coord-readout.is-visible { opacity: 1; }

@media (max-width: 900px), (pointer: coarse) {
  .coord-readout { display: none; }
}

/* ============================================
   RESPONSIVE — nav collapse
   ============================================ */
@media (max-width: 780px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
}
