/* ===========================================================================
   smartpwc — brand-aligned to PwC design system (Sharp Design)
   Tokens copied from brand_details.md §7 and design_system.md §4.
   =========================================================================== */

:root {
  /* Brand — Orange */
  --brand-50: #FFF5ED;
  --brand-100: #FFE8D4;
  --brand-200: #FFCDA8;
  --brand-300: #FFAA72;
  --brand-400: #FE7C39;
  --brand-500: #FD5108;
  --brand-600: #EE3D08;
  --brand-700: #C52B09;
  --brand-800: #9C2310;

  /* Grey */
  --grey-50: #F5F7F8;
  --grey-100: #EEEFF1;
  --grey-200: #DFE3E6;
  --grey-300: #CBD1D6;
  --grey-600: #8E95A2;
  --grey-700: #787E8A;
  --grey-800: #626771;
  --grey-950: #303236;
  --grey-1000: #111113;

  /* Tangerine — secondary accent for the aurora */
  --tangerine-300: #FFD646;
  --tangerine-500: #FF9F00;

  /* Semantic */
  --page-bg: #F5F7F8;
  --surface: #FFFFFF;
  --hover-bg: #FFF5ED;
  --fg: #111113;
  --fg-muted: #626771;
  --fg-soft: #787E8A;
  --line: #CBD1D6;
  --line-soft: #EEEFF1;
  --focus-ring: #111113;

  /* Shape — Sharp Design */
  --radius-none: 0px;
  --radius-subtle: 4px;
  --radius-full: 9999px;

  /* Typography */
  --font-serif: 'Charter', 'ITC Charter', 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Elevation — Low only (Sharp design keeps things flat) */
  --elev-low: 0 1px 2px rgba(17, 17, 19, 0.06);
  --elev-mid: 0 2px 4px rgba(17, 17, 19, 0.06), 0 12px 32px rgba(17, 17, 19, 0.08);

  /* Layout */
  --maxw: 760px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* ===========================================================================
   Aurora — ambient peach wash while the agent is thinking.
   Full-viewport layered radial gradient that fades to transparent at every
   edge, so there's no visible "blob" shape — just atmosphere. Slow opacity
   breath gives it life without movement.
   =========================================================================== */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease;
  background:
    radial-gradient(ellipse 65% 55% at 50% 105%,
      rgba(255, 170, 114, 0.42) 0%,
      rgba(255, 205, 168, 0.25) 30%,
      rgba(255, 232, 212, 0.10) 60%,
      transparent 85%),
    radial-gradient(ellipse 90% 70% at 50% 85%,
      rgba(255, 205, 168, 0.18) 0%,
      rgba(255, 232, 212, 0.08) 45%,
      transparent 80%);
}
body.is-thinking .aurora {
  opacity: 1;
  animation: aurora-breathe 7s ease-in-out infinite alternate;
}

@keyframes aurora-breathe {
  0%   { opacity: 0.85; }
  100% { opacity: 1;    }
}

@media (prefers-reduced-motion: reduce) {
  body.is-thinking .aurora { animation: none; }
}

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

.layout {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.25rem 6rem;
  position: relative;
}
.layout--landing { justify-content: flex-start; }
.layout--results { padding-top: 2rem; }

/* ===========================================================================
   Brand mark — PwC logo + vertical separator + app name
   Following design_system.md §2.1
   =========================================================================== */

.brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2.25rem;
  transition: margin-bottom 200ms ease;
}
.layout--landing .brand {
  margin-top: clamp(2rem, 12vh, 7rem);
}
.brand__logo {
  height: 52px;
  width: auto;
  display: block;
  transition: height 200ms ease;
}
.layout--results .brand__logo { height: 34px; }

/* ===========================================================================
   Search form — Sharp Design (0px radius)
   =========================================================================== */

.ask {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-none);
  padding: 0;
  box-shadow: var(--elev-low);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.ask:focus-within {
  border-color: var(--focus-ring);
  outline: none;
  box-shadow: 0 0 0 var(--radius-subtle) rgba(253, 81, 8, 0.12), var(--elev-low);
}
.ask input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.95rem 1.25rem;
  color: var(--fg);
  min-width: 0;
}
.ask input::placeholder { color: var(--fg-soft); }
.ask__btn {
  border: 0;
  background: var(--brand-500);
  color: #ffffff;
  font: inherit;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0 1.5rem;
  border-radius: var(--radius-none);
  cursor: pointer;
  transition: background-color 140ms ease;
  min-width: 110px;
}
.ask__btn:hover { background: var(--brand-700); }
.ask__btn:active { background: var(--grey-1000); }
.ask__btn:disabled { background: var(--grey-300); color: var(--grey-600); cursor: progress; }

.hint {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: 0.85rem;
  text-align: center;
  max-width: var(--maxw);
}

/* ===========================================================================
   Thinking state — sweeping gradient bar + rotating status line.
   Uses the brand's "Expressive Foreground" gradient (brand-details §3).
   =========================================================================== */

.thinking {
  margin-top: 3rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.thinking__bar {
  position: relative;
  width: min(420px, 80%);
  height: 2px;
  background: var(--grey-200);
  overflow: hidden;
}
.thinking__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    #FE8303 25%,
    var(--brand-500) 50%,
    var(--brand-600) 75%,
    transparent 100%);
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .thinking__bar::after { animation-duration: 4s; }
}

.thinking__status {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--fg-muted);
  letter-spacing: 0.005em;
  text-align: center;
  min-height: 1.4em;
  transition: opacity 250ms ease;
}
.thinking__status.is-fading { opacity: 0; }

/* ===========================================================================
   Answer — agent voice, no search-result chrome
   =========================================================================== */

.answer {
  margin-top: 2.75rem;
  width: 100%;
  max-width: var(--maxw);
}

.answer__error {
  background: #FEF2F2;
  border-left: 3px solid #D62222;
  color: #5B0E0E;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}

.answer__intro {
  font-family: var(--font-serif);
  font-size: 1.225rem;
  line-height: 1.55;
  color: var(--fg);
  margin: 0 0 2.5rem;
  letter-spacing: -0.005em;
  animation: reveal 600ms ease both;
}

.answer__details-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}
.answer__details-label::after {
  /* Orange underline accent (design_system.md §1.2 — H2 pattern) */
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: var(--brand-500);
}

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

.service {
  padding: 1.35rem 0 1.75rem;
  border-top: 1px solid var(--line-soft);
  animation: reveal 500ms ease both;
}
.service:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}
.service:last-child {
  padding-bottom: 0.5rem;
}
/* Stagger reveals so the answer fills in alive */
.service:nth-child(1) { animation-delay: 80ms; }
.service:nth-child(2) { animation-delay: 200ms; }
.service:nth-child(3) { animation-delay: 320ms; }

.service__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.service__title a {
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  transition: color 140ms ease;
}
.service__title a:hover { color: var(--brand-500); }
.service__title .ext {
  font-size: 0.75em;
  color: var(--fg-soft);
  transition: color 140ms ease;
  transform: translateY(-0.05em);
}
.service__title a:hover .ext { color: var(--brand-500); }

.service__summary {
  margin: 0 0 0.95rem;
  color: var(--grey-950);
  font-size: 1rem;
  line-height: 1.55;
}

.service__people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

/* Chips — the one full-radius element per design_system.md §3.4 */
.person {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.35rem 0.75rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  text-decoration: none;
  line-height: 1.35;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.person--link:hover {
  background: var(--hover-bg);
  border-color: var(--brand-300);
  color: var(--brand-700);
}
.person--link:hover .person__role { color: var(--brand-700); }
.person strong { font-weight: 500; }
.person__role { color: var(--fg-muted); font-weight: 400; }

.empty-people {
  color: var(--fg-soft);
  font-size: 0.85rem;
  font-style: italic;
}

.service__cta {
  margin-top: 0.85rem;
}
.service__rfp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--brand-500);
  text-decoration: none;
  letter-spacing: 0.005em;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.service__rfp:hover {
  color: var(--brand-700);
  border-bottom-color: var(--brand-700);
}
.service__rfp span {
  transition: transform 140ms ease;
  display: inline-block;
}
.service__rfp:hover span { transform: translateX(2px); }

@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .answer__intro,
  .service { animation: none; }
}
