/* ==========================================================================
   2 Acre Studios — Brand System
   --------------------------------------------------------------------------
   Single source of truth for visual identity. Every page imports this.
   Editorial + considered. Not techie. Designed for GCs, CTOs, managing
   partners at regulated mid-market firms.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Charter:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* ----------------------------------------------------------------------
     Canonical brand tokens (use these in new code).
     Palette doctrine: cool-tinted paper, deep editorial blue accent.
     OKLCH targets in comments; hex used for compatibility.
     The two-blue-squares logo: --blue (deep) + --blue-light (steel).
     ---------------------------------------------------------------------- */

  /* Paper neutrals — slight cool tint, never pure white. */
  --paper:   #F5F7FA;  /* oklch(97% 0.008 250) — page background */
  --paper-2: #EDF1F7;  /* oklch(94% 0.012 250) — secondary surfaces */
  --paper-3: #E1E7F0;  /* oklch(89% 0.015 250) — tertiary surfaces */

  /* Ink — cool dark, never pure black. */
  --ink:       #161D2C;  /* oklch(20% 0.025 250) — body text */
  --ink-soft:  #444C60;  /* oklch(40% 0.025 250) — secondary text */
  --ink-faint: #767D90;  /* oklch(60% 0.02 250) — labels, fine print */

  /* The two blues (logo: two blue squares). */
  --blue:        #1F3F75;  /* oklch(35% 0.13 250) — PRIMARY accent (was rust) */
  --blue-deep:   #162D54;  /* oklch(26% 0.12 250) — hover / pressed state */
  --blue-light:  #5B7FA8;  /* oklch(60% 0.09 240) — SECONDARY (the second square) */
  --blue-soft:   rgba(31, 63, 117, 0.06);  /* subtle wash background */
  --blue-medium: rgba(31, 63, 117, 0.20);  /* selection / hover wash */

  /* Rules + dividers. */
  --rule:      #1F2638;  /* oklch(25% 0.025 250) — section dividers */
  --rule-soft: #C2CAD7;  /* oklch(82% 0.012 250) — within-section dividers */

  /* Success — teal-shifted to harmonize with the blue palette. */
  --success:      #2A6B6F;  /* oklch(45% 0.07 195) */
  --success-soft: rgba(42, 107, 111, 0.08);

  /* ----------------------------------------------------------------------
     Legacy aliases — preserved for /law/, /assessment/, /self-assessment/
     and any other surface still referencing the old token names from the
     prior warm-cream + rust palette. Migrate to the canonical names above.
     ---------------------------------------------------------------------- */
  --warm-white:   var(--paper);
  --warm-white-2: var(--paper-2);
  --warm-white-3: var(--paper-3);
  --rust:         var(--blue);
  --rust-deep:    var(--blue-deep);
  --rust-soft:    var(--blue-soft);
  --rust-medium:  var(--blue-medium);

  /* type scale (target ratio ≥1.20 between steps) */
  --t-xs: 11px;
  --t-sm: 13px;
  --t-base: 17px;
  --t-md: 19px;
  --t-lg: 22px;
  --t-xl: 26px;
  --t-2xl: 36px;
  --t-3xl: 48px;
  --t-4xl: 56px;
  --t-5xl: 68px;

  /* space scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* radii — sparse use, the brand is mostly square */
  --r-sm: 2px;
  --r-md: 4px;

  /* container */
  --container-max: 880px;
  --container-narrow: 680px;
  --container-wide: 1080px;
}

/* ==========================================================================
   Reset + base
   ========================================================================== */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--warm-white);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--rust); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--rust-deep); text-decoration: underline; }

img, svg { max-width: 100%; display: block; }

::selection { background: var(--rust); color: var(--warm-white); }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: "Charter", "Iowan Old Style", Georgia, serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: var(--t-4xl);
  line-height: 1.05;
  letter-spacing: -1.2px;
}

/* Hero / display heading — opt-in, larger than the default h1.
   Used on the homepage hero and any page that earns it. */
h1.display {
  font-size: var(--t-5xl);
  letter-spacing: -1.6px;
  line-height: 1.02;
}

h2 {
  font-size: var(--t-2xl);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

/* Section closing / anchor heading — slightly larger than h2 for crescendo. */
h2.section-close {
  font-size: var(--t-3xl);
  letter-spacing: -0.8px;
  line-height: 1.08;
}

h3 {
  font-size: var(--t-lg);
  line-height: 1.2;
}

h4 {
  font-size: var(--t-md);
  line-height: 1.25;
}

p { margin: 0 0 var(--s-4) 0; max-width: 700px; }

.deck {
  font-family: "Charter", Georgia, serif;
  font-size: var(--t-lg);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
}

.kicker, .section-label, .nav-meta, .mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--rust);
  text-transform: uppercase;
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 6px;
  margin: 0 0 var(--s-5) 0;
}

.section-label .num { color: var(--ink-faint); }

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.container.narrow { max-width: var(--container-narrow); }
.container.wide { max-width: var(--container-wide); }

section {
  padding: var(--s-7) 0;
  border-bottom: 1px solid var(--rule);
}

.section-tight { padding: var(--s-6) 0; }
.section-loose { padding: var(--s-9) 0; }

/* ==========================================================================
   Nav + footer
   ========================================================================== */

.nav {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  background: var(--warm-white);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo, .brand-mark, .header-brand {
  font-family: "Charter", Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.3px;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo:hover, .brand-mark:hover, .header-brand:hover { color: var(--ink); text-decoration: none; }

/* Brand mark — two blue squares, the 2 Acre Studios logo.
   Sized to align with the brand text. The two paired blues reinforce the
   "two squares" identity (deep + steel). */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.logo-mark .logo-square {
  display: block;
  width: 16px;
  height: 16px;
}

.logo-mark .logo-square:first-child  { background: var(--blue); }
.logo-mark .logo-square:last-child   { background: var(--blue-light); }

/* Smaller mark in footer / brand-mark context. */
footer .brand-mark { gap: 10px; }
footer .brand-mark .logo-mark { gap: 2px; }
footer .brand-mark .logo-mark .logo-square {
  width: 12px;
  height: 12px;
}

/* Header-brand context (used on /self-assessment/ and /assessment/, smaller text). */
.header-brand { gap: 10px; }
.header-brand .logo-mark { gap: 2px; }
.header-brand .logo-mark .logo-square {
  width: 14px;
  height: 14px;
}

.nav-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1px;
  color: var(--rust);
  text-transform: uppercase;
}

footer {
  padding: var(--s-6) 0;
  background: var(--warm-white);
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}

.footer-inner .brand-mark {
  font-size: 14px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}

.hero .kicker { margin: 0 0 18px 0; }
.hero h1 { margin: 0 0 24px 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 16px 32px;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3px;
  text-decoration: none;
  border: 2px solid var(--rust);
  background: var(--rust);
  color: var(--warm-white);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}

.btn:hover {
  background: var(--rust-deep);
  border-color: var(--rust-deep);
  color: var(--warm-white);
  text-decoration: none;
}

.btn.btn-secondary {
  background: transparent;
  color: var(--rust);
}

.btn.btn-secondary:hover {
  background: var(--rust);
  color: var(--warm-white);
}

.btn.btn-large {
  padding: 20px 44px;
  font-size: 17px;
}

.btn.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn[disabled], .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-fineprint {
  margin-top: var(--s-3);
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.field {
  margin-bottom: var(--s-5);
}

label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--warm-white);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-sm);
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--rust);
}

textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.field-help {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 4px;
  font-family: "IBM Plex Sans", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* ==========================================================================
   Cards + panels
   ========================================================================== */

.panel {
  background: var(--warm-white-2);
  padding: var(--s-6);
  border-top: 2px solid var(--rust);
}

.panel.success { border-top-color: var(--success); background: var(--success-soft); }

.card {
  background: var(--warm-white);
  border: 1px solid var(--rule-soft);
  padding: var(--s-6);
}

/* ==========================================================================
   CTA section (dark)
   ========================================================================== */

.cta-section {
  background: var(--ink);
  color: var(--warm-white);
  padding: 80px 0;
  border: none;
  text-align: center;
}

.cta-section .kicker { color: var(--rust); }

.cta-section h2 {
  color: var(--warm-white);
  font-size: var(--t-3xl);
  margin: 0 0 18px 0;
}

.cta-section p {
  color: rgba(251, 248, 243, 0.8);
  font-size: 18px;
  margin: 0 auto 36px;
  max-width: 580px;
}

.cta-section .btn-fineprint {
  margin-top: 22px;
  color: rgba(251, 248, 243, 0.5);
}

/* ==========================================================================
   Chat / assessment UI
   ========================================================================== */

.assessment-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
}

.assessment-header {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  background: var(--warm-white);
  position: sticky;
  top: 0;
  z-index: 5;
}

.progress-track {
  height: 3px;
  background: var(--rule-soft);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--rust);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.progress-meta .phase { color: var(--rust); font-weight: 500; }

.chat-stream {
  flex: 1;
  padding: var(--s-6) 0 200px 0;
  overflow-y: auto;
}

.message {
  max-width: 720px;
  margin: 0 auto var(--s-5) auto;
  padding: 0 var(--s-6);
  display: flex;
  gap: var(--s-4);
  animation: fade-in 0.3s ease;
}

.message-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Charter", serif;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}

.message.from-agent .message-avatar {
  background: var(--ink);
  color: var(--warm-white);
}

.message.from-user .message-avatar {
  background: var(--rust);
  color: var(--warm-white);
}

.message-body {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.message.from-agent .message-body {
  font-family: "Charter", Georgia, serif;
  font-size: 18px;
}

.message-body p { margin: 0 0 var(--s-3) 0; max-width: none; }
.message-body p:last-child { margin-bottom: 0; }

.composer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-top: 1px solid var(--rule);
  padding: var(--s-4) 0 var(--s-5);
  z-index: 6;
}

.composer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--s-6);
  display: flex;
  gap: var(--s-3);
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  border: 1px solid var(--rule-soft);
  background: var(--warm-white);
  padding: 12px 14px;
  font-size: 16px;
  font-family: "IBM Plex Sans", sans-serif;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  line-height: 1.5;
}

.composer textarea:focus { border-color: var(--rust); outline: none; }

.composer-send {
  height: 48px;
  padding: 0 22px;
  background: var(--rust);
  color: var(--warm-white);
  border: none;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s;
}

.composer-send:hover { background: var(--rust-deep); }
.composer-send:disabled { opacity: 0.4; cursor: not-allowed; background: var(--rust); }

.composer-meta {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0 var(--s-6);
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1px;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 1em;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: typing-pulse 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quick-reply chips for the agent to suggest answer options */
.quick-replies {
  max-width: 720px;
  margin: -8px auto var(--s-5);
  padding: 0 var(--s-6);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-reply {
  padding: 8px 14px;
  background: var(--warm-white-2);
  border: 1px solid var(--rule-soft);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-reply:hover {
  background: var(--rust-soft);
  border-color: var(--rust);
  color: var(--rust);
}

/* ==========================================================================
   Report page
   ========================================================================== */

.report {
  padding: var(--s-7) 0;
  max-width: var(--container-max);
  margin: 0 auto;
}

.report-section {
  padding: var(--s-6) 0;
  border-top: 1px solid var(--rule-soft);
}

.report-section:first-child { border-top: none; }

.matrix {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--rule);
  margin: var(--s-5) 0;
}

.matrix-header,
.matrix-cell {
  padding: var(--s-4);
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.matrix-header {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--warm-white-2);
  text-align: center;
}

.matrix-cell.quick-wins { background: var(--rust-soft); }
.matrix-cell.strategic { background: var(--success-soft); }

.matrix-cell h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 var(--s-3) 0;
}

.matrix-chip {
  display: block;
  padding: 6px 10px;
  background: var(--warm-white);
  border: 1px solid var(--rule-soft);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.3;
}

.opportunity {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--rule-soft);
}

.opportunity:last-child { border-bottom: none; }

.opportunity h3 { margin-bottom: var(--s-3); }

.opportunity-stat {
  display: inline-block;
  padding: 4px 10px;
  background: var(--rust-soft);
  color: var(--rust);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 8px;
  margin-bottom: 8px;
}

.roi-banner {
  background: var(--ink);
  color: var(--warm-white);
  padding: var(--s-7) var(--s-6);
  margin: var(--s-6) 0;
  text-align: center;
}

.roi-banner .number {
  font-family: "Charter", Georgia, serif;
  font-size: var(--t-3xl);
  font-weight: 700;
  color: var(--warm-white);
  line-height: 1;
  margin-bottom: var(--s-3);
}

.roi-banner .label {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--t-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(251, 248, 243, 0.7);
}

/* ==========================================================================
   Utility
   ========================================================================== */

.text-center { text-align: center; }
.text-soft { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }

.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--s-3); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }

.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--s-3); }
.mb-5 { margin-bottom: var(--s-5); }

.hidden { display: none !important; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --t-4xl: 38px;
    --t-3xl: 32px;
    --t-2xl: 26px;
  }

  .container { padding: 0 var(--s-5); }
  .hero { padding: 56px 0 40px; }
  .deck { font-size: 18px; }
  .nav-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cta-section { padding: 56px 0; }
  .matrix { grid-template-columns: 1fr; }
  .matrix-cell { border-right: none; }
  .composer-inner { padding: 0 var(--s-5); }
  .message { padding: 0 var(--s-5); }
}
