/*
============================================================
---------------- Project Views & Display Toggle -------------
============================================================
*/
.project-view-toolbar[hidden],
.project-carousel[hidden],
.project-category[hidden],
.project-directory[hidden] {
  display: none;
}
.projects-page main {
  background: #fff;
}

.projects-page .page-hero {
  min-height: 0;
  background:
    radial-gradient(ellipse at 84% 0, #20487970, transparent 58%), #0b172a;
}
.projects-page .page-hero-content {
  padding-block: 48px;
}
.projects-page .page-hero h1 {
  font-size: clamp(2.4rem, 5.3vw, 4.6rem);
  max-width: 950px;
}
.projects-page .page-hero-content > p {
  max-width: 900px;
}
.projects-page .page-hero-content > p:not(.eyebrow) {
  margin-top: 20px;
  color: #b4c6de;
  font-size: 1rem;
}

.project-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 25px 5px;
}
.project-view-toolbar .section-label {
  margin: 0 0 3px;
  color: #2563eb;
}
#project-collection-count {
  color: #64748b;
  font-size: 0.9rem;
}
.project-view-toggle {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 5px;
  background: #edf2f8;
  border: 1px solid #dce5ef;
  border-radius: 13px;
}
.project-view-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #52647a;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.project-view-toggle button[aria-pressed="true"] {
  background: #244c7c;
  color: #fff;
  box-shadow: 0 3px 8px #0b172a18;
}
.project-view-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.project-view-toggle button:focus-visible,
.project-carousel button:focus-visible,
.project-carousel-stage:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 5px;
}
.project-card-small.is-carousel-selection {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px #3b82f624;
}

/*
============================================================
---------------- Horizontal Project Wheel -------------------
============================================================
*/
.project-carousel {
  background: #fff;
  padding-top: 20px;
}
.project-carousel-stage {
  --project-card-width: min(56vw, 640px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(330px, 38vw, 485px);
  overflow: hidden;
  background: #fff;
  perspective: 1500px;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.project-carousel-stage.is-dragging,
.project-carousel-stage.is-dragging .project-wheel-card {
  cursor: grabbing;
}
.project-carousel-glow {
  position: absolute;
  width: 65%;
  height: 35px;
  bottom: 25px;
  left: 17.5%;
  border-radius: 50%;
  background: #62809f;
  filter: blur(19px);
  opacity: 0.15;
  pointer-events: none;
}
.project-carousel-track {
  position: absolute;
  inset: 0;
  /* Each photo is its own layer so tilted edges never intersect other photos. */
  transform-style: flat;
  pointer-events: none;
}
.project-wheel-card {
  position: absolute;
  visibility: hidden;
  top: 50%;
  left: 50%;
  width: var(--project-card-width);
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid #8bb6e84a;
  border-radius: 17px;
  background: #142b46;
  color: #fff;
  box-shadow: 0 15px 35px #193c651f;
  font: inherit;
  text-align: left;
  cursor: grab;
  backface-visibility: hidden;
  pointer-events: auto;
  will-change: transform;
}
.project-wheel-card[aria-current="true"] {
  border-color: #8cc4ff;
  box-shadow:
    0 20px 45px #193c6529,
    0 0 0 1px #8cc4ff30;
}
.project-wheel-image {
  position: relative;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  background: linear-gradient(130deg, #203f65, #13263f);
}
.project-wheel-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
}
.project-wheel-image img[hidden] {
  display: none;
}
.project-wheel-image.is-missing::after {
  content: "ND. / PROJECT PREVIEW";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a7c8ef;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
}
.project-wheel-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 18px 23px;
  border-top: 1px solid #ffffff12;
}
.project-wheel-caption strong {
  display: block;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  line-height: 1.3;
  letter-spacing: -0.025em;
}
.project-wheel-caption small {
  display: block;
  color: #a9c8ea;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.project-wheel-number {
  flex-shrink: 0;
  color: #aac0da;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/*
============================================================
---------------- Navigation & Selected Project --------------
============================================================
*/
.project-carousel-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding-block: 22px;
  color: #64748b;
  font-size: 0.8rem;
}
#project-carousel-hint span {
  margin-left: 7px;
  color: #2563eb;
}
.project-carousel-key-hint {
  text-align: right;
}
.project-carousel-stepper {
  display: flex;
  gap: 22px;
  align-items: center;
}
.project-carousel-stepper button {
  width: 44px;
  height: 44px;
  border: 1px solid #6684a65c;
  border-radius: 50%;
  background: #f1f5fa;
  color: #173e6a;
  font: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  transition:
    background 150ms,
    border-color 150ms;
}
.project-carousel-stepper button:hover {
  background: #e2edfb;
  border-color: #7fa9df;
}
.project-carousel-stepper button:disabled {
  opacity: 0.4;
  cursor: default;
}
#project-carousel-position {
  min-width: 64px;
  color: #193c65;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 750;
}
.project-details-section {
  background: #eef2f7;
  border-top: 1px solid #d9e3ef;
  padding-block: 48px 70px;
}
.project-spotlight {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 90px);
}
.project-spotlight-main {
  min-width: 0;
}
.project-spotlight-category {
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.project-spotlight h2 {
  color: #0b172a;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 17px;
}
#project-spotlight-description {
  line-height: 1.8;
  color: #52647a;
}
#project-spotlight-link {
  margin-top: 24px;
  gap: 18px;
}
.project-spotlight-build {
  align-self: start;
  padding: 25px 28px;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #fff;
}
.project-spotlight-build .section-label {
  margin-bottom: 12px;
}
#project-spotlight-build {
  color: #52647a;
  font-size: 0.94rem;
}
.project-spotlight .tag-list {
  margin-block: 20px 0;
}
.project-spotlight .tag-list li {
  background: #fff;
  border: 1px solid #dce5ef;
}

@media (max-width: 700px) {
  .projects-page .page-hero-content {
    padding-block: 32px;
  }
  .project-view-toolbar {
    padding-block: 20px 0;
    gap: 12px;
  }
  .project-view-toolbar .section-label {
    font-size: 0.64rem;
  }
  #project-collection-count {
    font-size: 0.76rem;
  }
  .project-view-toggle button {
    padding: 8px 10px;
    gap: 5px;
    font-size: 0.78rem;
  }
  .project-view-toggle svg {
    width: 15px;
    height: 15px;
  }
  .project-carousel-stage {
    --project-card-width: 76vw;
    height: clamp(255px, 65vw, 390px);
    perspective: 900px;
  }
  .project-wheel-card {
    border-radius: 12px;
  }
  .project-wheel-caption {
    min-height: 72px;
    padding: 12px 15px;
    gap: 10px;
  }
  .project-wheel-caption strong {
    font-size: 0.98rem;
  }
  .project-wheel-caption small {
    font-size: 0.57rem;
    letter-spacing: 0.07em;
  }
  .project-wheel-number {
    font-size: 0.67rem;
  }
  .project-carousel-navigation {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding-block: 18px;
  }
  .project-carousel-key-hint {
    display: none;
  }
  .project-carousel-stepper {
    gap: 12px;
  }
  .project-spotlight {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .project-details-section {
    padding-block: 32px 48px;
  }
  .project-spotlight-build {
    padding: 22px;
  }
}
@media (max-width: 380px) {
  .project-view-toolbar {
    align-items: start;
    flex-direction: column;
  }
  .project-view-toggle {
    align-self: flex-end;
  }
  .project-carousel-navigation {
    font-size: 0.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-wheel-card {
    will-change: auto;
  }
  .project-view-toggle button,
  .project-carousel-stepper button {
    transition: none;
  }
}

/*
============================================================
---------------- Search & Surprise Project Tools ------------
============================================================
*/
.project-discovery-tools[hidden],
.project-search-popover[hidden],
#project-search-clear[hidden] {
  display: none;
}
.project-discovery-tools {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding-block: 14px 4px;
}
.project-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 540px;
}
.project-search > label {
  display: block;
  margin-bottom: 7px;
  color: #52647a;
  font-size: 0.76rem;
  font-weight: 700;
}
.project-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 14px 8px;
  min-height: 46px;
  background: #f8fafc;
  border: 1px solid #dce5ef;
  border-radius: 11px;
  transition:
    border-color 180ms,
    box-shadow 180ms;
}
.project-search-field:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px #3b82f61a;
}
.project-search-field svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  stroke: #64748b;
  stroke-width: 1.7;
  fill: none;
}
#project-search-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #193c65;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
#project-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
#project-search-clear {
  flex: 0 0 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: #e9eff7;
  color: #193c65;
  font-size: 1.2rem;
  cursor: pointer;
}
.project-search-popover {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 40px #102a4826;
  transform-origin: top center;
  animation: project-search-arrival 180ms ease-out;
}
#project-search-summary {
  padding: 12px 15px;
  color: #64748b;
  font-size: 0.75rem;
  border-bottom: 1px solid #edf2f8;
}
#project-search-results {
  max-height: min(320px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
}
#project-search-results button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #193c65;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 150ms;
}
#project-search-results button:hover,
#project-search-results button[aria-selected="true"] {
  background: #edf4ff;
}
#project-search-results strong,
#project-search-results span {
  display: block;
}
#project-search-results strong {
  font-size: 0.86rem;
}
#project-search-results span {
  margin-top: 2px;
  font-size: 0.71rem;
  color: #64748b;
}
.project-surprise-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid #ccd9eb;
  border-radius: 11px;
  background: #edf4ff;
  color: #244c7c;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
}
.project-surprise-button:hover {
  background: #e1edff;
}
.project-surprise-button svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}
.project-surprise-button.is-spinning svg {
  animation: project-surprise-pulse 900ms ease-in-out infinite alternate;
}
.project-discovery-status {
  flex-basis: 100%;
  color: #52647a;
  font-size: 0.76rem;
}
.project-discovery-status:empty {
  display: none;
}
.project-view-toggle.has-selection-indicator button[aria-pressed="true"] {
  background: transparent;
  box-shadow: none;
}
.project-view-toggle.has-selection-indicator button {
  transition: color 180ms ease;
  translate: none;
  scale: 1;
}
@keyframes project-search-arrival {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes project-surprise-pulse {
  to {
    opacity: 0.5;
    transform: rotate(-12deg);
  }
}
@media (max-width: 700px) {
  .project-search {
    max-width: none;
    flex-basis: 100%;
  }
  .project-surprise-button {
    min-height: 44px;
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-search-popover,
  .project-surprise-button.is-spinning svg {
    animation: none;
  }
  .project-search-field,
  #project-search-results button,
  .project-view-toggle.has-selection-indicator button {
    transition: none;
  }
}
