/* =========================================================================
   SoCal Transit Connections — mockup styles
   Design tokens mirror the VoyageAI demo convention (CSS custom properties
   on :root, Public Sans as the type family).
   ========================================================================= */

:root {
    /* Ink */
    --ink: #111827;
    --ink-muted: #4b5563;
    --ink-faint: #6b7280;

    /* Surfaces */
    --page: #f4f6f8;
    --surface: #ffffff;
    --surface-sunk: #eef1f5;
    --border: #dfe4ea;
    --border-strong: #c8d0da;

    /* Accents */
    --accent: #12508f;
    --accent-deep: #0d3a6a;
    --accent-soft: #e8f0f9;
    --accent-ring: rgba(18, 80, 143, 0.28);

    --signal: #c2680a;
    --signal-soft: #fdf3e5;

    --good: #1c7a4a;
    --good-soft: #e7f4ee;

    /* Geometry */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 18px 44px rgba(16, 24, 40, 0.14);

    --container: 1080px;
    --font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--page);
    font-size: 17px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.015em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

button {
    font: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.site-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--ink);
}

.wordmark__glyph {
    width: 32px;
    height: 32px;
    flex: none;
}

.wordmark__text {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.wordmark__text span {
    display: block;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

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

.header-nav a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.header-nav a:hover { color: var(--ink); }

/* ------------------------------------------------- powered-by lockup */

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-faint);
    text-decoration: none;
    white-space: nowrap;
}

.powered-by strong {
    font-weight: 700;
    color: var(--ink-muted);
}

.powered-by:hover strong { color: var(--accent); }

.powered-by .sparkle {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--signal);
}

.powered-by--answer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    width: 100%;
}

/* ------------------------------------------------------------------ hero */

.hero {
    background: linear-gradient(180deg, #ffffff 0%, var(--page) 100%);
    padding: 64px 0 8px;
    text-align: center;
}

.hero__eyebrow {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
    max-width: 22ch;
    margin-inline: auto;
    margin-bottom: 18px;
}

.hero__lede {
    font-size: clamp(1.05rem, 2.2vw, 1.22rem);
    color: var(--ink-muted);
    max-width: 62ch;
    margin: 0 auto 34px;
}

/* --------------------------------------------------------------- ask bar */

.askbar {
    position: relative;
    max-width: 780px;
    margin: 0 auto;
}

.askbar__field {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 22px;
    box-shadow: var(--shadow);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.askbar__field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-ring), var(--shadow);
}

.askbar__sparkle {
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--signal);
}

.askbar__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 17px;
    color: var(--ink);
    padding: 12px 0;
}

.askbar__input::placeholder { color: var(--ink-faint); }
.askbar__input:focus { outline: none; }

.askbar__submit {
    flex: none;
    border: 0;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 13px 28px;
    border-radius: var(--radius-pill);
    transition: background 0.16s ease, transform 0.16s ease;
}

.askbar__submit:hover:not(:disabled) { background: var(--accent-deep); }
.askbar__submit:active:not(:disabled) { transform: translateY(1px); }

.askbar__submit:disabled {
    background: var(--border-strong);
    cursor: not-allowed;
}

.askbar__hint {
    margin-top: 14px;
    font-size: 14px;
    color: var(--ink-faint);
}

/* suggested question chips */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.suggestion {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 9px 17px;
    font-size: 14.5px;
    color: var(--ink-muted);
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.suggestion:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------- section */

.section {
    padding: 54px 0;
}

.section--sunk {
    background: var(--surface-sunk);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section__head {
    max-width: 68ch;
    margin-bottom: 26px;
}

.section__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-right: 11px;
    vertical-align: 3px;
}

.section__head h2 {
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    margin-bottom: 8px;
}

.section__head p {
    color: var(--ink-muted);
    font-size: 16px;
}

/* ------------------------------------------------------- agency picker */

.county-group + .county-group { margin-top: 30px; }

.county-group__label {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 12px;
}

.county-group__label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--border);
}

.agency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 12px;
}

.agency-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px 14px 19px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.agency-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--line, var(--border-strong));
}

.agency-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.agency-card[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.agency-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.agency-card__name {
    font-weight: 700;
    font-size: 15.5px;
    line-height: 1.3;
    color: var(--ink);
}

.agency-card__sub {
    display: block;
    font-weight: 500;
    font-size: 12.5px;
    color: var(--ink-faint);
    margin-top: 2px;
}

.agency-card__check {
    flex: none;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.16s ease;
}

.agency-card[aria-pressed="true"] .agency-card__check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mode-chip {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    background: var(--surface-sunk);
    color: var(--ink-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.agency-card[aria-pressed="true"] .mode-chip {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(18, 80, 143, 0.2);
}

/* ---------------------------------------------------------- topic chips */

.topic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 11px 19px 11px 15px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-muted);
    box-shadow: var(--shadow-sm);
    transition: all 0.16s ease;
}

.topic-chip__icon { font-size: 17px; line-height: 1; }

.topic-chip:hover { border-color: var(--border-strong); color: var(--ink); }

.topic-chip[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-deep);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ------------------------------------------------------- selection bar */

.selection-bar {
    position: sticky;
    bottom: 0;
    z-index: 25;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 22px rgba(16, 24, 40, 0.09);
    padding: 13px 0;
}

.selection-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.selection-bar__summary {
    font-size: 14.5px;
    color: var(--ink-muted);
    min-width: 0;
}

.selection-bar__summary strong { color: var(--ink); }

.selection-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-ghost {
    background: transparent;
    border: 0;
    color: var(--ink-faint);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    padding: 8px 4px;
}

.btn-ghost:hover { color: var(--ink); }

.btn-primary {
    background: var(--accent);
    border: 0;
    color: #fff;
    font-weight: 700;
    font-size: 15.5px;
    padding: 12px 26px;
    border-radius: var(--radius-pill);
    transition: background 0.16s ease;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }

.btn-primary:disabled {
    background: var(--border-strong);
    cursor: not-allowed;
}

/* ------------------------------------------------------- answer surface */

.answer-section { padding: 54px 0 64px; }

.conversation {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.conversation__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 26px;
    background: var(--surface-sunk);
    border-bottom: 1px solid var(--border);
}

.conversation__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink-muted);
}

.conversation__body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.turn { animation: fadeIn 0.35s ease both; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.turn--user {
    align-self: flex-end;
    max-width: 82%;
    background: var(--accent);
    color: #fff;
    padding: 13px 19px;
    border-radius: var(--radius-lg) var(--radius-lg) 5px var(--radius-lg);
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.turn--user .turn__context {
    display: block;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 13px;
    opacity: 0.9;
}

.turn--ai {
    display: flex;
    gap: 15px;
    max-width: 100%;
}

.turn__avatar {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--signal-soft);
    color: var(--signal);
    display: grid;
    place-items: center;
}

.turn__avatar svg { width: 19px; height: 19px; }

.turn__body { flex: 1 1 auto; min-width: 0; }

.turn__body > :first-child { margin-top: 0; }

.turn__body h3 {
    font-size: 1.05rem;
    margin-top: 1.2em;
}

/* An answer that covers more than one case uses h2 per case — give those a
   rule so the sections read as separate. */
.turn__body h2 {
    font-size: 1.2rem;
    margin-top: 1.6em;
    padding-top: 0.75em;
    border-top: 1px solid var(--border);
}

.turn__body ul,
.turn__body ol {
    margin: 0 0 1em;
    padding-left: 1.3em;
}

.turn__body li { margin-bottom: 0.4em; }

.turn__body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    font-size: 15px;
}

.turn__body th,
.turn__body td {
    border: 1px solid var(--border);
    padding: 8px 11px;
    text-align: left;
    vertical-align: top;
}

.turn__body th { background: var(--surface-sunk); font-weight: 700; }

/* --- callout inside an answer */
.callout {
    display: flex;
    gap: 12px;
    background: var(--good-soft);
    border-left: 4px solid var(--good);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 13px 16px;
    margin: 0 0 1em;
    font-size: 15.5px;
}

.callout--warn {
    background: var(--signal-soft);
    border-left-color: var(--signal);
}

/* --- clarifying choices */
.choices {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--signal-soft);
    border: 1px solid rgba(194, 104, 10, 0.24);
    border-radius: var(--radius);
}

.choices__prompt {
    font-size: 14px;
    font-weight: 700;
    color: var(--signal);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 11px;
}

.choices__list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.choice {
    background: var(--surface);
    border: 1.5px solid rgba(194, 104, 10, 0.35);
    border-radius: var(--radius-pill);
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    transition: all 0.16s ease;
}

.choice:hover:not(:disabled) {
    background: var(--signal);
    border-color: var(--signal);
    color: #fff;
}

/* The option the rider settled on. Stays live — picking another swaps the
   answer below rather than adding a second one. */
.choice[aria-pressed="true"] {
    background: var(--signal);
    border-color: var(--signal);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(194, 104, 10, 0.22);
}

.choice[aria-pressed="true"]::before {
    content: "✓ ";
    font-weight: 700;
}

.choice:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.choice--freeform {
    border-style: dashed;
    font-weight: 500;
    color: var(--ink-muted);
}

/* --- sources */
.sources {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.sources__label {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 9px;
}

.sources__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sources__list a {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14.5px;
    text-decoration: none;
    color: var(--accent);
}

.sources__list a:hover { text-decoration: underline; }

.sources__agency {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    background: var(--surface-sunk);
    border-radius: 4px;
    padding: 2px 7px;
    flex: none;
}

/* --- thinking animation (three orbiting balls, per the demo pattern) */
.thinking {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-faint);
    font-size: 15px;
}

.thinking__dots {
    display: inline-flex;
    gap: 4px;
}

.thinking__dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: bob 1.15s ease-in-out infinite;
}

.thinking__dots span:nth-child(2) { animation-delay: 0.16s; }
.thinking__dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bob {
    0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* ------------------------------------------------------ systems section */

.systems-table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.systems-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 620px;
}

.systems-table th,
.systems-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.systems-table th {
    background: var(--surface-sunk);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    white-space: nowrap;
}

.systems-table tbody tr:last-child td { border-bottom: 0; }

.systems-table__name { font-weight: 700; white-space: nowrap; }

.systems-table__swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: 0;
}

/* --------------------------------------------------------------- about */

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.about-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.about-card p {
    font-size: 15.5px;
    color: var(--ink-muted);
    margin: 0;
}

.about-card__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 14px;
    font-size: 19px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 0;
}

.site-footer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--ink-faint);
}

.site-footer a {
    color: var(--ink-muted);
    font-weight: 600;
    text-decoration: none;
}

.site-footer a:hover { color: var(--accent); text-decoration: underline; }

.mockup-note {
    background: var(--signal-soft);
    border-top: 1px solid rgba(194, 104, 10, 0.24);
    border-bottom: 1px solid rgba(194, 104, 10, 0.24);
    color: #8a4a06;
    font-size: 13.5px;
    text-align: center;
    padding: 9px 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
    body { font-size: 16px; }

    .hero { padding-top: 42px; }

    .askbar__field {
        flex-wrap: wrap;
        border-radius: var(--radius-lg);
        padding: 12px;
        gap: 8px;
    }

    .askbar__sparkle { margin-left: 6px; }

    .askbar__input { flex: 1 1 60%; padding: 8px 0; }

    .askbar__submit { flex: 1 1 100%; }

    .header-nav a:not(.powered-by) { display: none; }

    .conversation__body { padding: 18px; }

    .turn--user { max-width: 94%; }

    .selection-bar__row { justify-content: center; text-align: center; }
}

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