/* Supplied alpha PNG needs no blend operation in either mode. */
.aryan-artwork.has-transparent-artwork img { mix-blend-mode: normal; }
/* Device preference is the only theme switch. Existing dark palette stays intact. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --paper: #f5f3ef;
    --ink: #191919;
    --muted: #54514c;
    --line: #b6b0a7;
    --surface-dark: #ebe7e0;
    --red: #b63830;
    --action-red-on-dark: #b63830;
    --theme-hover: #842820;
  }
  html, body { background: var(--paper); color: var(--ink); }
  .header, .home .header, .inner .header, body.inner:has(.project-hero) .header {
    color: var(--ink); background: rgba(245,243,239,.96); border-bottom-color: var(--line);
  }
  .header .menu-button, .home .header .menu-button, body.inner:has(.project-hero) .header .menu-button,
  .header .menu-button:hover, .home .header .menu-button:hover, body.inner:has(.project-hero) .header .menu-button:hover,
  .header a.account-link, .header a.account-link:visited, .header a.account-link:hover, .header a.account-link:active {
    color: var(--ink);
  }
  .header .menu-icon > span { background: currentColor; }
  .mobile-nav, .home .mobile-nav { background: var(--paper); color: var(--ink); }
  .mobile-nav .nav-link, .mobile-nav .nav-link:visited { color: var(--red); }
  .skip { background: var(--ink); color: var(--paper); }
  :is(a,button,input,select,textarea):focus-visible { outline-color: var(--red); }

  /* Photographs retain their original pixels and a dark, readable title scrim. */
  .hero, .project-hero { color: #fff; }
  .hero .hero-shade, .home .hero-slide .hero-shade, .home .hero-slide.stone-courtyard .hero-shade,
  .project-hero > .hero-shade, .grounds-story .project-hero > .hero-shade {
    background: linear-gradient(180deg,rgba(0,0,0,.2),rgba(0,0,0,.1) 35%,rgba(0,0,0,.8));
  }
  .home .hero-slide .hero-shade::after, .project-hero .hero-shade::after { background: none; }
  .hero .hero-title, .hero .hero-bottom, .project-hero .project-hero-title { color: #fff; }
  .hero .hero-link, .hero .hero-link:visited, .hero .hero-link:hover,
  .hero .slide-controls button, .hero .slide-controls button:hover { color: #fff; }
  .hero :is(a,button):focus-visible { outline-color: #fff; }

  .approach, .studio { background: var(--surface-dark); color: var(--ink); }
  .image-wrap, .work-feature figure, .project-gallery img, .about-person-concept > div:first-child { background: var(--surface-dark); }
  :is(.home,.diagram-category) .design-thinking { color: var(--ink); }
  .stage p, .consult-intro p, .studio-copy p:not(.eyebrow), .story p:not(.eyebrow),
  .wide-image figcaption, .approach-detail p, .about-split p, .thinking-copy p,
  .process-rows p, .consultation-note > div > p:not(.eyebrow), :is(.home,.diagram-category) .thinking-copy p,
  :is(.home,.diagram-category) .design-thinking > .eyebrow, .home .masterclasses-invitation-copy p,
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-flow p, :is(.home,.diagram-category) :is(#approach,#design-stages) .process-feedback,
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-feedback-route, :is(.home,.diagram-category) #studio .massing-kicker,
  .connection small, .price small, .consult-note, .booking p { color: var(--muted); }
  .stage, .connection { border-color: var(--line); }
  .connection-line { background: var(--muted); }
  :is(a.button,a.text-link,a.small-link,a.journey,a.footer-cta),
  :is(a.button,a.text-link,a.small-link,a.journey,a.footer-cta):visited,
  :is(.home,.diagram-category) .thinking-copy .text-link, :is(.home,.diagram-category) #studio .massing-about { color: var(--red); }
  :is(a.button,a.text-link,a.small-link,a.journey,a.footer-cta):hover,
  .journey:hover > span:first-child, :is(.home,.diagram-category) .thinking-copy .text-link:hover,
  :is(.home,.diagram-category) #studio .massing-about:hover { color: var(--theme-hover); }

  footer#contact, footer#contact .footer-bottom { background: var(--paper); color: var(--ink); }
  footer#contact a[href], footer#contact a[href]:visited,
  footer#contact a[href]:hover, footer#contact a[href]:active { color: var(--ink); }
  footer#contact a[href]:focus-visible { outline-color: var(--red); }
  footer#contact :is(.footer-label,.footer-copyright,.footer-meta,.copyright) { color: var(--muted); }

  /* The existing geometry and elapsed-time animations are unchanged. */
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-lines path { stroke: #68635b; }
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-flow::before, :is(.home,.diagram-category) :is(#approach,#design-stages) .process-flow::after,
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-flow > li::before, :is(.home,.diagram-category) :is(#approach,#design-stages) .process-flow > li::after,
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-return, :is(.home,.diagram-category) :is(#approach,#design-stages) .process-return::after,
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-feedback, :is(.home,.diagram-category) :is(#approach,#design-stages) .process-feedback::before { border-color: #68635b; }
  :is(.home,.diagram-category) :is(#approach,#design-stages) .process-diagram[data-process-lines="ready"] .process-feedback { border-color: transparent; }
  :is(.home,.diagram-category) #studio .massing-stage svg { color: #36322e; }
  :is(.home,.diagram-category) #studio .massing-stage .massing-secondary { stroke: #68635b; }
  :is(.home,.diagram-category) #studio .massing-stage .massing-ground { stroke: #827b71; }
  :is(.home,.diagram-category) #consultations .consultation-plan .consultation-wall-fine { opacity: .65; }
  :is(.home,.diagram-category) #consultations .consultation-plan .consultation-review-fine { opacity: .9; }

  /* Transparent artwork takes the exact active paper color without a matte. */
  .aryan-artwork:not(.has-transparent-artwork) { background: #101010; }
  .aryan-artwork.has-transparent-artwork { background: var(--paper); }
  .aryan-artwork.has-transparent-artwork img { mix-blend-mode: normal; }
}

/* Light counterpart for the existing intake, catalogue and consultation UI.
   Append after the current page styles; dark mode receives no declarations. */
@media (prefers-color-scheme: light) {
  /* Native fields, upload control and all existing form states. */
  .enquiry-form input:not([type="checkbox"]):not([type="radio"]),
  .enquiry-form select,
  .enquiry-form textarea {
    color: var(--ink);
    background: #fffdf9;
    border-color: #827b71;
  }
  .enquiry-form input::placeholder,
  .enquiry-form textarea::placeholder {
    color: #6d675f;
    opacity: 1;
  }
  .enquiry-form select:invalid { color: var(--muted); }
  .enquiry-form select option { color: var(--ink); background: #fffdf9; }
  .enquiry-form select option:disabled { color: #6d675f; }
  .enquiry-form input[type="file"]::file-selector-button {
    color: var(--ink);
    background: #eee8df;
    border-color: #827b71;
  }
  .enquiry-form .choice input { accent-color: var(--red); }
  .enquiry-form :is(input,select,textarea,button,a):focus-visible {
    outline-color: var(--red);
  }
  .enquiry-form [aria-invalid="true"] { outline-color: var(--red); }
  .enquiry-form .field-error,
  .enquiry-form .field[data-invalid="true"] > .source-label,
  .enquiry-form .field[data-invalid="true"] > legend,
  .enquiry-form #submission-status[data-phase="error"] { color: var(--red); }
  .enquiry-form .submit-button {
    color: var(--muted);
    border-color: #827b71;
  }
  .enquiry-form .submit-button:not(:disabled) {
    color: var(--red);
    border-color: var(--red);
  }
  .enquiry-form .form-fields:disabled { opacity: 1; }
  .enquiry-form input:not([type="checkbox"]):not([type="radio"]):disabled,
  .enquiry-form select:disabled,
  .enquiry-form textarea:disabled,
  .enquiry-form .form-fields:disabled input:not([type="checkbox"]):not([type="radio"]),
  .enquiry-form .form-fields:disabled select,
  .enquiry-form .form-fields:disabled textarea {
    color: #625d55;
    background: #e8e3db;
    border-color: #9c958a;
    cursor: not-allowed;
  }
  .enquiry-form #submission-status,
  .enquiry-form .upload-note { color: var(--muted); }
  .enquiry-form .upload-note strong { color: var(--ink); }
  .enquiry-form #submission-status[data-phase="success"] { color: var(--ink); }

  /* Existing optional consultation panel; dismissal and navigation are untouched. */
  .stage-recommendation {
    background: #eee8df;
    border-left-color: var(--red);
  }
  .stage-recommendation h3 { color: var(--ink); }
  .stage-recommendation p,
  .stage-recommendation .stage-reassurance,
  .stage-recommendation .stage-continue { color: var(--muted); }
  .stage-recommendation .text-link { color: var(--red); }
  .stage-recommendation :is(a,button):focus-visible { outline-color: var(--red); }

  /* Course and consultation selectors retain their original geometry and state logic. */
  .course-card,
  .course-bundle,
  .consultation-page .consultation-card {
    color: var(--ink);
    background: #fffdf9;
    border-color: #827b71;
  }
  .course-card.selected,
  .course-bundle.selected,
  .consultation-page .consultation-card.selected,
  .consultation-page .consultation-card.selected:hover {
    color: var(--ink);
    background: #eee8df;
    border-color: var(--red);
  }
  .course-option-label,
  .course-option-name,
  .course-price,
  .consultation-page .consultation-card label.package-top[for],
  .consultation-price { color: var(--ink); }
  .course-duration,
  .course-bundle-price del,
  .course-offer-deadline,
  .consultation-duration,
  .consultation-price small { color: var(--muted); }
  .course-more,
  .course-more:visited,
  .consultation-more,
  .consultation-more:visited { color: var(--red); text-decoration-color: currentColor; }
  .course-more:focus-visible,
  .consultation-more:focus-visible { outline-color: var(--red); }
  .course-option-label .radio-mark,
  .consultation-page .consultation-card label.package-top[for] .radio-mark {
    background: transparent;
    border-color: #827b71;
  }
  .course-card.selected .course-option-label .radio-mark,
  .course-bundle.selected .course-option-label .radio-mark,
  .consultation-page .consultation-card.selected label.package-top[for] .radio-mark {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
  }
  .course-card.selected .course-option-label .radio-mark::after,
  .course-bundle.selected .course-option-label .radio-mark::after,
  .consultation-page .consultation-card.selected label.package-top[for] .radio-mark::after {
    border-color: #fff;
  }
  .course-card:has(input:focus-visible),
  .course-bundle:has(input:focus-visible),
  .consultation-page .consultation-card:has(input:focus-visible) {
    outline-color: var(--red);
  }
  .course-page .booking.has-selection,
  .consultation-page .booking.has-selection {
    color: var(--ink);
    background: #eee8df;
    border-top-color: var(--red);
    box-shadow: 0 -4px 16px rgba(25,25,25,.08);
  }
  .course-page .booking.has-selection p,
  .consultation-page .booking.has-selection p { color: var(--ink); }
  .course-page .booking.has-selection .button,
  .consultation-page .booking.has-selection .button { color: var(--red); }

  /* Photography and original cover art remain unfiltered. White photo-overlay
     text/focus stays white, rather than inheriting a low-contrast light-page color. */
  .course-hero .hero-link,
  .course-hero .hero-link:visited,
  .consultation-hero .hero-link,
  .consultation-hero .hero-link:visited,
  .course-motion,
  .consultation-motion { color: #fff; }
  .course-hero a:focus-visible,
  .course-motion:focus-visible,
  .consultation-hero a:focus-visible,
  .consultation-motion:focus-visible { outline-color: #fff; }
}

/* A longer, eased image blend follows the active page background. */
.home .hero-slide { --hero-blend-depth: clamp(180px, 26svh, 280px); }
.project-hero { --hero-blend-depth: clamp(150px, 24svh, 240px); }
.course-hero, .consultation-hero { --hero-blend-depth: clamp(150px, 24svh, 240px); }
.home .hero-slide > .hero-shade::after,
.project-hero > .hero-shade::after,
.grounds-story .project-hero > .hero-shade::after,
.course-hero > .course-hero-shade::after,
.consultation-hero > .consultation-hero-shade::after {
  content: "";
  display: block;
  position: absolute;
  inset: auto 0 0;
  height: var(--hero-blend-depth);
  background: linear-gradient(to bottom,
    transparent 0%,
    color-mix(in srgb, var(--paper) 10%, transparent) 20%,
    color-mix(in srgb, var(--paper) 35%, transparent) 45%,
    color-mix(in srgb, var(--paper) 68%, transparent) 70%,
    color-mix(in srgb, var(--paper) 92%, transparent) 90%,
    var(--paper) 100%);
  pointer-events: none;
}
/* Keep photo-overlay copy and focus outlines above the page-colour blend. */
.home .hero-slide .hero-title { bottom: calc(var(--hero-blend-depth) + 24px + env(safe-area-inset-bottom, 0px)); }
.project-hero .project-hero-title { bottom: calc(var(--hero-blend-depth) + 20px - clamp(32px, 7svh, 64px)); }
.course-hero-copy { bottom: calc(var(--hero-blend-depth) + 80px + env(safe-area-inset-bottom, 0px)); }
/* Lower the consultation title while keeping its link above the lightest fade. */
.consultation-hero-copy { bottom: calc(var(--hero-blend-depth) / 2 + 24px + env(safe-area-inset-bottom, 0px)); }
.course-motion, .consultation-motion { bottom: calc(var(--hero-blend-depth) + 12px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 850px) {
  .home .hero-slide { --hero-blend-depth: clamp(140px, 22svh, 200px); }
  .project-hero, .course-hero, .consultation-hero { --hero-blend-depth: clamp(110px, 20svh, 170px); }
  body.inner.grounds-story .project-hero { --hero-blend-depth: 96px; min-height: 360px; }
  .grounds-story .project-hero .project-hero-title { bottom: calc(var(--hero-blend-depth) + 20px - clamp(32px, 7svh, 64px)); }
}

/* Keep project names and their short concepts in one compact title group. */
.portfolio-index .project-caption h3,
.portfolio-more .project-caption h3 { min-height: 0; }
.portfolio-index .project-caption span,
.portfolio-more .project-caption span { margin-top: 6px; }
.home .work-caption h3,
.home .work-feature:first-child .work-caption h3 { min-height: 0; }
.home .work-caption .work-location { margin-top: 6px; }
