/* Shared design for every First Chair page: header, menu, footer and article text */
:root {
  --brand-navy: #1b2638;
  --brand-accent: #c85a14;
  --brand-accent-dark: #a94a0f;
  --sunrise: #fde9bb;
  --page-bg: #f6f4ef;
  --card-bg: #ffffff;
  --brand-text: #23262b;
  --muted: #636a75;
  --line: rgba(27,38,56,0.14);
  --border-subtle: rgba(27,38,56,0.08);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--brand-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-accent-dark); }

/* ===== Header and menu ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246,244,239,0.96);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--brand-navy);
  text-decoration: none;
  min-width: 0;
}

.brand img { width: 40px; height: 40px; border-radius: 50%; display: block; flex: none; }

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--brand-navy);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}

.site-nav { display: flex; align-items: center; gap: 22px; }

.site-nav a,
.site-nav summary {
  color: var(--brand-navy);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav summary:hover { color: var(--brand-accent-dark); }

.nav-group { position: relative; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: " ▾"; font-size: 0.75em; }

.nav-group-links {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 190px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(27,38,56,0.14);
}

.nav-group-links a { display: block; padding: 7px 10px; border-radius: 8px; }
.nav-group-links a:hover { background: var(--page-bg); }

/* ===== Page title band ===== */
.page-hero {
  position: relative;
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 34px 16px 56px;
  text-align: center;
  background: var(--sunrise);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.8rem;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-navy);
  margin: 0;
}

.page-hero p { margin: 10px auto 0; max-width: 640px; color: var(--brand-navy); }

.ridge {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 40px;
  color: var(--page-bg);
}

/* ===== Article text ===== */
.page-main { padding: 20px 16px 48px; }

.prose { max-width: 720px; margin: 0 auto; line-height: 1.7; font-size: 1.02rem; }

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  color: var(--brand-navy);
  line-height: 1.15;
  margin: 1.5em 0 0.35em;
}

.prose h2 { font-size: 1.85rem; }
.prose h3 { font-size: 1.4rem; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose .lede { font-size: 1.2rem; color: var(--brand-navy); font-weight: 500; line-height: 1.45; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1em 0; border-radius: 10px; }

/* ===== Tiles on the two menu pages ===== */
.tile-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.tile {
  display: block;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  text-decoration: none;
  color: var(--brand-text);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}

.tile strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.tile span { font-size: 0.92rem; line-height: 1.45; }

@media (hover:hover) {
  .tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(27,38,56,0.10); }
}

/* ===== Arduino code and RoastLAB tool ===== */
.code-block { position: relative; margin: 0 0 1.2em; }

.code-block pre {
  margin: 0;
  padding: 16px;
  max-height: 560px;
  overflow: auto;
  background: var(--brand-navy);
  color: #f3f4f6;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 18px;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.tool-frame {
  display: block;
  width: 100%;
  max-width: 1000px;
  height: 1220px;
  margin: 24px auto 0;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--card-bg);
}

/* ===== Home intro ===== */
.home-intro { max-width: 760px; margin: 0 auto; padding: 24px 16px 8px; text-align: center; }
.home-intro img { width: 180px; height: 180px; border-radius: 50%; }
.home-intro p { margin: 14px 0 0; line-height: 1.65; }

/* ===== Main buttons ===== */
.btn-primary {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--brand-accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(200,90,20,0.25);
  transition: background 120ms ease-out;
}

.btn-primary:hover:not(:disabled) { background: var(--brand-accent-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: default; box-shadow: none; }

/* ===== Cart button in the header ===== */
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.cart-button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--brand-navy);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== Cart panel (slides in from the right) ===== */
.cart-panel {
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  width: min(420px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--page-bg);
  color: var(--brand-text);
  box-shadow: -10px 0 30px rgba(27,38,56,0.25);
  font-family: var(--font-body);
}

.cart-panel[open] { animation: cart-in 180ms ease-out; }
@keyframes cart-in { from { transform: translateX(40px); opacity: 0; } }

.cart-panel::backdrop { background: rgba(27,38,56,0.55); }

.cart-inner { padding: 18px 18px 26px; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-navy);
}

.cart-close {
  border: none;
  background: transparent;
  color: var(--brand-navy);
  font-size: 1.1rem;
  padding: 6px 8px;
  cursor: pointer;
}

#checkout-submit { margin-top: 14px; }
.cart-empty { text-align: center; padding: 30px 0 12px; }
.cart-wide { display: block; width: 100%; padding: 11px 16px; }

.cart-lines { list-style: none; margin: 0; padding: 0; }

.cart-line {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-line-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-navy);
}

.cart-line-size { margin-top: 2px; font-size: 0.85rem; color: var(--muted); }
.cart-line-warning { margin-top: 6px; font-size: 0.85rem; color: #b00020; }
.cart-line.is-unavailable .cart-line-top { opacity: 0.6; }

.cart-line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qty-stepper button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--brand-navy);
  font-size: 1.05rem;
  cursor: pointer;
}

.qty-stepper button:disabled { opacity: 0.3; cursor: default; }

.cart-remove {
  border: none;
  background: none;
  padding: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 1.1rem;
  color: var(--brand-navy);
}

.cart-summary-small { font-size: 0.92rem; color: var(--muted); }
.cart-note { margin: 6px 0 14px; font-size: 0.85rem; color: var(--muted); }

.cart-back {
  border: none;
  background: none;
  padding: 0 0 10px;
  color: var(--brand-navy);
  font-size: 0.9rem;
  cursor: pointer;
}

.cart-subheading {
  margin: 20px 0 4px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand-navy);
}

.order-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; flex: 1; min-width: 0; }
.order-form-row { display: flex; gap: 8px; }

.order-label, .cart-note-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart-note-label { display: block; margin-top: 16px; }

.order-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--brand-text);
  font-family: inherit;
  font-size: 16px; /* stops phones zooming in on the field */
}

.order-input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(200,90,20,0.18);
}

.order-textarea { min-height: 62px; resize: vertical; }
.form-note { font-size: 0.8rem; color: #7a3d0c; }

.checkout-error {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fde2e1;
  color: #b00020;
  font-size: 0.88rem;
}

.venmo-note-row { display: flex; gap: 8px; margin-top: 4px; }

.venmo-copy {
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--brand-navy);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Confirmation after Add to cart ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.added-bar {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  padding: 12px 10px 12px 16px;
  border-radius: 14px;
  background: var(--brand-navy);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(27,38,56,0.3);
  font-size: 0.92rem;
  line-height: 1.35;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease-out, transform 160ms ease-out, visibility 160ms;
}

.added-bar.is-visible { visibility: visible; opacity: 1; transform: none; }
.added-bar-text { flex: 1; min-width: 0; }

.added-bar-view {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--sunrise);
  color: var(--brand-navy);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.added-bar-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
}

.added-bar button:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

@media (max-width: 860px) {
  .added-bar { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .added-bar { transition: none; transform: none; }
}

/* Hidden trap field for spam bots; people never see it */
.website-field { position: absolute; left: -9999px; }

@media (prefers-reduced-motion: reduce) {
  .cart-panel[open] { animation: none; }
}

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border-subtle); background: var(--sunrise); color: var(--brand-navy); }

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  font-size: 0.92rem;
}

.site-footer a { color: var(--brand-navy); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ===== Phones ===== */
@media (max-width: 860px) {
  .menu-button { display: block; flex: none; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--page-bg);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open { display: flex; }
  .site-nav > a, .site-nav summary { display: block; padding: 10px 4px; font-size: 1.05rem; }

  .nav-group-links {
    position: static;
    max-height: none;
    padding: 0 0 6px 12px;
    background: none;
    border: none;
    box-shadow: none;
  }

  .page-hero { margin: 10px 10px 0; padding: 26px 14px 48px; }
  .page-hero h1 { font-size: 2.2rem; }
  .brand { font-size: 1.05rem; gap: 6px; }
  .brand img { width: 34px; height: 34px; }
  .site-header-inner { gap: 8px; padding: 10px 12px; }
  .menu-button, .cart-button { padding: 7px 11px; font-size: 0.85rem; }
}
