/* Quiet road lines tie the pages to driving without covering photographs. */
body,
body[data-page],
html[data-theme='dark'] body,
html[data-theme='dark'] body[data-page] {
  animation: none;
}

body::before {
  content: '';
  position: fixed;
  inset: -7%;
  z-index: 0;
  pointer-events: none;
  background: url('assets/road-traces.svg') center / cover no-repeat;
  opacity: .58;
  transform: translate3d(-1.5%, 0, 0);
  animation: roadDrift 48s ease-in-out infinite alternate;
}

html[data-theme='dark'] body::before {
  opacity: .44;
  filter: brightness(1.55);
}

@keyframes roadDrift {
  to { transform: translate3d(1.5%, -2%, 0); }
}

body > main,
body > .site-footer,
body > .app-shell {
  position: relative;
  z-index: 1;
}

/* The opening story sits on the page background; the photograph has a soft edge. */
.hero-stage {
  min-height: 710px;
  background: transparent;
  color: var(--ink);
}
.hero-stage__photo {
  left: auto;
  width: 67%;
  object-position: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%);
  mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.hero-stage__shade { display: none; }
.hero-stage__content { padding-block: 115px 160px; }
.hero-stage h1 { max-width: 760px; }
.hero-stage__intro { color: #1263b2; }
.hero-stage__text { color: #425d78; }
.hero-stage__secondary { border-color: #4279ae; }
.hero-stage__rail {
  position: absolute;
  left: max(32px, calc((100vw - 1340px) / 2));
  right: auto;
  bottom: 48px;
  display: flex;
  gap: 10px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.hero-stage__rail span,
.hero-stage__rail span + span {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #b2cee8;
  border-radius: 999px;
  background: rgba(247, 251, 255, .88);
  color: #164b7c;
  box-shadow: 0 7px 22px rgba(24, 73, 122, .08);
  font-size: .85rem;
}
html[data-theme='dark'] .hero-stage { color: #f4f8ff; }
html[data-theme='dark'] .hero-stage__intro { color: #f0bc58; }
html[data-theme='dark'] .hero-stage__text { color: #d5e5f7; }
html[data-theme='dark'] .hero-stage__secondary { border-color: #8ab9ed; }
html[data-theme='dark'] .hero-stage__rail span { background: rgba(13, 43, 74, .9); border-color: #5b86b1; color: #f1f7ff; }

/* The exam copy shares the same open stage and the image stays behind it. */
.exam-section {
  position: relative;
  display: block;
  min-height: 570px;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}
.exam-section > img {
  position: absolute;
  inset: 0 0 0 auto;
  width: 68%;
  height: 100%;
  opacity: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 64%);
  mask-image: linear-gradient(90deg, transparent, #000 64%);
}
.exam-section__copy { position: relative; z-index: 1; justify-content: flex-start; border: 0; }
.exam-section__copy-inner { width: min(1340px, calc(100% - 64px)); margin: 0 auto; padding: 115px 0; }
.exam-section__small { color: #1263b2; }
.exam-section h2 { max-width: 760px; }
.exam-section p { color: #425d78; }
html[data-theme='dark'] .exam-section { color: #f4f8ff; }
html[data-theme='dark'] .exam-section__small { color: #f0bc58; }
html[data-theme='dark'] .exam-section p { color: #d5e5f7; }
html[data-theme='dark'] .exam-section > img { filter: brightness(.62); }

.format-feature__details { margin-left: 22px; color: #fff; }
.lesson-placeholder { display: flex; align-items: flex-start; min-height: 62vh; padding-block: 110px; }
.lesson-placeholder h1 { max-width: 820px; font-size: clamp(2.7rem, 5vw, 5rem); color: var(--ink); }

.category-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 54px; }
.category-badge svg { width: 18px; height: 18px; flex: 0 0 auto; }
.person-teaser__content .person-teaser__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); }
.person-teaser__meta .category-badge { min-width: 49px; height: 32px; padding: 0 7px; color: #144d84; font-size: .8rem; }
.person-teaser__meta small { margin-left: 3px; color: var(--blue); font-size: .82rem; line-height: 1.35; }
.person-teaser .category-badge:hover::after,
.person-teaser .category-badge:focus-visible::after { display: none; }
html[data-theme='dark'] .person-teaser__meta .category-badge { color: #f4f8ff; }

/* Longer, gentler interaction feedback across public pages and accounts. */
body :is(a, button) {
  transition: background-color .38s cubic-bezier(.2,.7,.2,1),
    color .38s cubic-bezier(.2,.7,.2,1),
    border-color .38s cubic-bezier(.2,.7,.2,1),
    box-shadow .42s cubic-bezier(.2,.7,.2,1),
    transform .42s cubic-bezier(.2,.7,.2,1);
}
:is(.pill-button, .carousel-controls button, .filter-bar button, .text-arrow, .site-nav a,
  .header-login, .theme-toggle, .category-badge, .portal-side__nav button,
  .primary-action, .secondary-action, .segmented-filter button, .view-switch button,
  .day-tab, .slot-button, .portal-quick-grid button, .booking-card button,
  .student-booking-actions button, .settings-actions button) {
  transition: background-color .38s cubic-bezier(.2,.7,.2,1),
    color .38s cubic-bezier(.2,.7,.2,1),
    border-color .38s cubic-bezier(.2,.7,.2,1),
    box-shadow .42s cubic-bezier(.2,.7,.2,1),
    transform .42s cubic-bezier(.2,.7,.2,1);
}
.pill-button:hover,
.carousel-controls button:hover,
.theme-toggle:hover,
.primary-action:hover { transform: translateY(-1px); }
.format-feature img { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.hero-stage__content, .ground-hero__content { animation-duration: .9s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
.booking-stage:not([hidden]), .portal-screen:not([hidden]) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
::view-transition-old(root) { animation: pageOut .42s ease both; }
::view-transition-new(root) { animation: pageIn .56s ease both; }
@keyframes pageOut { to { opacity: .84; } }
@keyframes pageIn { from { opacity: .84; } to { opacity: 1; } }

/* Account overview and lesson statuses keep one clear type scale. */
.portal-explainer { padding: clamp(24px, 3vw, 42px); }
.portal-explainer h2 { margin-bottom: 22px; font-size: clamp(1.5rem, 2.1vw, 2rem); }
.portal-explainer > div { gap: 18px; }
.portal-explainer p { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); }
.portal-explainer b { display: block; margin-bottom: 9px; font-size: 1.16rem; line-height: 1.35; }
.portal-explainer span { display: block; font-size: 1rem; line-height: 1.55; }
.portal-explainer a { display: inline-block; margin-top: 16px; color: var(--accent); font-size: .94rem; text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color .38s ease; }
.portal-explainer a:hover { color: var(--accent-dark); }
.student-booking-actions { align-items: center; }
.student-booking-actions .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 34px;
  margin: 0;
  padding: 5px 12px;
  text-align: center;
  font-size: .9rem;
  line-height: 1.2;
}
.student-booking-card {
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 24px;
  align-items: stretch;
  padding: 22px;
  border-radius: 16px;
}
.student-booking-card__details { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(0, 1.4fr); gap: 28px; min-width: 0; }
.student-booking-card__date { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding-right: 20px; border-right: 1px solid var(--line); }
.student-booking-card__date .student-booking-card__number { margin: 0; color: var(--accent); font-size: .84rem; font-weight: 700; }
.student-booking-card__date strong { font-size: 1.22rem; line-height: 1.25; text-transform: capitalize; }
.student-booking-card__date time { color: var(--ink); font-size: 1.85rem; line-height: 1.12; font-weight: 650; }
.student-booking-card__info { display: grid; align-content: center; gap: 12px; min-width: 0; }
.student-booking-card__info > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.student-booking-card__info span { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
.student-booking-card__info strong, .student-booking-card__info b { color: var(--ink); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.student-booking-actions { display: grid; grid-template-columns: 1fr; grid-auto-rows: 44px; align-content: center; justify-items: stretch; gap: 8px; width: 152px; }
.student-booking-actions .status-pill { width: 100%; min-width: 0; min-height: 44px; font-size: .91rem; font-weight: 600; }
body[data-page] .student-booking-actions button:not(.danger-action),
body[data-page] .student-booking-actions button.danger-action { width: 100%; height: 44px; min-height: 44px; padding: 0 12px; font-size: .91rem; font-weight: 600; line-height: 1.2; }

.student-review-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 20px; align-items: start; }
.student-review-form, .student-review-saved { padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 30px rgba(23, 62, 109, .07); }
.student-review-form h2, .student-review-saved h2 { margin: 0 0 22px; color: var(--ink); font-size: 1.55rem; }
.student-review-form { display: grid; gap: 22px; }
.student-review-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.student-review-form label { display: grid; gap: 8px; color: var(--ink); font-size: .95rem; font-weight: 600; }
.student-review-form :is(select, textarea) { width: 100%; padding: 13px 15px; border: 1px solid #a9bfd8; border-radius: 11px; background: #fff; color: #102744; font-size: .96rem; line-height: 1.5; }
.student-review-form select { min-height: 50px; }
.student-review-form textarea { resize: vertical; min-height: 104px; }
.student-review-rating { min-width: 0; margin: 0; padding: 0; border: 0; }
.student-review-rating legend { margin-bottom: 10px; color: var(--ink); font-size: .95rem; font-weight: 600; }
.student-review-stars { display: flex; flex-wrap: wrap; gap: 7px; }
.student-review-stars button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-strong); color: #71859d; font-size: 1.65rem; line-height: 1; }
.student-review-stars button.selected { border-color: #d99b25; background: #fff0cb; color: #a46a05; }
.student-review-stars button:hover { border-color: #d99b25; transform: translateY(-1px); }
.student-review-note, .student-review-saved > p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.student-review-form .primary-action { justify-self: start; min-height: 47px; }
.student-review-form .portal-form-status { min-height: 1.4em; margin: 0; font-size: .9rem; }
.student-review-saved > p { margin: -10px 0 20px; }
.student-review-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.student-review-preview { margin-bottom: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-strong); }
.student-review-preview strong { display: block; color: var(--ink); font-size: 1.06rem; }
.student-review-preview__meta { display: block; margin-top: 6px; color: var(--accent); font-size: .88rem; }
.student-review-preview p { margin: 14px 0 0; color: var(--ink); font-size: .96rem; overflow-wrap: anywhere; }
.student-review-preview .student-review-preview__wishes { color: var(--muted); }
.student-review-preview__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: .82rem; }
.student-review-preview__footer button { min-height: 34px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; }

html[data-theme='dark'] .portal-explainer p { background: #193a5b; border-color: #486a8e; }
html[data-theme='dark'] .portal-explainer a { color: #a9d2ff; }
html[data-theme='dark'] .student-review-form,
html[data-theme='dark'] .student-review-saved { background: #102c4b; border-color: #395575; }
html[data-theme='dark'] .student-review-preview { background: #193a5b; border-color: #486a8e; }
html[data-theme='dark'] .student-review-form :is(select, textarea) { background: #0d2139; border-color: #5b7898; color: #f4f8ff; }
html[data-theme='dark'] .student-review-stars button { background: #193a5b; border-color: #5b7898; color: #adc3da; }
html[data-theme='dark'] .student-review-stars button.selected { background: #5b431d; border-color: #e3b258; color: #ffe0a1; }
html[data-theme='dark'] .student-review-preview__footer button { background: #21466b; border-color: #6689af; color: #f4f8ff; }
html[data-theme='dark'] .student-booking-card__date .student-booking-card__number { color: #9bcaff; }
html[data-theme='dark'] .student-booking-actions .status-pill.confirmed { background: #174a70; color: #d7ebff; }
html[data-theme='dark'] .student-booking-actions .status-pill.completed { background: #2b4257; color: #e1eaf4; }
html[data-theme='dark'] .student-booking-actions .status-pill.cancelled { background: #552c37; color: #ffdce3; }
html[data-theme='dark'] body[data-page] :is(.student-booking-actions button, .settings-actions button:not(.primary-action),
  .segmented-filter button:not(.active), .view-switch button:not(.active), .portal-avatar-upload,
  .booking-success-actions button, .carousel-controls button) {
  background: #21466b;
  border: 1px solid #6689af;
  color: #f3f8ff;
}
html[data-theme='dark'] body[data-page] :is(.student-booking-actions button, .settings-actions button:not(.primary-action),
  .segmented-filter button:not(.active), .view-switch button:not(.active), .booking-success-actions button):hover {
  background: #315f8b;
  border-color: #9bcaff;
  color: #fff;
}
html[data-theme='dark'] body[data-page] .status-pill.new { background: #664d21; color: #ffe6ae; }

/* Directory lists: one horizontal instructor row, expandable reviews. */
.instructor-catalog {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding: 12px 4px 24px;
  border-top: 0;
}
.instructor-catalog > .teacher-card {
  flex: 0 0 min(590px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 22px;
  scroll-snap-align: start;
}
.instructor-catalog > .teacher-card[hidden],
.review-list > .story-review[hidden] { display: none; }
.instructor-catalog .teacher-card__portrait { min-height: 230px; }
.instructor-catalog .teacher-card__content { flex: 1; }
.directory-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.directory-actions__controls { display: flex; gap: 8px; }
.directory-actions button { min-height: 44px; padding: 0 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; transition: background-color .38s ease, border-color .38s ease, transform .38s ease; }
.directory-actions button:hover { border-color: var(--blue); transform: translateY(-1px); }
.directory-actions button:disabled { opacity: .5; cursor: default; transform: none; }
.review-list > .story-review { margin-bottom: 12px; }

html.theme-switching::view-transition-old(root) { animation: none; }
html.theme-switching::view-transition-new(root) { animation: themeNew .95s ease both; }
@keyframes themeNew { from { opacity: 0; } to { opacity: 1; } }
html.theme-crossfade :is(body, header, nav, main, section, article, aside, footer, button, a, input, select, textarea) {
  transition: background-color .65s ease, color .65s ease, border-color .65s ease, box-shadow .65s ease;
}

@media (max-width: 850px) {
  .hero-stage { min-height: 700px; }
  .hero-stage__content { padding-top: 95px; }
  .hero-stage__rail { left: 18px; }
  .exam-section__copy-inner { width: min(100% - 36px, 1340px); }
  .student-review-layout { grid-template-columns: 1fr; }
}

@media (max-width: 750px) {
  .student-booking-card { grid-template-columns: 1fr; }
  .student-booking-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 44px; width: 100%; }
}

@media (max-width: 620px) {
  .hero-stage { min-height: 760px; }
  .hero-stage__photo { width: 100%; opacity: .3; -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 45%, transparent 100%); mask-image: linear-gradient(180deg, transparent 2%, #000 45%, transparent 100%); }
  .hero-stage__content { padding: 95px 0 135px; }
  .hero-stage__rail { left: 14px; right: 14px; bottom: 25px; gap: 6px; }
  .hero-stage__rail span, .hero-stage__rail span + span { min-height: 38px; padding: 0 10px; font-size: .7rem; }
  .exam-section { min-height: 600px; }
  .exam-section > img { width: 100%; opacity: .22; -webkit-mask-image: linear-gradient(90deg, transparent, #000 85%); mask-image: linear-gradient(90deg, transparent, #000 85%); }
  .exam-section__copy-inner { padding: 86px 0; }
  .format-feature__details { margin-left: 0; }
  .directory-actions { flex-wrap: wrap; }
  .instructor-catalog > .teacher-card { flex-basis: 88vw; }
  .student-booking-card { gap: 18px; padding: 18px; }
  .student-booking-card__details { grid-template-columns: 1fr; gap: 15px; }
  .student-booking-card__date { padding: 0 0 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .student-booking-card__info > div { grid-template-columns: 1fr; gap: 3px; }
  .student-booking-actions { gap: 6px; }
  body[data-page] .student-booking-actions button:not(.danger-action),
  body[data-page] .student-booking-actions button.danger-action,
  .student-booking-actions .status-pill { font-size: .8rem; }
  .student-review-form__row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body[data-page] .portal-header__nav a { display: none; }
  body[data-page='admin'] .login-form { max-width: calc(100vw - 30px); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; transform: none; }
  .instructor-catalog { scroll-behavior: auto; }
  body :is(a, button), .format-feature img { transition: none; }
  .hero-stage__content, .ground-hero__content,
  .booking-stage:not([hidden]), .portal-screen:not([hidden]) { animation: none; }
  html.theme-switching::view-transition-old(root),
  html.theme-switching::view-transition-new(root),
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html.theme-crossfade :is(body, header, nav, main, section, article, aside, footer, button, a, input, select, textarea) { transition: none; }
}
