/*
 * PoliteByte - shared site stylesheet.
 * Loaded by every page (index, products, support). No imports,
 * no preprocessor, no build step.
 *
 * Aesthetic: small literary press / editorial imprint. System serif
 * typography, paper-cream surface, brand teal as ink and amber as
 * annotation. No card grids, no panels, no rounded corners outside
 * the skip link. Hairline rules and typographic detail carry the
 * visual weight.
 */

/* ---------------------------------------------------------------- *
 * 1. Design tokens
 * ---------------------------------------------------------------- */
:root {
  --color-brand-primary: #2C7A7B;
  --color-brand-secondary: #D69E2E;
  --color-on-brand: #ffffff;
  --gradient-brand: linear-gradient(135deg, #2C7A7B 0%, #D69E2E 100%);

  --color-surface: #F5EFE3;
  --color-surface-alt: #ECE6D8;
  --color-text: #1F1A14;
  --color-muted: #5C5648;
  --color-border: #D9CFB8;
  --color-rule-soft: rgba(31, 26, 20, 0.12);

  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Cambria, Georgia, serif;
  --font-size-base: 1.0625rem;
  --line-height-base: 1.65;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;

  --max-width: 64rem;
  --max-width-prose: 36rem;
  --radius: 0.25rem;
  --transition: 200ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: #15120D;
    --color-surface-alt: #1D1A14;
    --color-text: #ECE6D8;
    --color-muted: #A39A87;
    --color-border: #34302A;
    --color-rule-soft: rgba(236, 230, 216, 0.14);
  }
}

/* ---------------------------------------------------------------- *
 * 2. Reset & base
 * ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-feature-settings: "kern", "liga", "calt", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(44, 122, 123, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color var(--transition);
}
a:hover {
  text-decoration-color: var(--color-brand-primary);
}
:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: 1px;
}
hr {
  border: 0;
  margin: 0;
}

/* ---------------------------------------------------------------- *
 * 3. Typography
 * ---------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 var(--space-4);
}
h1 {
  font-size: 2.5rem;
  letter-spacing: -0.012em;
  line-height: 1.12;
}
h2 {
  font-size: 1.375rem;
  margin-top: var(--space-7);
}
h3 {
  font-size: 1.125rem;
  margin-top: 0;
}
p {
  margin: 0 0 var(--space-4);
}

.eyebrow {
  font-size: 0.8125rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-style: normal;
  font-weight: 500;
  color: var(--color-muted);
  margin: 0 0 var(--space-3);
}

.lede {
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 42ch;
  color: var(--color-text);
  margin: 0;
}

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

.section-break {
  margin: var(--space-7) auto;
  text-align: center;
}
.section-break::before {
  content: "·   ·   ·";
  letter-spacing: 0.4em;
  color: var(--color-brand-secondary);
  font-size: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  .page-opener > *,
  .principles > li {
    animation: rise 500ms ease-out both;
  }
  .page-opener > :nth-child(1) { animation-delay: 0ms; }
  .page-opener > :nth-child(2) { animation-delay: 60ms; }
  .page-opener > :nth-child(3) { animation-delay: 120ms; }
  .principles > li:nth-child(1) { animation-delay: 200ms; }
  .principles > li:nth-child(2) { animation-delay: 250ms; }
  .principles > li:nth-child(3) { animation-delay: 300ms; }
  .principles > li:nth-child(4) { animation-delay: 350ms; }
  .principles > li:nth-child(5) { animation-delay: 400ms; }
  .principles > li:nth-child(6) { animation-delay: 450ms; }
}

/* ---------------------------------------------------------------- *
 * 4. Layout primitives
 * ---------------------------------------------------------------- */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.prose {
  max-width: var(--max-width-prose);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-text);
  color: var(--color-surface);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}
main {
  padding: var(--space-7) 0 var(--space-8);
}

/* ---------------------------------------------------------------- *
 * 5. Site header & primary nav
 * ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-5) 0;
}
.site-header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
}
.brand {
  font-style: italic;
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  color: var(--color-text);
}
.brand:hover {
  color: var(--color-brand-primary);
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header .site-nav ul {
  display: flex;
  gap: var(--space-6);
}
.site-nav a {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
}
.site-header .site-nav a {
  position: relative;
  padding-bottom: 2px;
}
.site-header .site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-brand-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.site-header .site-nav a:hover::after,
.site-header .site-nav a:focus-visible::after {
  transform: scaleX(1);
}

/* ---------------------------------------------------------------- *
 * 6. Page opener (replaces hero on every page)
 * ---------------------------------------------------------------- */
.page-opener {
  max-width: var(--max-width-prose);
  margin: 0 auto var(--space-6);
  padding: var(--space-8) var(--space-6) 0;
}
.page-opener .eyebrow {
  margin-bottom: var(--space-4);
}
.page-opener h1 {
  margin-bottom: var(--space-5);
  max-width: 18ch;
}
.page-opener .lede {
  max-width: 42ch;
}

/* ---------------------------------------------------------------- *
 * 7. Components
 * ---------------------------------------------------------------- */

/* A numbered list of principles, no card framing. Roman numerals
 * set in amber italic small caps via CSS counters. */
.principles {
  counter-reset: principle;
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0 0;
}
.principle {
  counter-increment: principle;
  border-top: 1px solid var(--color-border);
  padding: var(--space-5) 0;
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: var(--space-5);
  align-items: baseline;
}
.principle:last-child {
  border-bottom: 1px solid var(--color-border);
}
.principle::before {
  content: counter(principle, upper-roman) ".";
  grid-column: 1;
  font-style: italic;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--color-brand-secondary);
  font-size: 0.9375rem;
}
.principle h3 {
  grid-column: 2;
  margin: 0 0 var(--space-2);
  font-weight: 500;
  font-size: 1.1875rem;
}
.principle p {
  grid-column: 2;
  margin: 0;
  color: var(--color-muted);
  max-width: 50ch;
}

/* Product entry on products.html; replaces the card layout. */
.product-list {
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0 0;
}
.product-entry {
  border-top: 1px solid var(--color-border);
  padding: var(--space-6) 0;
}
.product-list .product-entry:last-child {
  border-bottom: 1px solid var(--color-border);
}
.product-entry .eyebrow {
  margin: 0 0 var(--space-3);
}
.product-entry .eyebrow[data-status="comingSoon"] {
  color: var(--color-brand-secondary);
  font-style: italic;
}
.product-entry .eyebrow[data-status="available"] {
  color: var(--color-brand-primary);
}
.product-entry h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.5rem;
  font-weight: 500;
}
.product-entry .product-tagline {
  margin: 0 0 var(--space-4);
  font-style: italic;
  color: var(--color-muted);
  max-width: 42ch;
}
.product-entry .product-meta {
  margin: 0;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  font-size: 0.9375rem;
}
.product-entry .product-link {
  color: var(--color-brand-primary);
}
.product-entry .product-store {
  color: var(--color-muted);
  margin-left: var(--space-4);
}

/* Support page: typeset entries, no cards. Email is the visual focal
 * point of the studio-contact section. */
.support-entry {
  border-top: 1px solid var(--color-border);
  padding: var(--space-6) 0;
  margin: 0;
}
.support-entry:last-of-type {
  border-bottom: 1px solid var(--color-border);
}
.support-entry h2 {
  margin: 0 0 var(--space-3);
  font-size: 0.9375rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  font-weight: 500;
}
.support-entry p {
  margin: 0 0 var(--space-4);
  max-width: 50ch;
}
.support-entry p:last-child {
  margin-bottom: 0;
}
.contact-email {
  font-size: 1.5rem;
  font-style: italic;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-brand-primary);
  text-underline-offset: 0.2em;
}

/* ---------------------------------------------------------------- *
 * 8. Site footer (colophon)
 * ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-7) 0 var(--space-8);
  font-size: 0.9375rem;
}
.site-footer-inner {
  max-width: var(--max-width-prose);
  margin: 0 auto;
  padding: 0 var(--space-6);
  color: var(--color-muted);
}
.site-footer .eyebrow {
  margin: 0 0 var(--space-3);
}
.site-footer-tagline {
  font-style: italic;
  color: var(--color-text);
  margin: 0 0 var(--space-4);
  font-size: 1.0625rem;
}
.site-footer .site-nav ul {
  display: block;
  margin: 0 0 var(--space-3);
}
.site-footer .site-nav li {
  display: inline;
}
.site-footer .site-nav li + li::before {
  content: "·";
  margin: 0 var(--space-3);
  color: var(--color-border);
}
.site-footer .site-nav a {
  color: var(--color-muted);
}
.site-footer .site-nav a:hover {
  color: var(--color-brand-primary);
}
.site-footer-contact,
.site-footer-copyright {
  margin: 0 0 var(--space-2);
}
.site-footer-copyright {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- *
 * 9. Responsive
 * ---------------------------------------------------------------- */
@media (max-width: 600px) {
  .content,
  .prose,
  .site-footer-inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .page-opener {
    padding: var(--space-7) var(--space-4) 0;
  }
  .site-header {
    padding: var(--space-4) 0;
  }
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .site-header .site-nav ul {
    flex-wrap: wrap;
    gap: var(--space-4);
  }
  .site-nav a {
    letter-spacing: 0.1em;
  }
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.25rem;
  }
  .principle {
    grid-template-columns: 1fr;
    row-gap: var(--space-1);
    padding: var(--space-5) 0;
  }
  .principle::before,
  .principle h3,
  .principle p {
    grid-column: 1;
  }
  .contact-email {
    font-size: 1.25rem;
  }
  main {
    padding: var(--space-6) 0 var(--space-7);
  }
}
