/* Uncharted Works — site styles
   Editorial / Cardo / paper-and-ink
   Light mode is default. Dark mode auto-applies if the browser/OS prefers dark.
   Palette, structure, and sizing locked 2026-04-18 per project memory. */

/* ---------- Tokens ----------
   Light is the default. Dark applies when <html data-theme="dark">.
   The theme attribute is set by a small script in layout.njk (persists in localStorage).
*/
:root {
  --bg: #f6f4ef;
  --text: #231f20;
  --text-muted: #6a6255;
  --border: #c8c0ae;
  --accent: #2190c1;
  --surface: #fdfbf6;
  --surface-raised: #ece7dc;

  /* Cross-site bar tokens (shared/styles/crosssite.css) */
  --cs-bg: var(--surface);
  --cs-fg: var(--text-muted);
  --cs-fg-strong: var(--text);
  --cs-rule: var(--border);
  --cs-accent: var(--accent);
  --cs-hover: rgba(35, 31, 32, 0.05);
}
:root[data-theme="dark"] {
  --bg: #1a1713;
  --text: #e8e2d3;
  --text-muted: #968c7a;
  --border: #3a342c;
  --accent: #4ab5e8;
  --surface: #221e19;
  --surface-raised: #13110e;

  /* Dark-mode cross-site bar hover */
  --cs-hover: rgba(232, 226, 211, 0.06);
}

/* ---------- Base ----------
   Universal reset (box-sizing, html/body margin-zero, antialiasing)
   lives in shared/styles/base.css. Only UW-specific body typography below. */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cardo', Georgia, Garamond, 'Times New Roman', Times, 'Open Serif', serif;
  font-size: 18px;
  line-height: 1.65;
}
a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ---------- Container ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header ---------- */
header { padding: 26px 0 18px; }
.header-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text); }
.brand img { height: 36px; width: auto; }
.logo-light { display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.brand-text .wordmark { font-size: 18px; letter-spacing: 0.01em; line-height: 1; }
.brand-text .tag {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}
.top-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; }
.top-nav a { text-decoration: none; font-size: 17px; }
.top-nav a:hover { text-decoration: underline; }

.header-right { display: flex; align-items: center; gap: 24px; }
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Hero ---------- */
.hero {
  padding: 28px 0 56px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
.coords {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.coords::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--text-muted);
}
.hero h1 {
  font-size: 58px;
  line-height: 1.08;
  font-weight: 400;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
  max-width: 760px;
}
.hero h1 em { font-style: italic; color: var(--text-muted); }
.hero p.lede {
  font-size: 22px;
  line-height: 1.5;
  max-width: 640px;
  margin: 0;
}

/* ---------- Sections ---------- */
section { padding: 36px 0; border-top: 1px solid var(--border); }
section h2 {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 0 22px;
}
.section-lead {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 400;
  margin: 0 0 24px;
  max-width: 700px;
}
section p { max-width: 640px; margin: 0 0 18px; }

/* ---------- Products list ---------- */
.product {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.product h3 {
  font-size: 30px;
  font-weight: 400;
  margin: 0 0 8px;
}
.product .meta {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.product p { margin: 0 0 16px; max-width: 620px; }

/* ---------- Home: Showroom product row ----------
   Used on the home page (index.njk) to feature the current UW product.
   Left column = product info (kicker, Cardo title, paragraph, platform pills,
   Buy button + Learn-more link). Right column = stage panel holding a
   paper-raised "sheet" that shows the product art with a soft drop shadow.
   The reserved variant shows a hatched, ghosted placeholder. */
.showroom-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 26px 0 22px;
  border-top: 1px solid var(--border);
  align-items: start;
}
.sr-info h3 {
  font-size: 38px;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.sr-info h3 em { font-style: italic; color: var(--text-muted); }
.sr-info .sub {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.sr-info p {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 16px;
  max-width: 460px;
}
.sr-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 22px;
}
.sr-meta .pill {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.sr-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.btn-buy {
  display: inline-block;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--text);
  padding: 12px 20px;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-buy:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sr-link {
  font-size: 15px;
  text-underline-offset: 4px;
}

.sr-stage {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.sr-stage .sr-corner {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--accent);
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.sr-sheet {
  background: var(--surface);
  width: 76%;
  height: 76%;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 14px 30px -14px rgba(35, 31, 32, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
:root[data-theme="dark"] .sr-sheet {
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
}
.sr-sheet img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

/* Reserved (ghosted) placeholder row — used for the next-product slot */
.showroom-row.reserved { opacity: 0.6; }
.showroom-row.reserved .sr-stage { background: transparent; }
.showroom-row.reserved .sr-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 12px,
    var(--border) 12px,
    var(--border) 13px
  );
  opacity: 0.35;
}

/* ---------- Contact block (copy-and-mailto pattern) ---------- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 0;
}
.copied {
  color: #6cc77a;        /* match ATLAS app's success green */
  font-size: 14px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.copied.show { opacity: 1; }
@media (prefers-color-scheme: dark) {
  .copied { color: #6cc77a; }
}

/* ---------- Footer ---------- */
footer {
  padding: 32px 0 36px;
  border-top: 1px solid var(--border);
  margin-top: 28px;
  text-align: center;
}
.footer-meta {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.footer-meta a { color: var(--text-muted); }
.footer-meta a:hover { color: var(--accent); }
.footer-nav-line { margin-top: 8px; }
.footer-copyright { margin-top: 12px; font-size: 13px; }

/* Centered UW marker. [data-bouncy-marker] is picked up by
   shared/scripts/footer-marker.js — hard scrolls give it a
   velocity kick and it falls back under gravity. */
.footer-marker-wrap {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  /* will-change keeps the transform on its own layer so the bounce is smooth */
  will-change: transform;
}
.footer-marker {
  height: 38px;
  width: auto;
  display: block;
  transform-origin: 50% 100%; /* squash grows from the base */
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Small viewports ---------- */
@media (max-width: 680px) {
  .wrap { padding: 0 24px; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .top-nav ul { gap: 18px; flex-wrap: wrap; }
  .hero h1 { font-size: 44px; }
  .hero p.lede { font-size: 19px; }
  .product { grid-template-columns: 1fr; gap: 8px; }
  .showroom-row { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-meta { text-align: left; }
}
