/*/* Clarence — AI consultancy for Australian small businesses
   Hand-tuned, no framework. Lean, fast, scannable. */

:root {
  --bg: #fbfaf7;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #5e5e5e;
  --line: #e6e3dc;
  --accent: #c8462a; /* warm Aussie red-orange */
  --accent-ink: #ffffff;
  --accent-soft: #fbeee8;
  --good: #2f6f3f;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --radius: 6px;
  --maxw: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

/* Layout */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
header.site .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
}
header.site .brand .brand-mark {
  width: 28px;
  height: 28px;
  display: inline-block;
  flex-shrink: 0;
}
header.site nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
header.site nav a {
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 15px;
}
header.site nav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
}
header.site nav .pill {
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 14px;
}
header.site nav .pill.user {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
}
header.site nav .pill.user .user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}

footer.site {
  margin-top: 80px;
  padding: 48px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
}
footer.site .row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
  font-weight: 700;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin: 0 0 8px;
}
.footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.footer-col.brand-col .footer-tagline {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 600;
}
.footer-meta {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-muted);
}
@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}
@media (max-width: 420px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Page banner (used on /chat and /apply) */
.page-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1536 / 768;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 32px;
  border: 1px solid var(--line);
}
@media (max-width: 720px) {
  .page-banner {
    aspect-ratio: 4 / 3;
  }
}

/* Hero */
.hero {
  padding: 80px 0 56px;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 48px;
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero p.lede {
  font-size: 21px;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 0 28px;
}
.hero .cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero .meta {
  margin-top: 36px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--ink-muted);
  font-size: 14px;
}
.hero .meta span strong {
  color: var(--ink);
  display: block;
  font-size: 18px;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--ink-soft);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: #b03d24;
  border-color: #b03d24;
}
.btn.ghost {
  background: transparent;
}
.btn.sm {
  padding: 8px 14px;
  font-size: 14px;
}

/* Sections */
section {
  padding: 56px 0;
}
section h2 {
  font-size: 32px;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
section p.section-lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 0 32px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--ink-soft);
  text-decoration: none;
}
.card .card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 220px;
  object-fit: cover;
  display: block;
  background-color: var(--accent-soft);
  flex-shrink: 0;
}
.card .card-img-wrap {
  position: relative;
  flex-shrink: 0;
}
.card .badge-popular {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.card .card-body {
  padding: 20px;
}
.card .card-body {
  border-top: 1px solid var(--line);
}
.card .tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.card p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 12px;
}
.card .arch {
  font-size: 13px;
  color: var(--ink-muted);
}
.card .arch.pages {
  font-variant-numeric: tabular-nums;
}

/* Catalog page */
.catalog-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.catalog-toolbar input {
  flex: 1;
  min-width: 240px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  background: #fff;
  font-family: inherit;
}
.catalog-toolbar select {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}
.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.catalog-chip:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}
.catalog-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.catalog-chip .count {
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}
.catalog-chip[aria-pressed="true"] .count {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}
.catalog-empty {
  padding: 48px;
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Item page */
.item-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  margin: 24px 0;
}
.item-page .item-hero {
  width: calc(100% + 72px);
  margin: -36px -36px 24px;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 200px;
  object-fit: cover;
  display: block;
  background-color: var(--accent-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
.item-page h1 {
  margin-top: 0;
  font-size: 36px;
}
.item-page .arch-meta {
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.item-page dl {
  margin: 20px 0;
}
.item-page dt {
  font-weight: 600;
  margin-top: 12px;
}
.item-page dd {
  margin-left: 0;
  color: var(--ink-soft);
}
.item-page .download-bar {
  margin-top: 24px;
  padding: 20px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-mask.open {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 8px;
  max-width: 420px;
  width: 100%;
  padding: 32px;
  position: relative;
}
.modal h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.modal p {
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-size: 15px;
}
.modal .close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink-muted);
  padding: 4px 8px;
}
.modal .google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.modal .google-btn:hover {
  border-color: var(--ink);
}
.modal .privacy {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

/* Apply page */
.apply-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
}
.apply-form label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}
.apply-form input,
.apply-form select,
.apply-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.apply-form textarea {
  min-height: 120px;
  resize: vertical;
}
.apply-form .submit {
  margin-top: 24px;
}

/* Chat page */
.chat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 600px;
}
.chat-card .step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.chat-card .step:last-child {
  border-bottom: none;
}
.chat-card .step .num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.chat-card .step h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}
.chat-card .step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* Misc */
.quote {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 24px 28px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 19px;
  color: var(--ink);
  font-style: italic;
  margin: 32px 0;
}
.quote cite {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-muted);
  font-style: normal;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 15px;
}
.alert.error {
  background: #fdecea;
  border: 1px solid #f5c2bf;
  color: #842029;
}
.alert.success {
  background: #e8f3eb;
  border: 1px solid #b8dac3;
  color: #1e4d2a;
}

@media (max-width: 640px) {
  .hero {
    padding: 48px 0 32px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .hero p.lede {
    font-size: 18px;
  }
  section h2 {
    font-size: 26px;
  }
  .item-page {
    padding: 24px;
  }
  .item-page .item-hero {
    width: calc(100% + 48px);
    margin: -24px -24px 20px;
  }
  .modal {
    padding: 24px;
  }
  .card .card-body {
    padding: 16px;
  }
}

/* Footer heading (was h4, demoted to p for heading-order correctness) */
.footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 8px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--ink);
  line-height: 1;
}
@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }
  header.site nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    z-index: 100;
  }
  header.site nav.open {
    display: flex;
  }
  header.site nav a {
    padding: 10px 0;
  }
}

/* Screen-reader only utility */
.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;
}

/* Skip-to-main link (TKT-053 I6). Hidden until focused so keyboard /
   screen-reader users can bypass the header on every page load. WCAG 2.4.1. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  font-size: 14px;
}
.skip-link:focus {
  left: 12px;
}

/* Apply form — progress + inline hints + error (TKT-053 I4) */
.apply-progress {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 6px;
  margin: 0 0 16px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.apply-progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 999px;
}
.apply-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.apply-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}
.field-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
}
.field-error {
  margin: 4px 0 0;
  font-size: 13px;
  color: #842029;
  line-height: 1.45;
}
.apply-form input[aria-invalid="true"],
.apply-form textarea[aria-invalid="true"] {
  border-color: #c33;
  background: #fff7f6;
}
.btn.sending {
  opacity: 0.7;
  cursor: wait;
}

/* Card CTA hint (TKT-053 I3). Tiny "Read playbook →" sits below the meta
   so the card reads as an action without dominating the visual. */
.card .card-cta {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* main element focus ring (when skip-link targets it) — visible only when
   focused via keyboard, not on click. */
main:focus {
  outline: none;
}
main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}
