/* Shared styles for every page built on templates/layouts/.
   Reads semantic tokens from static/brand/tokens.css (generated from
   design/tokens.json). Components live in components.css; this file holds
   the base styles and the older shared classes pages still use. */

* { box-sizing: border-box; }
/* Component classes set display; without this they would beat [hidden]. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1020px; margin: 0 auto; padding: 0 var(--space-gutter); }

/* --- Site header ---
   A floating pill instead of a bar glued to the edge: it separates the nav
   from the content without a divider line, which is what lets a long page
   breathe. */
header.nav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: 14px 0;
}
/* Over a dark hero the header takes data-theme="night" instead of the
   per-page overrides it used to need. */
header.nav[data-theme="night"] { background: var(--color-bg-canvas); }
header.nav[data-theme="night"] .nav-in { background: rgb(255 255 255 / .06); box-shadow: none; }
.nav-in {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  padding: 9px 9px 9px 22px;
  box-shadow: 0 1px 2px rgba(20,18,26,.04), 0 10px 30px rgba(20,18,26,.07);
}
/* Interim typographic wordmark ("nocturne" + mono "studio") until the
   drawn logo exists. Replaces "Nocturne.Studio" with the violet dot, the
   most common SaaS-template wordmark there is. */
.brand {
  display: inline-flex; align-items: baseline; gap: 5px;
  font: 700 21px/1 var(--font-display); font-stretch: 85%; letter-spacing: -.03em;
  color: var(--color-text-primary); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__symbol { align-self: center; margin-right: 3px; transform: rotate(-8deg); }
.brand span {
  font: 500 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-accent-brand);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
/* nowrap: without it, between the breakpoint and ~960px the links and the
   CTA broke into two or three lines inside the pill. */
.nav-links a.enlace, .nav-links .nav-cta { white-space: nowrap; }
.nav-links a.enlace {
  color: var(--color-text-secondary); font-size: 14.5px; font-weight: 500;
  text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.nav-links a.enlace:hover {
  color: var(--color-text-primary); background: var(--color-bg-subtle); text-decoration: none;
}
.nav-links .nav-cta { padding: 9px 18px; font-size: 14.5px; margin-left: 6px; }

/* Mobile menu: a <details> so it works without JS. Hidden on desktop,
   where the same links sit inline in the pill. */
.nav-menu { display: none; position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; user-select: none;
  color: var(--color-text-primary); font-size: 14.5px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-pill);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover, .nav-menu[open] summary { background: var(--color-bg-subtle); }
.nav-menu-panel {
  position: absolute; right: -60px; top: calc(100% + 12px);
  min-width: 240px; padding: 8px;
  background: var(--color-bg-surface); border: 1px solid var(--color-border-subtle); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(20,18,26,.14);
}
.nav-menu-panel a {
  display: block; padding: 10px 14px; border-radius: 10px;
  color: var(--color-text-primary); font-size: 15px; font-weight: 500;
}
.nav-menu-panel a:hover { background: var(--color-bg-subtle); text-decoration: none; }
.nav-menu-panel hr { border: 0; border-top: 1px solid var(--color-border-subtle); margin: 6px 8px; }
@media (max-width: 980px) {
  .nav-in { padding: 8px 8px 8px 18px; }
  .nav-links a.enlace { display: none; }
  .nav-menu { display: block; }
}
@media (max-width: 420px) {
  /* The symbol already says "Nocturne"; on a phone the mono "studio" is
     the part of the wordmark that can go. */
  header.nav .brand span { display: none; }
  .nav-in { gap: 8px; padding-left: 14px; }
  .nav-menu summary { padding: 8px 10px; }
  .nav-links .nav-cta { padding: 9px 14px; margin-left: 2px; }
}
/* 320px phones: brand + menu + CTA only fit with a tighter gutter. */
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .nav-in { gap: 4px; padding-left: 12px; }
  .nav-links { gap: 2px; }
  .brand { font-size: 15px; }
  .nav-menu summary { padding: 8px; }
  .nav-links .nav-cta { padding: 8px 12px; font-size: 14px; margin-left: 0; }
}

/* --- Surfaces --- */
.card {
  background: var(--color-bg-surface); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-card); padding: 26px; box-shadow: var(--shadow-raised);
}

h1 { font-family: var(--font-display); font-stretch: 82%; font-size: clamp(36px, 1.5rem + 3.4vw, 64px); line-height: 1; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 700; }
h2 { font-family: var(--font-display); font-size: 22px; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 650; }
.muted { color: var(--color-text-secondary); }

/* --- Forms --- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
/* Control borders use border-strong: a 1px border has to reach 3:1 against
   the field (WCAG 1.4.11), which the subtle border (mist-200) does not. */
.field input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-control);
  border: 1px solid var(--color-border-strong); background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-size: 15px; font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.field input:focus {
  outline: none; border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px rgba(109,90,230,.16);
}
.field .help { font-size: 13px; color: var(--color-text-secondary); margin-top: 6px; }
.field .err { font-size: 13px; color: var(--color-feedback-danger-fg); margin-top: 6px; }

/* --- Full-bleed bands ---
   Pages alternate light and dark bands, which is what gives a long page its
   rhythm. A dark band is any .franja with data-theme="night": the theme
   redefines the colors for everything inside it. */
.franja { padding: var(--space-section-md) 0; }
.franja[data-theme="night"] { background: var(--color-bg-canvas); color: var(--color-text-primary); }
.franja.suave { background: var(--color-bg-subtle); }
.eyebrow-sec {
  display: block; font: 500 12px/1.3 var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-eyebrow); margin-bottom: 12px;
}

/* --- Site footer --- */
footer {
  border-top: 1px solid var(--color-border-subtle); margin-top: 0; padding: 48px 0 40px;
  color: var(--color-text-secondary); font-size: 14px;
}
footer a { color: var(--color-text-secondary); }
footer a:hover { color: var(--color-text-primary); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px;
}
.footer-grid .brand { display: inline-flex; margin-bottom: 12px; }
.footer-grid p { margin: 0; max-width: 260px; }
.footer-col h3 {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-text-primary); margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 4px 0; }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--color-border-subtle); font-size: 13px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* Visible keyboard focus everywhere. The inputs used to drop the outline
   for a 16%-alpha halo that was nearly invisible. */
:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.field input:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 1px; }
code {
  background: var(--color-bg-subtle); border: 1px solid var(--color-border-subtle);
  padding: 1px 6px; border-radius: 6px; font-size: 13px;
  font-family: var(--font-mono);
}
.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;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; }
}
