/* =========================================================================
   Sidekick — styled after Anthropic.com
   Palette: ivory page, oat cards, slate-dark ink, clay/coral accent.
   ========================================================================= */

:root {
  /* Dark scheme — VS Code "Dark+" inspired */
  --ivory: #e7e7e7; /* light foreground (text on dark/accent surfaces) */
  --ivory-medium: #1e1e1e; /* page background */
  --oat: #252526; /* cards / inputs / sidebar surface */
  --oat-deep: #2d2d31; /* hover / active / elevated */
  --slate-dark: #161617; /* footer */
  --ink: #d4d4d4; /* body text */
  --ink-faded: #9d9d9d; /* secondary text, labels */
  --clay: #ff5b00; /* accent (orange) */
  --clay-strong: #ff7a33; /* accent hover */
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-card: 20px;
  --radius-input: 14px;
  --maxw: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ivory-medium);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ivory-medium);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(255, 91, 0, 0.35);
}

.u-container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* ------------------------------------------------------------- Shell --- */
.app-shell {
  flex: 1;
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* --------------------------------------------------------- Sidebar (left) */
.sidebar {
  position: sticky;
  top: 0;
  flex: none;
  width: 252px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  padding: 1.7rem 1.35rem;
  background: var(--oat);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--clay);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.98rem;
  text-align: left;
  color: var(--ink-faded);
  padding: 0.62rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-btn:hover {
  color: var(--ink);
  background: var(--oat);
}

.nav-btn.active {
  color: var(--ink);
  background: var(--oat-deep);
  font-weight: 500;
}

.sidebar-foot {
  margin-top: auto;
}

.nav-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

/* ----------------------------------------------------- Main + avatar --- */
.main {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Andrea + quote, top-right. The PNG is transparent, so no card/shadow —
   she blends straight onto the page. */
.hero {
  position: absolute;
  top: clamp(1rem, 2.5vw, 1.75rem);
  right: clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  width: clamp(150px, 17vw, 215px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.hero-avatar {
  height: 25vh;
  width: auto;
  max-width: 100%;
  display: block;
}

.hero-quote {
  margin: 0.55rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
  color: var(--ink-faded);
}

.content {
  width: 100%;
  max-width: var(--maxw);
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem) 5rem;
}

/* Keep the intro headings clear of the avatar on wider screens. */
@media (min-width: 760px) {
  .intro {
    padding-right: clamp(170px, 20vw, 275px);
  }
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page {
  max-width: 720px;
}

.page-wide {
  max-width: 920px;
}

.page-full {
  max-width: 100%;
}

/* Embedded Power BI report. Fills the main column (right of the sidebar);
   the report itself auto-scales (Power BI "Fit to page"). */
.report-frame {
  position: relative;
  width: 100%;
  /* match the report's native 16:9 so no empty space shows below it */
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--oat);
}

.report-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ----------------------------------------------------------------- Intro - */
.intro {
  margin-bottom: 2.25rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 2.22rem; /* 3× the original 0.74rem */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 1rem;
}

.intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  color: var(--ink);
}

.sub {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-faded);
  max-width: 46ch;
  margin: 0;
}

/* ------------------------------------------------------------------ Form - */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

textarea {
  width: 100%;
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--oat);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 1.1rem 1.2rem;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea::placeholder {
  color: color-mix(in srgb, var(--ink-faded) 80%, transparent);
}

textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(255, 91, 0, 0.3);
}

/* Primary button — dark slate pill with a circular arrow, Anthropic-style */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font: inherit;
  font-weight: 500;
  font-size: 1rem;
  color: #231308;
  background: var(--clay);
  border: 1px solid var(--clay);
  border-radius: 999px;
  padding: 0.7rem 0.85rem 0.7rem 1.4rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.btn-primary:hover {
  background: var(--clay-strong);
  border-color: var(--clay-strong);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-arrow {
  width: 26px;
  height: 26px;
  flex: none;
  padding: 4px;
  border-radius: 999px;
  background: #231308;
  color: var(--clay);
  transition: transform 0.18s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

/* ----------------------------------------------------------------- Status */
.status {
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-faded);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--clay);
  animation: pulse 1.1s ease-in-out infinite;
}

/* Honor the `hidden` attribute (the display:flex above would otherwise show
   an empty status line with its pulse dot). */
.status[hidden] {
  display: none;
}

.status.error {
  color: #f48771;
}

.status.error::before {
  background: #f48771;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* -------------------------------------------------------------- Book cards */
.results {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--oat);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px -22px rgba(20, 20, 19, 0.4);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--oat-deep);
  overflow: hidden;
}

.cover-wrap.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.cover-wrap.empty {
  aspect-ratio: auto;
  height: 0;
}

.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cover.loaded {
  opacity: 1;
}

.card-body {
  position: relative;
  padding: 1.3rem 1.3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--clay);
}

.card-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0.1rem 0 0;
}

.author {
  font-size: 0.88rem;
  color: var(--ink-faded);
  margin: 0;
}

.why {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0.5rem 0 0;
}

.find {
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faded);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s ease;
}

.find::after {
  content: "→";
  transition: transform 0.15s ease;
}

.card:hover .find {
  color: var(--clay-strong);
}

.card:hover .find::after {
  transform: translateX(3px);
}

/* ------------------------------------------------------------ Mic control */
.mic-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mic {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--oat);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mic:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--oat-deep);
}

.mic:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-icon {
  color: var(--ink-faded);
}

.mic.listening {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--ivory);
}

.mic.listening .mic-icon {
  color: var(--ivory);
}

.mic.listening::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ivory);
  animation: pulse 1s ease-in-out infinite;
}

.mic-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faded);
}

/* --------------------------------------------------------- Schedule table */
.plan-results {
  margin-top: 2.5rem;
}

.table-wrap {
  background: var(--oat);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.schedule thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faded);
  font-weight: 500;
  padding: 1rem 1.25rem;
  background: var(--oat-deep);
  border-bottom: 1px solid var(--border);
}

.schedule tbody td {
  padding: 1rem 1.25rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

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

.schedule tbody tr:hover {
  background: rgba(255, 91, 0, 0.12);
}

.t-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--clay-strong);
  white-space: nowrap;
}

.t-desc {
  color: var(--ink);
}

.t-people,
.t-deps {
  color: var(--ink-faded);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- Footer - */
.site-footer {
  background: var(--slate-dark);
  color: var(--ivory);
  padding: 1rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-mark {
  width: 20px;
  height: 20px;
  color: var(--clay);
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--ivory) 75%, transparent);
}

/* --------------------------------------------------------------- Responsive */
/* Collapse the left rail into a top bar on narrow screens. */
@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
  }

  /* On phones the rail becomes a top bar (brand already visible there),
     so hide the floating avatar + quote to avoid overlap/clipping. */
  .hero {
    display: none;
  }

  .intro {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .nav-tag {
    display: none;
  }

  body {
    font-size: 16px;
  }

  .schedule {
    font-size: 0.88rem;
  }

  .schedule thead th,
  .schedule tbody td {
    padding: 0.75rem 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
