/* ============================================================
   Economic Impact Tool — Global Styles
   Claude-style warm/orange palette
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F4F0;
  --orange: #E8651A;
  --orange-hover: #D45A14;
  --orange-light: #FFF3EC;
  --orange-border: #F4C4A1;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-light: #9A9A9A;
  --border: #E8E4DF;
  --border-focus: #E8651A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'DM Sans', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo__dot {
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 50%;
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav a.active {
  color: var(--orange);
  background: var(--orange-light);
}

.site-nav__user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.site-nav__email {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav__logout {
  font-size: 13px;
  color: var(--text-muted) !important;
  padding: 4px 10px !important;
}

.site-nav__signup {
  margin-left: 4px;
  color: #fff !important;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.btn--primary:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,101,26,0.25);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-light);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn--danger {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}

.btn--danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--orange {
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid var(--orange-border);
}

.badge--gray {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Banner-matched badge variants — keep card categories tonally aligned with banners */
.badge--teal {
  background: rgba(46, 139, 139, 0.10);
  color: #2A7878;
  border: 1px solid rgba(46, 139, 139, 0.30);
}

.badge--blue {
  background: rgba(61, 90, 128, 0.10);
  color: #34507A;
  border: 1px solid rgba(61, 90, 128, 0.30);
}

.badge--slate {
  background: rgba(74, 85, 104, 0.10);
  color: #3F4956;
  border: 1px solid rgba(74, 85, 104, 0.30);
}

.badge--green {
  background: rgba(46, 125, 91, 0.10);
  color: #266B4D;
  border: 1px solid rgba(46, 125, 91, 0.30);
}

.badge--purple {
  background: rgba(107, 91, 149, 0.10);
  color: #574A7A;
  border: 1px solid rgba(107, 91, 149, 0.30);
}

/* --- Forms --- */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,101,26,0.12);
}

/* --- Chat Interface --- */
#chat-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  animation: fadeSlideIn 0.3s ease forwards;
  opacity: 0;
}

.chat-message--bot { align-items: flex-start; }
.chat-message--user { align-items: flex-end; }

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.55;
}

.chat-bubble--bot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.chat-bubble--user {
  background: var(--orange);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* --- Chat Option Chips --- */
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-left: 0;
}

.chat-option-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chat-option-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange);
}

.chat-option-btn--selected,
.chat-option-btn:focus {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange);
  outline: none;
}

/* Option with checkbox-style indicator */
.chat-option-btn__check {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  transition: all 0.15s;
}

.chat-option-btn:hover .chat-option-btn__check,
.chat-option-btn--selected .chat-option-btn__check {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* Province grid */
.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* --- Chat Number Input --- */
.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: flex-start;
}

.chat-number-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}

.chat-number-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,101,26,0.12);
}

/* Skip link */
.chat-skip-link {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
}

.chat-skip-link:hover { color: var(--text); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

#chat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* --- Results Page --- */
.results-header {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  color: #fff;
  padding: 40px 0;
  margin-bottom: 32px;
}

.results-headline {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 700px;
}

.results-headline strong {
  color: #FFA862;
}

.results-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}

.results-meta-item {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

.results-meta-item span {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

/* KPI Stats */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

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

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card__icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F0EEEB 0%, #E8E4DF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.kpi-card__icon--highlight {
  background: linear-gradient(135deg, #FDDBB4 0%, #F4A262 100%);
  color: #fff;
}

.kpi-card__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.kpi-card__sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.kpi-card--highlight {
  border-color: var(--orange-border);
  background: var(--orange-light);
}

.kpi-card--highlight .kpi-card__value {
  color: var(--orange);
}

/* Impact Table */
.impact-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.impact-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
}

.impact-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 20px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.impact-table th:first-child { text-align: left; }

.impact-table td {
  padding: 14px 20px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.impact-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.impact-table tr:last-child td { border-bottom: none; }

.impact-table tr:nth-child(even) td { background: rgba(0,0,0,0.015); }

.impact-table .col-total {
  font-weight: 700;
  color: var(--orange);
  background: var(--orange-light) !important;
}

.impact-table tbody tr {
  animation: fadeSlideIn 0.3s ease forwards;
  opacity: 0;
}

.impact-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.impact-table tbody tr:nth-child(2) { animation-delay: 0.10s; }
.impact-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.impact-table tbody tr:nth-child(4) { animation-delay: 0.20s; }
.impact-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* ── Transposed impact block layout ───────────────────────────────────────── */
.impact-table-wrap {
  border: none;
  box-shadow: none;
  background: transparent;
}

.impact-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.impact-block__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 20px;
  border-bottom: 2px solid var(--orange);
  background: var(--surface-2);
}

.impact-block__label--roc {
  color: var(--text-muted);
  border-bottom-color: #A0AEC0;
}

.impact-block__label--total {
  color: var(--text);
  background: var(--orange-light);
  border-bottom-color: var(--orange);
}

.impact-table-scroll {
  overflow-x: auto;
}

.impact-table--transposed {
  min-width: 860px; /* prevent collapse on narrow screens */
}

.impact-table--transposed th,
.impact-table--transposed td {
  padding: 12px 16px;
  white-space: nowrap;
}

.impact-table--transposed .col-impact-type {
  text-align: left;
  font-weight: 600;
  min-width: 110px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}

.impact-table--transposed th.col-impact-type {
  background: var(--surface-2);
}

.impact-table--transposed tr.row-total td {
  font-weight: 700;
  color: var(--orange);
  background: var(--orange-light) !important;
  border-top: 2px solid var(--border);
}

.impact-table--transposed tr.row-total .col-impact-type {
  background: var(--orange-light);
}

/* Section header rows inside combined table */
.impact-table--transposed tr.section-header-row td {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 16px;
  border-bottom: none;
}

.impact-table--transposed tr.section-header-row--province td {
  background: var(--orange-light);
  color: var(--orange);
  border-top: 1px solid var(--border);
}

.impact-table--transposed tr.section-header-row--roc td {
  background: #F0F4F8;
  color: #4A6FA5;
  border-top: 2px solid var(--border);
}

.impact-table--transposed tr.section-header-row--total td {
  background: var(--orange-light);
  color: var(--orange);
  border-top: 2px solid var(--orange);
}

/* Subtotal rows (province & ROC section totals) */
.impact-table--transposed tr.row-subtotal td {
  font-weight: 600;
  background: rgba(0,0,0,0.03) !important;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.impact-table--transposed tr.row-subtotal .col-impact-type {
  background: rgba(0,0,0,0.03);
}

.section-header-row__note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  opacity: 0.8;
}

/* Total block label variant */
.impact-block__label--total {
  color: var(--text);
  background: var(--orange-light);
  border-bottom-color: var(--orange);
}

.impact-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 20px 6px;
  border-bottom: 2px solid var(--orange);
  margin-bottom: 0;
  display: block;
  background: var(--surface-2);
}

.impact-section-label--roc {
  margin-top: 2px;
}

.adjustments-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-height: 420px;
  display: flex;
  flex-direction: column;
}

.chart-card canvas {
  flex: 1;
  min-height: 0;
}

.chart-card__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Results Action Buttons */
.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

/* Edit Panel */
.edit-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.edit-panel__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.edit-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.edit-panel__field {
  display: flex;
  flex-direction: column;
}

.edit-panel__field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.edit-panel__field .form-input {
  margin-top: auto;
}

/* Industry selector (edit panel) */
.edit-panel__field--wide {
  grid-column: 1 / -1;
}

.industry-selector__current {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.industry-selector__current--selected {
  color: var(--orange);
}

.industry-selector__dropdowns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.industry-selector__level-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.industry-selector__select {
  width: 100%;
}

/* --- Reports Dashboard --- */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.report-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--orange-border);
}

.report-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.report-card__meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.report-card__stat {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 4px;
}

.report-card__stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.report-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state__icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.empty-state__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state__text {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* --- Landing Page --- */
.landing-hero {
  padding: 80px 0 64px;
  text-align: center;
}

.landing-hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 16px;
}

.landing-hero__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.landing-hero__title em {
  font-style: normal;
  color: var(--orange);
}

.landing-hero__subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.landing-hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.how-it-works {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.how-it-works__title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 48px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step__number {
  width: 44px;
  height: 44px;
  background: var(--orange-light);
  border: 1.5px solid var(--orange-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--orange);
  margin: 0 auto 16px;
}

.step__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step__text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Footer --- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer > p {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.site-footer__disclaimer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-light);
  text-align: left;
}

.site-footer__disclaimer strong {
  color: var(--text-muted);
  font-weight: 600;
}

.site-footer__disclaimer em {
  font-style: italic;
}

@media (max-width: 640px) {
  .site-footer__disclaimer { font-size: 11px; }
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* --- Animations --- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Auth Pages --- */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 20px 80px;
  min-height: calc(100vh - 200px);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
}

.auth-card__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-card__subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.auth-field .form-input {
  width: 100%;
}

.btn--full {
  width: 100%;
  justify-content: center;
}

.auth-form .btn--full {
  margin-top: 8px;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-links a {
  color: var(--orange);
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-links p {
  margin-bottom: 8px;
}

.auth-forgot {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 4px;
}

.auth-forgot a {
  color: var(--orange);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-guest-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 10px;
  line-height: 1.5;
}

.guest-save-note {
  text-align: center;
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.guest-save-note a {
  color: var(--orange);
  font-weight: 600;
}

/* --- Utility --- */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Responsive --- */
@media (max-width: 640px) {
  .charts-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  #chat-container { padding: 16px 12px; }
  .site-nav { display: none; }
  .results-actions { flex-direction: column; }
  .btn--lg { width: 100%; justify-content: center; }
  .landing-hero { padding: 48px 0 40px; }
  .auth-card { padding: 28px 20px; }
  .auth-page { padding: 32px 16px 60px; }
  .steps-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Portfolio Landing Page
   ============================================================ */

.portfolio-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Portfolio Header --- */
.portfolio-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.portfolio-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.portfolio-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.portfolio-logo:hover { color: var(--text); }

.portfolio-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange) 0%, #F4A262 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.portfolio-logo__mark--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.portfolio-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.portfolio-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.portfolio-nav a:hover {
  color: var(--orange);
  background: var(--orange-light);
}

.portfolio-nav a.btn--primary {
  margin-left: 8px;
  color: #fff;
}

.portfolio-nav a.btn--primary:hover {
  color: #fff;
  background: var(--orange-hover);
}

/* --- Hero --- */
.portfolio-hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(ellipse at 80% 30%, rgba(232, 101, 26, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(232, 101, 26, 0.04) 0%, transparent 55%);
}

.portfolio-hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}

/* Hero name + tagline (personal-brand treatment) */
.portfolio-hero__intro {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.portfolio-hero__name {
  font-size: clamp(40px, 5.4vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.portfolio-hero__name-dot {
  color: var(--orange);
}

.portfolio-hero__tagline {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 22px;
  letter-spacing: -0.005em;
}

.portfolio-hero__bio strong {
  color: var(--text);
  font-weight: 600;
}

/* Typewriter effect: orange highlight + blinking cursor pinned to phrase end */
.hero-typed {
  font-style: normal;
  color: var(--orange);
  font-weight: 600;
  position: relative;
  display: inline;
}

.hero-typed::after {
  content: '|';
  display: inline-block;
  margin-left: 4px;
  font-style: normal;
  font-weight: 400;
  color: currentColor;
  animation: cursorBlink 1s ease-in-out infinite;
  vertical-align: baseline;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.portfolio-hero__bio {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
}

.portfolio-hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Hero Photo + decorations --- */
.portfolio-hero__photo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 540px;
  isolation: isolate;
  padding-top: 120px;
}

/* Soft, organic halo blobs behind the photo */
.hero-halo {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(36px);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
}

.hero-halo--big {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(232, 101, 26, 0.40) 0%,
    rgba(244, 162, 98, 0.22) 38%,
    transparent 72%
  );
  top: -16px;
  right: -8px;
  animation: heroBlobFloat 14s ease-in-out infinite;
}

.hero-halo--small {
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle,
    rgba(244, 196, 161, 0.55) 0%,
    rgba(232, 101, 26, 0.10) 50%,
    transparent 75%
  );
  bottom: 10px;
  left: -10px;
  animation: heroBlobFloat 10s ease-in-out infinite reverse;
}

@keyframes heroBlobFloat {
  0%, 100% {
    transform: rotate(0deg) scale(1);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  }
  50% {
    transform: rotate(8deg) scale(1.06);
    border-radius: 45% 55% 40% 60% / 60% 50% 50% 40%;
  }
}

/* Base photo card (still used by About section) */
.portfolio-photo {
  position: relative;
  width: 320px;
  height: 380px;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--orange-light) 0%, #FFE7D4 100%);
  border: 5px solid var(--surface);
  box-shadow:
    0 16px 48px rgba(232, 101, 26, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.portfolio-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio-photo__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFE7D4 0%, #FFD1AE 100%);
}

/* ── Hero floating-cutout layout (circular orb backdrop) ──────────────── */

/* Orb = circular gradient backdrop the person "stands" in front of */
.hero-orb {
  position: relative;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.40) 0%, transparent 45%),
    conic-gradient(from 200deg at 50% 50%,
      #F4A262 0deg,
      #FF8F4A 60deg,
      #E8651A 130deg,
      #B8430F 200deg,
      #7B5BA8 260deg,
      #E8651A 320deg,
      #F4A262 360deg);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    0 0 0 6px var(--surface),
    0 0 0 8px rgba(232, 101, 26, 0.10),
    0 32px 72px rgba(232, 101, 26, 0.32),
    0 12px 24px rgba(0, 0, 0, 0.10);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orbSpin 60s linear infinite;
}

.hero-orb__ring {
  position: absolute;
  inset: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
}

/* Big π watermark — the "this is a circle = π" reveal */
.hero-orb__pi {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Times New Roman', 'Cambria Math', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 230px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.22);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  pointer-events: none;
  user-select: none;
  /* Counter-rotate so π stays upright while the orb gradient spins */
  animation: orbSpin 60s linear infinite reverse;
}

.hero-orb__fallback {
  display: none;
  font-size: 96px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
  /* Counter-rotate so JZ stays upright while the orb gradient spins */
  animation: orbSpin 60s linear infinite reverse;
}

@keyframes orbSpin {
  to { transform: rotate(360deg); }
}

/* Cutout = transparent person image floats over the orb */
.hero-cutout {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  height: 480px;
  width: auto;
  max-width: 120%;
  z-index: 3;
  pointer-events: none;
  user-select: none;
  filter:
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22))
    drop-shadow(0 4px 8px rgba(232, 101, 26, 0.18));
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-hero__photo-wrap:hover .hero-cutout {
  transform: translateX(-50%) translateY(-6px);
}

/* Floating badge cards (chart + bell curve "stickers") */
.hero-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--surface) 0%, #FFF3EC 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.10),
    0 4px 8px rgba(232, 101, 26, 0.10);
  color: var(--orange);
  z-index: 4;
  animation: heroBob 5s ease-in-out infinite;
}

.hero-badge--top {
  top: 8%;
  left: -4%;
}

.hero-badge--bottom {
  bottom: 14%;
  right: -2%;
  animation-delay: 1.5s;
}

/* Floating decorations (math/stat themed) */
.hero-deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.hero-deco--symbol {
  font-family: 'Times New Roman', 'Cambria Math', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  color: var(--orange);
  text-shadow: 0 2px 6px rgba(232, 101, 26, 0.20);
  animation: heroPulse 4s ease-in-out infinite;
}

.hero-deco--eq {
  font-family: 'Times New Roman', 'Cambria Math', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  animation: heroBob 5s ease-in-out infinite;
}

/* Code chip — dark terminal-style, contrasts with white math chips */
.hero-deco--code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  color: #E8E4DF;
  background: linear-gradient(135deg, #2A2A2A 0%, #1A1A1A 100%);
  border: 1px solid rgba(232, 101, 26, 0.30);
  border-radius: 8px;
  padding: 5px 10px;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  animation: heroBob 5s ease-in-out infinite;
}

.hero-deco__kw {
  color: #FFA862;
  font-weight: 600;
}

.hero-deco--squiggle {
  width: 50px;
  height: 14px;
  color: var(--orange);
  animation: heroBob 4.5s ease-in-out infinite;
}

.hero-deco--dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  animation: heroBob 4s ease-in-out infinite;
}

.hero-deco--ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--orange);
  background: transparent;
  animation: heroBob 5s ease-in-out infinite;
}

/* Decoration positions — distributed around the orb */
.hero-deco--p1  { top:  4%;  right:  6%;  font-size: 38px; animation-delay: 0s;   }
.hero-deco--p2  { bottom: 6%; left: 22%;  font-size: 30px; animation-delay: 0.6s; }
.hero-deco--p3  { top: 38%;  right: -8%;  font-size: 32px; animation-delay: 1.0s; }
.hero-deco--p4  { top: 24%;  left: -2%;   font-size: 26px; animation-delay: 0.4s; opacity: 0.85; }
.hero-deco--p5  { bottom: 28%; right: 18%; font-size: 22px; animation-delay: 1.2s; opacity: 0.85; }
.hero-deco--p6  { top: 0%;   left: 30%;   animation-delay: 0.7s; }
.hero-deco--p7  { top: 56%;  left: -12%;  animation-delay: 1.4s; }
.hero-deco--p8  { top: 14%;  right: 24%;  animation-delay: 0s;   opacity: 0.65; }
.hero-deco--p9  { bottom: 8%; left: 6%;   width: 12px; height: 12px; background: var(--orange-hover); animation-delay: 1s; }
.hero-deco--p10 { bottom: 32%; right: -4%; animation-delay: 0.8s; }
.hero-deco--p11 { top: 18%;  left: 14%;   animation-delay: 0.3s; }
.hero-deco--p12 { top: 30%;  right: -10%;  animation-delay: 0.5s; }
.hero-deco--p13 { bottom: 18%; left: -8%;  animation-delay: 1.6s; }

@keyframes heroPulse {
  0%, 100% { transform: scale(1);    opacity: 0.75; }
  50%      { transform: scale(1.15); opacity: 1; }
}

@keyframes heroBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* --- Section Heads --- */
.portfolio-section-head {
  text-align: center;
  margin-bottom: 48px;
}

.portfolio-section-head--left {
  text-align: left;
  margin-bottom: 36px;
}

.portfolio-section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  text-align: left;
  margin-bottom: 36px;
}

.portfolio-section-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.portfolio-section-title {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.portfolio-section-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Stats band --- */
.portfolio-stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
}

.portfolio-stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.portfolio-stat {
  text-align: center;
  padding: 8px 16px;
  border-right: 1px solid var(--border);
}

.portfolio-stat:last-child { border-right: none; }

.portfolio-stat__num {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.portfolio-stat__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.45;
}

/* --- Expertise --- */
.portfolio-expertise {
  padding: 80px 0 64px;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.expertise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.expertise-card::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.expertise-card:hover {
  transform: translateY(-3px);
  border-color: var(--orange-border);
  box-shadow: 0 10px 24px rgba(232, 101, 26, 0.10);
}

.expertise-card:hover::after { transform: scaleX(1); }

.expertise-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--orange-light);
  color: var(--orange);
  margin-bottom: 16px;
  border: 1px solid var(--orange-border);
}

.expertise-card__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.expertise-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* --- About --- */
.portfolio-about {
  padding: 64px 0 80px;
  border-top: 1px solid var(--border);
}

.portfolio-about__grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 64px;
  align-items: center;
}

.portfolio-about__photo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.portfolio-about__blob {
  position: absolute;
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, var(--orange) 0%, #F4A262 100%);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  opacity: 0.18;
  filter: blur(2px);
  z-index: 0;
  transform: rotate(-8deg);
}

.portfolio-photo--about {
  width: 280px;
  height: 320px;
  border-radius: 24px;
  z-index: 1;
}

.portfolio-photo--about .portfolio-photo__fallback {
  font-size: 84px;
}

.portfolio-about__text {
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
}

.portfolio-about__text strong {
  color: var(--text);
  font-weight: 600;
}

.portfolio-about__creds {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* About Me header row: title left, LinkedIn CTA right */
.portfolio-about__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.portfolio-about__header .portfolio-section-title {
  margin-bottom: 0;
  min-width: 0;
}

.portfolio-about__header .portfolio-about__linkedin {
  flex-shrink: 0;
  white-space: nowrap;
}

.portfolio-cred__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 8px;
}

.portfolio-cred__value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

/* Institution name (top) + degree (below) — stacked credential entry */
.portfolio-cred__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.portfolio-cred__institution {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.portfolio-cred__degree {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Education list with school-logo tags */
.portfolio-cred__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portfolio-cred__item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portfolio-cred__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  /* Drop-shadow filter clips to the logo's actual shape (not a rectangle) */
  filter:
    drop-shadow(0 8px 16px rgba(0, 32, 91, 0.22))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.10));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.portfolio-cred__logo:hover {
  transform: translateY(-3px) scale(1.06);
  filter:
    drop-shadow(0 12px 22px rgba(0, 32, 91, 0.28))
    drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
}

.portfolio-cred__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Compensate for UBC PNG having extra whitespace around the shield */
.portfolio-cred__logo--ubc img {
  transform: scale(1.35);
  transform-origin: center;
}

/* Text fallback (hidden unless the image fails to load) */
.portfolio-cred__logo-text {
  display: none;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portfolio-cred__logo--fallback-uoft,
.portfolio-cred__logo--fallback-ubc {
  width: auto;
  height: 32px;
  min-width: 60px;
  padding: 0 12px;
  border-radius: 8px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.portfolio-cred__logo--fallback-uoft {
  background: linear-gradient(135deg, #002A5C 0%, #003B71 100%);
}

.portfolio-cred__logo--fallback-ubc {
  background: linear-gradient(135deg, #002145 0%, #0055B7 100%);
  box-shadow: inset 0 -3px 0 #FFB81C;
}

.portfolio-cred__logo--fallback-uoft .portfolio-cred__logo-text,
.portfolio-cred__logo--fallback-ubc .portfolio-cred__logo-text {
  display: inline;
}

/* A bit more breathing room around the bigger logos */
.portfolio-cred__list { gap: 14px; }
.portfolio-cred__item { gap: 16px; }

/* --- Projects --- */
.portfolio-projects {
  padding: 64px 0 80px;
  border-top: 1px solid var(--border);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.project-card:hover {
  color: var(--text);
  transform: translateY(-4px);
  border-color: var(--orange-border);
  box-shadow: 0 14px 32px rgba(232, 101, 26, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.project-card--static { cursor: default; }
.project-card--static:hover { transform: translateY(-2px); }

/* Banner top of card with icon */
.project-card__banner {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.project-card__banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.20) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.10) 0%, transparent 50%);
}

.project-card__banner svg {
  position: relative;
  z-index: 1;
  opacity: 0.95;
}

.project-card__banner--orange { background: linear-gradient(135deg, #E8651A 0%, #F4A262 100%); }
.project-card__banner--teal   { background: linear-gradient(135deg, #2E8B8B 0%, #5BB3B3 100%); }
.project-card__banner--blue   { background: linear-gradient(135deg, #3D5A80 0%, #6E8AB0 100%); }
.project-card__banner--purple { background: linear-gradient(135deg, #6B5B95 0%, #9D8DC3 100%); }
.project-card__banner--slate  { background: linear-gradient(135deg, #4A5568 0%, #7B8794 100%); }
.project-card__banner--green  { background: linear-gradient(135deg, #2E7D5B 0%, #5FAB85 100%); }

.project-card__body {
  padding: 24px 26px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.project-card__status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2E7D5B;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-card__status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2E7D5B;
  display: inline-block;
  position: relative;
  /* Radar-style ping — applies to all live & published statuses */
  animation: livePing 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  box-shadow: 0 0 0 0 rgba(46, 125, 91, 0.55);
}

@keyframes livePing {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 125, 91, 0.55);
    transform: scale(1);
  }
  60% {
    box-shadow: 0 0 0 7px rgba(46, 125, 91, 0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 125, 91, 0);
    transform: scale(1);
  }
}

.project-card__status--soon {
  color: var(--text-light);
}

/* Inactive states never animate */
.project-card__status--soon::before {
  background: var(--text-light);
  animation: none;
  box-shadow: none;
}

.project-card__title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.project-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
  flex-grow: 1;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
  margin-top: auto;
}

.project-card:hover .project-card__link svg {
  transform: translateX(3px);
}

.project-card__link svg {
  transition: transform 0.18s ease;
}

.project-card--static .project-card__link {
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
}

/* --- Contact (form) --- */
.portfolio-contact {
  padding: 80px 0 96px;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 101, 26, 0.05) 0%, transparent 60%);
}

.contact-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
}

.contact-form__field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.contact-form .form-input {
  font-family: var(--font);
  font-size: 14.5px;
}

.contact-form textarea.form-input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}

.contact-form select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.contact-form__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.contact-form__hint {
  font-size: 12px;
  color: var(--text-light);
}

/* Inline feedback (success / error banners above the form) */
.contact-form__feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  animation: feedbackIn 0.25s ease;
}

.contact-form__feedback[hidden] {
  display: none;
}

.contact-form__feedback--success {
  background: rgba(46, 125, 91, 0.10);
  color: #226B45;
  border: 1px solid rgba(46, 125, 91, 0.30);
}

.contact-form__feedback--error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

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

/* Honeypot — visually hidden but kept in the accessibility tree's flow.
   Bots that fill all fields will trip it; humans never see it. */
.contact-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Portfolio Footer --- */
.portfolio-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 24px 20px;
  margin-top: auto;
}

.portfolio-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.portfolio-footer__brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.portfolio-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.portfolio-footer__nav a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.portfolio-footer__nav a:hover {
  color: var(--orange);
  background: var(--orange-light);
}

.portfolio-footer__social {
  display: flex;
  gap: 8px;
}

.portfolio-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.portfolio-footer__social a:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  transform: translateY(-2px);
}

.portfolio-footer__bottom {
  max-width: 1120px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

/* --- Portfolio Responsive --- */
@media (max-width: 900px) {
  .portfolio-hero { padding: 56px 0 48px; }
  .portfolio-hero__grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .portfolio-hero__bio { margin-left: auto; margin-right: auto; }
  .portfolio-hero__cta { justify-content: center; }
  .portfolio-hero__photo-wrap { min-height: 480px; padding-top: 100px; }
  .hero-orb { width: 320px; height: 320px; }
  .hero-orb__fallback { font-size: 80px; }
  .hero-cutout { height: 420px; }
  .hero-badge { width: 48px; height: 48px; border-radius: 14px; }
  .hero-halo--big { width: 340px; height: 340px; }
  .hero-halo--small { width: 200px; height: 200px; }

  .portfolio-about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: left;
  }
  .portfolio-about__photo-wrap { justify-self: center; }
  .portfolio-about__blob { width: 260px; height: 260px; }
  .portfolio-photo--about { width: 240px; height: 280px; }

  .portfolio-section-head--row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .portfolio-nav { gap: 0; }
  .portfolio-nav a:not(.btn) { display: none; }
  .portfolio-stats__grid { grid-template-columns: 1fr; gap: 12px; }
  .portfolio-stat { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .portfolio-stat:last-child { border-bottom: none; padding-bottom: 0; }
  .portfolio-expertise { padding: 56px 0 40px; }
  .portfolio-about { padding: 48px 0 56px; }

  /* Hide the About Me photo on mobile — hero already shows the same image,
     and removing it lets the bio start higher on the page. */
  .portfolio-about__photo-wrap { display: none; }
  .portfolio-projects { padding: 48px 0 56px; }
  .portfolio-contact { padding: 56px 0 72px; }
  .contact-form { padding: 24px; }
  .contact-form__row { grid-template-columns: 1fr; gap: 14px; }
  .portfolio-about__creds { grid-template-columns: 1fr; gap: 16px; }
  .portfolio-footer__inner { flex-direction: column; align-items: center; text-align: center; }

  /* Hero — shrink everything for mobile. Body-level overflow-x: hidden
     prevents horizontal scroll without clipping decorations at the wrap edge. */
  body.portfolio-body { overflow-x: hidden; }
  .portfolio-hero__photo-wrap {
    min-height: 380px;
    padding-top: 70px;
  }
  .hero-orb { width: 230px; height: 230px; }
  .hero-orb__pi { font-size: 150px; }
  .hero-orb__fallback { font-size: 64px; }
  .hero-cutout { height: 320px; }
  .hero-halo--big { width: 240px; height: 240px; }
  .hero-halo--small { width: 140px; height: 140px; }
  .hero-badge { width: 40px; height: 40px; border-radius: 12px; }
  .hero-deco--symbol { font-size: 22px; }
  .hero-deco--eq { font-size: 11px; padding: 3px 8px; }
  .hero-deco--code { font-size: 10px; padding: 3px 7px; }
  .hero-deco--squiggle { width: 36px; }

  /* Pull decorations with extreme negative offsets inward so the full
     element fits within the viewport on narrow screens. */
  .hero-deco--p3  { right: 2%; }
  .hero-deco--p4  { left: 4%; }
  .hero-deco--p7  { left: 0; }
  .hero-deco--p10 { right: 2%; }
  .hero-deco--p12 { right: 0; }
  .hero-deco--p13 { left: 0; }
  .hero-badge--top { left: 2%; }
  .hero-badge--bottom { right: 2%; }
}

/* ============================================================
   Modal (link-chooser popup)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  animation: modalFade 0.2s ease;
}

.modal__panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
  color: var(--text);
}

.modal__sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.55;
}

.modal__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal__link {
  position: relative;
  display: block;
  padding: 16px 50px 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.modal__link:hover {
  border-color: var(--orange-border);
  background: var(--orange-light);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232, 101, 26, 0.10);
}

.modal__link-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.modal__link-host {
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.modal__link-arrow {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  color: var(--orange);
  transition: transform 0.15s ease;
}

.modal__link:hover .modal__link-arrow {
  transform: translateY(-50%) translateX(3px);
}

@media (max-width: 480px) {
  .modal__panel { padding: 28px 22px 22px; }
  .modal__link { padding-right: 44px; }
}
