/* /corridor — Corridor Capital's brand: Navy, Slate, Steel, Off-white; Lato body, Georgia headings. */

@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/lato-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/lato-700.woff2") format("woff2"); }

:root {
  --navy: #00375B;
  --slate: #3A505F;
  --steel: #6B8CA2;
  --off: #F4F6F8;
  --white: #fff;
  --line: rgba(107, 140, 162, 0.35);       /* steel, softened */
  --on-navy-line: rgba(244, 246, 248, 0.28);

  --sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--off);
  color: var(--slate);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; }

.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;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ───────────────────────── Gate (shared module, Corridor colours) ───────────────────────── */

html.unlocked .gate { display: none; }
.gate {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: 16px;
  background: var(--navy);
  color: var(--off);
  transition: opacity 0.6s ease, transform 0.7s var(--ease);
}
.gate.leaving { opacity: 0; transform: scale(1.02); pointer-events: none; }
.gate-form { width: min(100%, 360px); text-align: center; }
.gate-logo { width: 200px; margin: 0 auto 36px; }
.gate-title { margin: 0 0 24px; font: 400 clamp(2rem, 8vw, 2.8rem)/1.1 var(--serif); }
.gate-field { position: relative; }
.gate-input {
  width: 100%; height: 54px;
  padding: 0 56px 0 18px;
  border: 1px solid var(--on-navy-line);
  border-radius: 4px;
  background: rgba(244, 246, 248, 0.08);
  color: var(--off);
  font-size: 18px; letter-spacing: 0.06em;
  caret-color: var(--off);
}
.gate-input::placeholder { color: rgba(244, 246, 248, 0.6); letter-spacing: 0; }
.gate-input:focus { outline: none; border-color: var(--off); }
.gate-go {
  position: absolute; top: 5px; right: 5px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 3px;
  background: var(--off); color: var(--navy);
  cursor: pointer;
}
.gate-form.ok .gate-input { border-color: var(--steel); box-shadow: 0 0 0 4px rgba(107, 140, 162, 0.35); }
.gate-hint {
  height: 44px; margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: rgba(244, 246, 248, 0.75); font-size: 15px;
  opacity: 0; transition: opacity 0.3s ease;
}
.gate-hint.show { opacity: 1; }
.thermo { display: inline-flex; gap: 3px; }
.thermo i { width: 5px; height: 14px; border-radius: 2px; background: var(--on-navy-line); transition: background 0.4s ease; }
.thermo i.on { background: var(--off); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
.gate-form.nope .gate-field { animation: shake 0.45s ease; }

/* ───────────────────────── Masthead & hero ───────────────────────── */

.masthead { padding: 28px 0 0; }
.logo { width: clamp(150px, 22vw, 210px); }

.hero { padding-top: clamp(56px, 10vw, 112px); padding-bottom: clamp(48px, 8vw, 88px); }
.eyebrow {
  margin: 0 0 20px;
  color: var(--steel);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.hero-sentence {
  margin: 0;
  max-width: 22ch;
  color: var(--navy);
  font: 400 clamp(2rem, 5.2vw, 3.5rem)/1.15 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* The "gateway" slash from Corridor's logo, as a quiet divider. */
.wedge {
  width: min(320px, 60%);
  height: 10px;
  margin-top: clamp(32px, 5vw, 48px);
  background: var(--steel);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* ───────────────────────── Sections ───────────────────────── */

/* Side by side (Chris, 2026-10-02): up to three per row, heading on top and text underneath.
   Any count works: a fourth section wraps to a new row; narrow screens drop to two, then one. */
.sections {
  --gap: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - 2 * var(--gap)) / 3)), 1fr));
  gap: clamp(36px, 5vw, 48px) var(--gap);
  padding-bottom: clamp(56px, 9vw, 104px);
}
.section {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 24px;
  border-top: 2px solid var(--steel);
}
.section-heading {
  margin: 0;
  color: var(--navy);
  font: 400 clamp(1.45rem, 2.6vw, 1.8rem)/1.25 var(--serif);
  text-wrap: balance;
}
.section-body p { margin: 0 0 1em; max-width: 64ch; white-space: pre-line; }
.section-body p:last-child { margin-bottom: 0; }

/* ───────────────────────── Ask band (the star) ───────────────────────── */

.band { background: var(--navy); color: var(--off); padding: clamp(56px, 9vw, 104px) 0; }
.band-inner { display: grid; gap: clamp(48px, 7vw, 80px); }
.entry { max-width: 820px; }
.entry-company { padding-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--on-navy-line); }
.entry-heading {
  margin: 0 0 24px;
  color: var(--white);
  font: 400 clamp(1.7rem, 3.6vw, 2.4rem)/1.2 var(--serif);
  text-wrap: balance;
}

.field {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--white);
  color: var(--navy);
  font-size: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field::placeholder { color: var(--steel); opacity: 1; }
.field:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 4px rgba(107, 140, 162, 0.45); }

.ask-form { position: relative; }
.ask-input {
  display: block;
  min-height: 64px;
  padding: 18px 72px 18px 20px;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
}
.send {
  position: absolute; right: 8px; bottom: 8px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: 3px;
  background: var(--navy); color: var(--off);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.send:hover:not(:disabled) { background: var(--slate); }
.send:active:not(:disabled) { transform: scale(0.95); }

.button {
  min-height: 56px;
  padding: 0 28px;
  border: 0; border-radius: 4px;
  background: var(--off); color: var(--navy);
  font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.button:hover:not(:disabled) { background: var(--white); }
.button:active:not(:disabled) { transform: scale(0.98); }
.send:disabled, .button:disabled { opacity: 0.5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  padding: 9px 16px;
  border: 1px solid var(--on-navy-line);
  border-radius: 999px;
  background: transparent;
  color: var(--off);
  font-size: 15px; line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.chip:hover:not(:disabled) { background: rgba(244, 246, 248, 0.1); border-color: rgba(244, 246, 248, 0.6); }
.chip:disabled { opacity: 0.55; cursor: default; }

.company-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; }
.company-form .field { height: 56px; padding: 0 18px; }
@media (max-width: 760px) {
  .company-form { grid-template-columns: 1fr; }
  .company-form .button { width: 100%; }
}

/* ───────────────────────── Results ───────────────────────── */

.result {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 4px;
  background: var(--off);
  color: var(--slate);
  animation: rise 0.4s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.mode {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  color: var(--steel);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.mode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--steel); }
.mode-web::before { background: var(--navy); box-shadow: 0 0 0 3px rgba(0, 55, 91, 0.15); }

.answer p { margin: 0 0 1em; white-space: pre-line; color: var(--navy); }
.answer p:last-child { margin-bottom: 0; }

.sources { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sources h3 { margin: 0 0 8px; color: var(--steel); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sources ol { margin: 0; padding-left: 1.3em; font-size: 15px; }
.sources li { margin: 4px 0; overflow-wrap: anywhere; }
.sources li::marker { color: var(--steel); }

.result.is-error { background: rgba(244, 246, 248, 0.08); border: 1px solid var(--on-navy-line); }
.error { margin: 0; color: var(--off); }

.result.is-loading { display: grid; gap: 12px; }
.skeleton {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(107, 140, 162, 0.18) 0%, rgba(107, 140, 162, 0.38) 50%, rgba(107, 140, 162, 0.18) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton:nth-of-type(2) { width: 92%; }
.skeleton:nth-of-type(3) { width: 76%; }
.skeleton:nth-of-type(4) { width: 54%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ───────────────────────── Company conversation ───────────────────────── */

.thread { display: grid; gap: 14px; margin-top: 24px; }
.thread .result { margin-top: 0; }
.turn-user {
  justify-self: end;
  max-width: min(85%, 620px);
  padding: 14px 18px;
  border: 1px solid var(--on-navy-line);
  border-radius: 4px;
  background: rgba(244, 246, 248, 0.08);
  animation: rise 0.3s var(--ease) both;
}
.turn-label {
  margin: 0 0 4px;
  color: rgba(244, 246, 248, 0.7);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.turn-text { margin: 0; color: var(--off); white-space: pre-line; overflow-wrap: anywhere; }

.reply-form { position: relative; margin-top: 14px; }
.reply-input {
  display: block;
  min-height: 56px;
  padding: 15px 72px 15px 18px;
  font-size: 17px; line-height: 1.5;
  resize: none; overflow-y: auto;
}
.reply-form .send { width: 44px; height: 44px; right: 6px; bottom: 6px; }

.start-over {
  margin-top: 14px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: rgba(244, 246, 248, 0.8);
  font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.start-over:hover { color: var(--white); }

/* ───────────────────────── Footer ───────────────────────── */

.footer { padding: 32px 0 max(32px, env(safe-area-inset-bottom)); }
.footer p { margin: 0; max-width: 72ch; color: var(--steel); font-size: 14px; line-height: 1.6; }

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