/*
 * OUTBOX marketing site -- page-specific styles.
 *
 * Load order (see build.rs's `page_shell`): tokens+base+primitives from
 * `@thenerdybox/ui` (vendor.css), then this file. Nothing here redefines a
 * token; it only lays out markdown-rendered content and this site's own
 * chrome (nav, footer, post cards) on top of them.
 *
 * Self-hosted fonts: these are the only three @font-face rules anywhere in
 * this crate. `tokens.css` names the families in --font-display/--font-body/
 * --font-mono; it does not load them (see its own "NEXT/FONT TRAP" comment)
 * -- that job is this file's, via `/fonts/*.woff2`, embedded into the server
 * binary and served same-origin. No Google Fonts request, ever.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/inter.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
}

/* ambient violet wash, the one flourish this site borrows from the main
   brand site -- deliberately not in base.css (see that file's own comment) */
body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  background: radial-gradient(ellipse 90% 100% at 50% 0%, var(--violet-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Visible only to keyboard/AT users until focused -- standard skip-link
   pattern, required because .site-header's nav sits between the landmark
   boundary and <main>. */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--violet);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--line-soft);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 0;
  flex-wrap: wrap;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-header nav a {
  font-size: 0.92rem;
  color: var(--mute);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

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

.site-header nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--violet);
}

/* ------------------------------------------------------------------- prose */

main.prose {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.prose h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  max-width: 24ch;
  margin: 0 0 1.4rem;
}

.prose h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 2.75rem 0 1rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  max-width: 68ch;
  color: var(--mute);
  font-size: 1.02rem;
}

.prose > h1 + p,
.prose .lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 60ch;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  color: var(--violet-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 92, 255, 0.35);
}

.prose a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose li::marker {
  color: var(--violet);
}

/* Pull-quotes -- the one place a blockquote appears in this content, always
   a short claim set apart, never a literal quotation from someone. */
.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 2px solid var(--coral);
  max-width: 62ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  max-width: none;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.prose pre {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  max-width: 100%;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85em;
  color: var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.65rem 1rem 0.65rem 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.prose th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

.prose td:first-child,
.prose th:first-child {
  color: var(--ink);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 2.5rem 0;
}

/* -------------------------------------------------------------------- media
   Elevation here comes from a border and surface layering, same as
   .post-card above -- never a box-shadow, per the art direction's "borders
   and surface layering, never shadows" rule. No grammar hue appears near an
   image: a screenshot is not the machine talking, so it gets none of
   violet/coral/green/amber. */

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

.prose figure {
  margin: 1.75rem 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.prose figure img {
  margin: 0;
}

.prose figcaption {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------- post chrome */

.crumb {
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.crumb a {
  color: var(--faint);
  border-bottom: none;
}

.crumb a:hover {
  color: var(--violet-soft);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 0 0 2rem;
}

.post-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.post-card {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.post-card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

.post-card-meta {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.post-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.post-card p:last-child {
  margin: 0;
  color: var(--mute);
  font-size: 0.96rem;
  max-width: none;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-soft);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0 2.25rem;
  font-size: 0.86rem;
  color: var(--faint);
}

.site-footer-inner span:last-child {
  margin-left: auto;
}

/* --------------------------------------------------------------- responsive
   No horizontal scroll at 360px: the shell already clamps its own padding
   (see primitives.css), so this only has to keep the header from wrapping
   badly and let wide tables/code scroll inside their own box (already
   `overflow-x: auto` above) rather than the page. */

@media (max-width: 480px) {
  .site-header-inner {
    gap: 0.75rem 1rem;
  }

  .site-header nav {
    gap: 1rem 1.1rem;
  }

  .site-footer-inner span:last-child {
    margin-left: 0;
  }
}
