/* =========================================================
   Jack Brayan — Portfolio
   Luxury · Epure · Navy Ink + Sky Blue
   No gradients. Solid colors. Clean lines.
   ========================================================= */

:root {
  color-scheme: dark;
  --ink-900: #080d16;
  --ink-800: #0b1220;
  --ink-700: #121a2b;
  --ink-600: #1a2338;
  --ink-500: #232c44;
  --gold-100: #dff6ff;
  --gold-200: #baeaff;
  --gold-300: #7dd3fc;
  --gold-400: #38bdf8;
  --cream-50:  #fbfaf5;
  --cream-100: #f5f1e6;
  --cream-200: #e9e2ce;
  --cream-300: #ccc4a9;
  --border: rgba(125, 211, 252, 0.22);
  --border-soft: rgba(255, 255, 255, 0.06);
  --shadow-luxe: 0 20px 40px -20px rgba(0, 0, 0, 0.65);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink-900: #fbf7ef;
  --ink-800: #fffdf8;
  --ink-700: #f1eadc;
  --ink-600: #dccfb9;
  --ink-500: #c7b898;
  --gold-100: #dff6ff;
  --gold-200: #38bdf8;
  --gold-300: #0284c7;
  --gold-400: #0369a1;
  --cream-50:  #121826;
  --cream-100: #1f2937;
  --cream-200: #334155;
  --cream-300: #64748b;
  --border: rgba(2, 132, 199, 0.28);
  --border-soft: rgba(15, 23, 42, 0.1);
  --shadow-luxe: 0 24px 50px -30px rgba(66, 50, 23, 0.38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--ink-900);
  color: var(--cream-100);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(251, 247, 239, 1) 42%),
    var(--ink-900);
}

:root[data-theme="light"] .bg-ink-900,
:root[data-theme="light"] .bg-ink-800,
:root[data-theme="light"] .bg-ink-800\/40,
:root[data-theme="light"] .bg-ink-800\/60 {
  background-color: var(--ink-800) !important;
}

:root[data-theme="light"] .text-cream-50 { color: var(--cream-50) !important; }
:root[data-theme="light"] .text-cream-100 { color: var(--cream-100) !important; }
:root[data-theme="light"] .text-cream-200 { color: var(--cream-200) !important; }
:root[data-theme="light"] .text-cream-300 { color: var(--cream-300) !important; }
:root[data-theme="light"] .text-gold-300 { color: var(--gold-300) !important; }
:root[data-theme="light"] .hover\:text-cream-50:hover { color: var(--cream-50) !important; }
:root[data-theme="light"] .border-white\/5,
:root[data-theme="light"] .border-white\/10 {
  border-color: var(--border-soft) !important;
}

/* Serif display */
h1, h2, h3, .font-serif, .section-title, .project-title, .timeline-title, .edu-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: -0.005em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 8px; border: 2px solid var(--ink-900); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

/* Selection */
::selection { background: var(--gold-300); color: var(--ink-900); }

/* Focus */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold-300);
  color: var(--ink-900);
  padding: 10px 16px;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Scroll progress */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--gold-300);
  z-index: 80;
  transition: width 0.1s linear;
}

/* =====================  HEADER  ===================== */
#site-header {
  background: rgba(8, 13, 22, 0.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
  transition: background .3s ease, border-color .3s ease;
}
#site-header.scrolled {
  background: rgba(8, 13, 22, 0.92);
  border-bottom-color: var(--border);
}
:root[data-theme="light"] #site-header {
  background: rgba(255, 253, 248, 0.82);
  border-bottom-color: rgba(2, 132, 199, 0.14);
  box-shadow: 0 10px 30px -26px rgba(15, 23, 42, 0.7);
}
:root[data-theme="light"] #site-header.scrolled {
  background: rgba(255, 253, 248, 0.96);
  border-bottom-color: var(--border);
}

.nav-link {
  position: relative;
  color: var(--cream-200);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color .25s ease;
}
.nav-link:hover { color: var(--cream-50); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--gold-300);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

.mobile-link {
  color: var(--cream-100);
  transition: color .25s ease, transform .25s ease;
}
.mobile-link:hover { color: var(--gold-300); transform: translateX(6px); }

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.5rem;
  color: var(--cream-200);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .3s ease, background-color .3s ease, color .3s ease, transform .3s ease;
}
.theme-toggle:hover {
  color: var(--cream-50);
  border-color: var(--border);
  transform: translateY(-1px);
}
.theme-toggle__icon {
  width: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  opacity: 0.48;
  transition: color .25s ease, opacity .25s ease, transform .25s ease;
}
.theme-toggle__track {
  position: relative;
  width: 2.8rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--ink-600);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 6px rgba(0,0,0,0.22);
}
.theme-toggle__thumb {
  position: absolute;
  left: 0.18rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--gold-300);
  transform: translateY(-50%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), background-color .3s ease;
  box-shadow: 0 5px 12px rgba(0,0,0,0.25);
}
:root[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.65);
}
:root[data-theme="light"] .theme-toggle__thumb {
  transform: translate(1.35rem, -50%);
}
:root[data-theme="dark"] .theme-toggle__icon:first-child,
:root[data-theme="light"] .theme-toggle__icon:last-child {
  color: var(--gold-300);
  opacity: 1;
  transform: scale(1.05);
}
.theme-toggle--mobile {
  justify-content: space-between;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 2px;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.theme-toggle__text {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* =====================  BUTTONS  ===================== */
.btn-primary, .btn-outline, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  transition: all .3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold-300);
  color: var(--ink-900);
  border: 1px solid var(--gold-300);
}
.btn-primary:hover {
  background: var(--gold-200);
  border-color: var(--gold-200);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--cream-50);
  border: 1px solid var(--gold-300);
}
.btn-outline:hover {
  background: var(--gold-300);
  color: var(--ink-900);
}

.btn-ghost {
  background: transparent;
  color: var(--cream-200);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover {
  color: var(--cream-50);
  border-color: var(--cream-300);
}

/* =====================  HERO  ===================== */
.portrait-frame {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px solid var(--gold-300);
  z-index: 0;
  pointer-events: none;
  transition: transform .6s ease;
}
.portrait-frame:hover::before { transform: translate(6px, 6px); }

.portrait-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--ink-700);
  display: block;
}

.portrait-caption {
  position: absolute;
  right: -8px;
  bottom: -28px;
  background: var(--ink-800);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  z-index: 2;
  box-shadow: var(--shadow-luxe);
}

/* Stats */
.stat-card {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.stat-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-300);
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--gold-300);
  font-weight: 500;
  line-height: 1;
}

.identity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 42rem;
  margin: 0 0 2.25rem;
  padding: 0;
  list-style: none;
}
.identity-tags li {
  color: var(--cream-200);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.035);
  padding: 0.45rem 0.72rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
:root[data-theme="light"] .identity-tags li {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(2, 132, 199, 0.18);
}

/* =====================  SECTIONS  ===================== */
.section-head { margin-bottom: 0; }
.section-head.text-center { text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold-300);
}
.eyebrow.justify-center::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold-300);
}

.section-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.05;
  color: var(--cream-50);
  margin-bottom: 1rem;
  font-weight: 500;
}

.section-lede {
  font-size: 1.0625rem;
  color: var(--cream-300);
  max-width: 680px;
  line-height: 1.7;
}

.subsection-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  color: var(--cream-50);
  margin-bottom: 1.25rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* =====================  EXPANDABLE TEXT  ===================== */
.expandable-block {
  --visible-lines: 2;
}
.expandable-block.is-collapsible:not(.is-fully-visible) > .expandable-content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--visible-lines);
  overflow: hidden;
}
.expandable-more {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.45rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold-300);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.expandable-more:hover {
  color: var(--gold-200);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.expandable-more[hidden] {
  display: none;
}
.project-card .expandable-more {
  position: relative;
  z-index: 2;
}

/* =====================  TIMELINE  ===================== */
.timeline {
  position: relative;
  padding-left: 2.25rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.75rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2.25rem;
  top: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-800);
  border: 1px solid var(--gold-300);
  color: var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background .3s ease, color .3s ease;
}
.timeline-item:hover .timeline-dot {
  background: var(--gold-300);
  color: var(--ink-900);
}

.timeline-body {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: 1.5rem 1.75rem;
  transition: border-color .3s ease, transform .3s ease;
}
.timeline-item:hover .timeline-body {
  border-color: var(--border);
  transform: translateX(4px);
}

.timeline-title {
  font-size: 1.5rem;
  color: var(--cream-50);
  font-weight: 500;
  line-height: 1.2;
}

.timeline-date {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-300);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.timeline-org {
  color: var(--cream-300);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.timeline-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--cream-200);
  font-size: 0.95rem;
  line-height: 1.6;
}
.timeline-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 6px;
  height: 1px;
  background: var(--gold-300);
}

/* Internship cards */
.intern-card {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: 1.25rem 1.5rem;
  transition: border-color .3s ease, transform .3s ease;
}
.intern-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}
.intern-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--cream-50);
  margin-bottom: 0.25rem;
}
.intern-desc {
  color: var(--cream-200);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.intern-date {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-300);
}

/* =====================  PROJECTS  ===================== */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  color: inherit;
  text-decoration: none;
  transition: border-color .35s ease, transform .35s ease, background-color .35s ease;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 0;
  height: 1px;
  background: var(--gold-300);
  transition: width .45s ease;
}
.project-card:hover {
  border-color: var(--border);
  background: var(--ink-700);
  transform: translateY(-4px);
}
.project-card:hover::before { width: 100%; }

.project-tag {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 0.9rem;
}
.project-title {
  font-size: 1.5rem;
  color: var(--cream-50);
  margin-bottom: 0.6rem;
  font-weight: 500;
  line-height: 1.2;
}
.project-desc {
  color: var(--cream-200);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-300);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.project-link i { transition: transform .3s ease; }
.project-card:hover .project-link i { transform: translate(2px, -2px); }

/* Legacy project-card (dynamic injected) */
.card-animation { animation: fadeInUp 0.6s ease-out forwards; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================  CASE STUDY (FEATURED PROJECT)  ===================== */
.case-study {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  position: relative;
  transition: border-color .35s ease;
}
.case-study:hover { border-color: var(--border); }

.case-study__head {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.case-study__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.case-study__eyebrow-bar {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--gold-300);
}
.case-study__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}
.case-study__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  line-height: 1.05;
  color: var(--cream-50);
  font-weight: 500;
  margin: 0;
}
.case-study__subtitle {
  margin: 0.4rem 0 0;
  color: var(--cream-300);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 32rem;
}
.case-study__cta {
  white-space: nowrap;
}

.case-study__hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
}
.case-study__hero-figure {
  margin: 0;
  border: 1px solid var(--border-soft);
  background: var(--ink-900);
  overflow: hidden;
  position: relative;
  transition: border-color .4s ease;
}
.case-study__hero-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color .4s ease;
}
.case-study__hero-figure:hover { border-color: var(--border); }
.case-study__hero-figure:hover::after { border-color: var(--gold-300); }
.case-study__hero-figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  transition: transform .65s ease;
}
.case-study__hero-figure:hover img { transform: scale(1.025); }

.case-study__brief {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
}
.case-study__intro {
  margin: 0;
  color: var(--cream-200);
  font-size: 1rem;
  line-height: 1.65;
}

.case-study__deliverables {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.case-study__deliverables li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--cream-100);
  font-size: 0.92rem;
  line-height: 1.5;
}
.case-study__deliverables li i {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  color: var(--gold-300);
  border: 1px solid var(--gold-300);
}

.case-study__pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.25rem;
  margin: 0;
  border-top: 1px solid var(--border-soft);
}
.case-study__pillars > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.case-study__pillars dt {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.85rem;
  color: var(--gold-300);
  font-weight: 500;
  line-height: 1;
}
.case-study__pillars dd {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-300);
}

.case-study__gallery {
  margin-top: 2.5rem;
  padding: 5rem 1rem 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  position: relative;
  perspective: 1200px;
}
.case-study__shot {
  position: relative;
  width: 340px;
  height: 230px;
  margin: 0 -90px;
  background: rgba(11, 18, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 35px rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  transform-origin: center bottom;
  transform: rotate(calc(var(--r) * 1deg));
  transition: transform .6s cubic-bezier(.2,.85,.2,1), margin .6s cubic-bezier(.2,.85,.2,1), box-shadow .35s ease, z-index 0s;
  z-index: 1;
}
.case-study__gallery:hover .case-study__shot {
  transform: rotate(0deg);
  margin: 0 10px;
}
.case-study__shot:hover {
  z-index: 5;
  box-shadow: 0 35px 50px rgba(0, 0, 0, 0.55);
  transform: rotate(0deg) translateY(-10px) scale(1.04) !important;
}

.case-study__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .6s ease;
}

.case-study__shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(to top, rgba(8, 13, 22, 0.95), rgba(8, 13, 22, 0));
  color: var(--cream-50);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .case-study__hero { grid-template-columns: 1fr; }
  .case-study__gallery { padding: 4rem 0.5rem 3rem; }
  .case-study__shot {
    width: 260px;
    height: 175px;
    margin: 0 -70px;
  }
}
@media (max-width: 640px) {
  .case-study__heading { flex-direction: column; align-items: flex-start; }
  .case-study__cta { align-self: flex-start; }
  .case-study__pillars dt { font-size: 1.5rem; }
  .case-study__gallery {
    flex-direction: column;
    padding: 1rem 0;
    gap: 1rem;
    perspective: none;
  }
  .case-study__shot {
    width: 100%;
    max-width: 420px;
    height: 240px;
    margin: 0;
    transform: rotate(0deg);
  }
  .case-study__gallery:hover .case-study__shot { margin: 0; }
  .case-study__shot:hover {
    transform: rotate(0deg) translateY(-4px) scale(1.01) !important;
  }
}

:root[data-theme="light"] .case-study__shot {
  background: rgba(255, 253, 248, 0.7);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.18);
}
:root[data-theme="light"] .case-study__shot figcaption {
  background: linear-gradient(to top, rgba(255, 253, 248, 0.95), rgba(255, 253, 248, 0));
  color: var(--cream-50);
}

/* =====================  SKILLS  ===================== */
.skill-card {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: 1.75rem 1.5rem;
  transition: border-color .35s ease, transform .35s ease;
}
.skill-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}
.skill-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-300);
  color: var(--gold-300);
  font-size: 1rem;
  margin-bottom: 1.1rem;
}
.skill-title {
  font-size: 1.4rem;
  color: var(--cream-50);
  margin-bottom: 0.9rem;
  font-weight: 500;
}
.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.skill-list li {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--cream-200);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-soft);
}

/* =====================  MARQUEE  ===================== */
.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  animation: marquee-scroll 35s linear infinite;
}
.marquee-group {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  flex-shrink: 0;
}
.marquee-group img {
  height: 42px;
  width: auto;
  opacity: 0.75;
  transition: opacity .3s ease, transform .3s ease;
}
.marquee-group img:hover {
  opacity: 1;
  transform: scale(1.08);
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 1.75rem)); }
}

/* =====================  EDUCATION  ===================== */
.edu-card {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: 1.5rem 1.5rem 1.75rem;
  transition: border-color .35s ease, transform .35s ease;
  position: relative;
}
.edu-card:hover {
  border-color: var(--border);
  transform: translateY(-3px);
}
.edu-year {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.edu-title {
  font-size: 1.35rem;
  color: var(--cream-50);
  font-weight: 500;
  margin-bottom: 0.35rem;
  line-height: 1.2;
}
.edu-school {
  color: var(--cream-200);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 0.6rem;
}
.edu-detail {
  color: var(--cream-300);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* =====================  CONTACT  ===================== */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  text-decoration: none;
  transition: border-color .3s ease, transform .3s ease;
}
.contact-card:hover {
  border-color: var(--gold-300);
  transform: translateY(-3px);
}
.contact-card i {
  font-size: 1.25rem;
  color: var(--gold-300);
  margin-bottom: 0.9rem;
}
.contact-label {
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cream-300);
  margin-bottom: 0.4rem;
}
.contact-value {
  color: var(--cream-50);
  font-size: 1rem;
  font-weight: 500;
  word-break: break-word;
}

.contact-form {
  background: var(--ink-800);
  border: 1px solid var(--border-soft);
  padding: 1.5rem;
  box-shadow: var(--shadow-luxe);
}
.contact-form__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1.25rem;
}
.contact-form__head > i {
  color: var(--gold-300);
  border: 1px solid var(--border);
  width: 2.7rem;
  height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.contact-form__title {
  color: var(--cream-50);
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.15;
  margin-top: 0.3rem;
  font-weight: 500;
}
.contact-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--cream-200);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-soft);
  background: var(--ink-900);
  color: var(--cream-50);
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 0;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.contact-form textarea {
  resize: vertical;
  min-height: 9rem;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--cream-300);
  opacity: 0.78;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--gold-300);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}
.contact-form__message {
  margin-top: 1rem;
}
.contact-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.form-note {
  min-height: 1.25rem;
  color: var(--cream-300);
  font-size: 0.85rem;
  margin-top: 0.9rem;
}

.social-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-100);
  border: 1px solid var(--border-soft);
  transition: color .3s ease, border-color .3s ease, transform .3s ease;
  font-size: 1.05rem;
}
.social-icon:hover {
  color: var(--gold-300);
  border-color: var(--gold-300);
  transform: translateY(-2px);
}

/* =====================  BACK TO TOP  ===================== */
#back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-300);
  color: var(--ink-900);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, background-color .3s ease;
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover { background: var(--gold-200); }

/* =====================  DYNAMIC CARDS (JS)  ===================== */
#github-projects .project-card,
#huggingface-projects .project-card {
  padding: 1.25rem 1.25rem;
}
#github-projects .project-card h3,
#huggingface-projects .project-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--cream-50);
  margin-bottom: 0.5rem;
}
#github-projects .project-card p,
#huggingface-projects .project-card p {
  font-size: 0.85rem;
  color: var(--cream-200);
}
#github-projects .project-card a,
#huggingface-projects .project-card a {
  color: var(--gold-300);
  font-size: 0.85rem;
}

/* =====================  CHATBOT  ===================== */
.chatbot-shell {
  position: fixed;
  top: calc(5.9rem + env(safe-area-inset-top, 0px));
  left: 1.25rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  pointer-events: none;
}
.chatbot-shell > * {
  pointer-events: auto;
}

.chatbot-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.15rem;
  height: 4.15rem;
  padding: 0;
  background: rgba(8, 13, 22, 0.92);
  color: var(--cream-50);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 1.45rem;
  box-shadow: 0 24px 55px -28px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .3s ease, border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.chatbot-shell[data-dragging="true"] .chatbot-launcher {
  cursor: grabbing;
}
.chatbot-launcher::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 1.8rem;
  border: 1px solid rgba(125, 211, 252, 0.1);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity .28s ease, transform .28s ease;
}
.chatbot-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--gold-300);
  box-shadow: 0 28px 58px -28px rgba(0, 0, 0, 0.85);
}
.chatbot-launcher:hover::before,
.chatbot-launcher:focus-visible::before,
.chatbot-launcher[aria-expanded="true"]::before {
  opacity: 1;
  transform: scale(1);
}
.chatbot-launcher[aria-expanded="true"] {
  border-color: var(--gold-300);
  background: rgba(11, 18, 32, 0.98);
}
.chatbot-launcher__icon {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(125, 211, 252, 0.12);
  color: var(--gold-300);
  font-size: 1.05rem;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 1rem;
  flex: 0 0 auto;
  transition: background-color .28s ease, color .28s ease, border-color .28s ease;
}
.chatbot-launcher:hover .chatbot-launcher__icon,
.chatbot-launcher[aria-expanded="true"] .chatbot-launcher__icon {
  background: var(--gold-300);
  color: var(--ink-900);
  border-color: var(--gold-300);
}
.chatbot-launcher__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--gold-300);
  color: var(--ink-900);
  border: 2px solid var(--ink-900);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 12px 24px -14px rgba(14, 165, 233, 0.85);
}
.chatbot-launcher__text {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.85rem);
  min-width: 15.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  text-align: left;
  padding: 0.8rem 0.95rem 0.85rem;
  background: rgba(8, 13, 22, 0.94);
  border: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow: 0 26px 55px -38px rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-8px, -50%);
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}
.chatbot-launcher__text::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  background: inherit;
  border-left: 1px solid rgba(125, 211, 252, 0.18);
  border-bottom: 1px solid rgba(125, 211, 252, 0.18);
  transform: translateY(-50%) rotate(45deg);
}
.chatbot-launcher:hover .chatbot-launcher__text,
.chatbot-launcher:focus-visible .chatbot-launcher__text,
.chatbot-launcher[aria-expanded="true"] .chatbot-launcher__text {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}
.chatbot-shell[data-dragging="true"] .chatbot-launcher__text {
  opacity: 0;
  visibility: hidden;
}
.chatbot-launcher__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.01em;
}
.chatbot-launcher__meta {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-300);
}

.chatbot-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 1rem);
  width: min(26rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 8.5rem));
  display: flex;
  flex-direction: column;
  background: rgba(11, 18, 32, 0.96);
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 1.6rem;
  box-shadow: 0 35px 80px -35px rgba(0, 0, 0, 0.88);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.985);
  transform-origin: top left;
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}
.chatbot-panel::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 1.35rem;
  width: 1.1rem;
  height: 1.1rem;
  background: rgba(11, 18, 32, 0.96);
  border-top: 1px solid rgba(125, 211, 252, 0.24);
  border-left: 1px solid rgba(125, 211, 252, 0.24);
  transform: rotate(45deg);
}
.chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-launcher__text {
  left: auto;
  right: calc(100% + 0.85rem);
  transform: translate(8px, -50%);
}
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-launcher:hover .chatbot-launcher__text,
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-launcher:focus-visible .chatbot-launcher__text,
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-launcher[aria-expanded="true"] .chatbot-launcher__text {
  transform: translate(0, -50%);
}
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-launcher__text::before {
  left: auto;
  right: -0.45rem;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid rgba(125, 211, 252, 0.18);
  border-top: 1px solid rgba(125, 211, 252, 0.18);
}
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-panel {
  left: auto;
  right: 0;
}
.chatbot-shell[data-chatbot-horizontal="left"] .chatbot-panel::before {
  left: auto;
  right: 1.35rem;
}
.chatbot-shell[data-chatbot-horizontal="left"][data-chatbot-vertical="down"] .chatbot-panel {
  transform-origin: top right;
}
.chatbot-shell[data-chatbot-horizontal="right"][data-chatbot-vertical="down"] .chatbot-panel {
  transform-origin: top left;
}
.chatbot-shell[data-chatbot-vertical="up"] .chatbot-panel {
  top: auto;
  bottom: calc(100% + 1rem);
  transform: translateY(10px) scale(0.985);
}
.chatbot-shell[data-chatbot-vertical="up"] .chatbot-panel::before {
  top: auto;
  bottom: -0.55rem;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid rgba(125, 211, 252, 0.24);
  border-bottom: 1px solid rgba(125, 211, 252, 0.24);
}
.chatbot-shell[data-chatbot-horizontal="right"][data-chatbot-vertical="up"] .chatbot-panel {
  transform-origin: bottom left;
}
.chatbot-shell[data-chatbot-horizontal="left"][data-chatbot-vertical="up"] .chatbot-panel {
  transform-origin: bottom right;
}
.chatbot-shell[data-chatbot-horizontal="left"][data-chatbot-vertical="up"] .chatbot-panel::before {
  left: auto;
  right: 1.35rem;
}
.chatbot-shell[data-chatbot-vertical="up"] .chatbot-panel.is-open {
  transform: translateY(0) scale(1);
}

.chatbot-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
}
.chatbot-panel__title {
  color: var(--cream-50);
  font-size: 1.45rem;
  line-height: 1.05;
  font-weight: 600;
}
.chatbot-panel__lede {
  margin-top: 0.2rem;
  color: var(--cream-300);
  font-size: 0.76rem;
  line-height: 1.45;
}

.chatbot-close {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--cream-200);
  border: 1px solid var(--border-soft);
  flex: 0 0 auto;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}
.chatbot-close:hover {
  color: var(--cream-50);
  border-color: var(--gold-300);
  transform: translateY(-1px);
}

.chatbot-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 16%),
    rgba(8, 13, 22, 0.58);
}

.chatbot-message {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 88%;
}
.chatbot-message--assistant {
  align-self: flex-start;
}
.chatbot-message--user {
  align-self: flex-end;
  align-items: flex-end;
}
.chatbot-message__label {
  display: none;
}
.chatbot-bubble {
  padding: 0.82rem 0.95rem;
  white-space: pre-line;
  line-height: 1.55;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.chatbot-message--assistant .chatbot-bubble {
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream-50);
  border-color: var(--border-soft);
}
.chatbot-message--user .chatbot-bubble {
  background: var(--gold-300);
  color: var(--ink-900);
  border-color: var(--gold-300);
  box-shadow: 0 18px 28px -24px rgba(14, 165, 233, 0.95);
}
.chatbot-bubble a {
  color: var(--gold-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chatbot-message--user .chatbot-bubble a {
  color: inherit;
}

.chatbot-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.chatbot-typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--gold-300);
  opacity: 0.28;
  animation: chatTypingPulse 1.1s infinite ease-in-out;
}
.chatbot-typing span:nth-child(2) {
  animation-delay: 0.14s;
}
.chatbot-typing span:nth-child(3) {
  animation-delay: 0.28s;
}
@keyframes chatTypingPulse {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.28;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 1rem;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}
.chatbot-input {
  width: 100%;
  min-height: 3.25rem;
  max-height: 8.5rem;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  background: rgba(8, 13, 22, 0.82);
  color: var(--cream-50);
  padding: 0.95rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  border-radius: 0;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.chatbot-input::placeholder {
  color: var(--cream-300);
  opacity: 0.85;
}
.chatbot-input:focus {
  border-color: var(--gold-300);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}
.chatbot-send {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-300);
  color: var(--ink-900);
  border: 1px solid var(--gold-300);
  transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
}
.chatbot-send:hover {
  transform: translateY(-1px);
  background: var(--gold-200);
  border-color: var(--gold-200);
}

:root[data-theme="light"] .chatbot-launcher,
:root[data-theme="light"] .chatbot-panel {
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 28px 70px -42px rgba(15, 23, 42, 0.65);
}
:root[data-theme="light"] .chatbot-panel::before,
:root[data-theme="light"] .chatbot-launcher__text {
  background: rgba(255, 253, 248, 0.95);
}
:root[data-theme="light"] .chatbot-launcher__badge {
  border-color: var(--ink-800);
}
:root[data-theme="light"] .chatbot-form,
:root[data-theme="light"] .chatbot-log,
:root[data-theme="light"] .chatbot-message--assistant .chatbot-bubble {
  background-color: rgba(255, 255, 255, 0.72);
}
:root[data-theme="light"] .chatbot-input {
  background: rgba(255, 255, 255, 0.88);
}

/* =====================  RESPONSIVE  ===================== */
@media (max-width: 1024px) {
  .portrait-caption { right: 8px; bottom: -20px; }
}

@media (max-width: 768px) {
  .chatbot-shell {
    top: calc(5.45rem + env(safe-area-inset-top, 0px));
    left: 0.85rem;
    align-items: stretch;
  }
  .chatbot-panel {
    width: min(24rem, calc(100vw - 1.7rem));
    max-height: min(70vh, calc(100vh - 8rem));
    transform-origin: top left;
  }
  .chatbot-launcher {
    width: 3.8rem;
    height: 3.8rem;
  }
  .chatbot-launcher__icon {
    width: 2.65rem;
    height: 2.65rem;
  }
  .chatbot-launcher__text {
    min-width: 13.5rem;
  }
  .chatbot-launcher__meta {
    font-size: 0.68rem;
  }
  .chatbot-panel__title {
    font-size: 1.7rem;
  }
  .chatbot-panel__lede {
    font-size: 0.84rem;
  }
  .chatbot-message {
    max-width: 92%;
  }
  .section-title { font-size: 2.25rem; }
  .timeline { padding-left: 2rem; }
  .timeline::before { left: 11px; }
  .timeline-dot { left: -2rem; width: 26px; height: 26px; font-size: 11px; }
  .timeline-body { padding: 1.25rem 1.25rem; }
  .timeline-title { font-size: 1.2rem; }
  .portrait-frame::before { inset: -8px; }
  .portrait-caption { position: static; display: block; margin-top: 1rem; text-align: center; }
  .contact-form { padding: 1.15rem; }
  .contact-form__grid { grid-template-columns: 1fr; }
  .contact-form__head { align-items: center; }
  #back-to-top { right: 0.9rem; bottom: 0.9rem; width: 42px; height: 42px; }
}

@media (max-width: 480px) {
  .chatbot-shell {
    left: 0.7rem;
    top: calc(5.2rem + env(safe-area-inset-top, 0px));
  }
  .chatbot-launcher {
    width: 3.45rem;
    height: 3.45rem;
  }
  .chatbot-launcher__icon {
    width: 2.35rem;
    height: 2.35rem;
  }
  .chatbot-launcher__meta {
    display: none;
  }
  .chatbot-launcher__text {
    min-width: auto;
    width: min(13rem, calc(100vw - 5.6rem));
    padding: 0.65rem 0.8rem 0.7rem;
  }
  .chatbot-launcher__title {
    font-size: 1rem;
  }
  .chatbot-panel {
    width: min(22.4rem, calc(100vw - 1.4rem));
  }
  .chatbot-panel__header,
  .chatbot-form {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .chatbot-log {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .chatbot-form {
    grid-template-columns: 1fr;
  }
  .chatbot-send {
    width: 100%;
    height: 3rem;
  }
  .btn-primary, .btn-outline, .btn-ghost { padding: 0.65rem 1rem; font-size: 0.82rem; }
  .stat-value { font-size: 1.5rem; }
  .contact-card { padding: 1.5rem 1rem; }
  .identity-tags li { font-size: 0.62rem; padding: 0.38rem 0.55rem; }
  .theme-toggle { gap: 0.25rem; padding: 0.3rem 0.38rem; }
  .theme-toggle__icon { display: none; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
