:root {
  --project-ink: #183234;
  --project-muted: #627575;
  --project-teal: #2a7778;
  --project-coral: #c86f50;
  --project-line: rgba(38, 87, 88, 0.16);
  --project-paper: rgba(255, 253, 248, 0.76);
}

main {
  position: relative;
  z-index: 1;
}

.projects-hero,
.project-library,
.project-note {
  width: min(calc(100% - 4rem), 1500px);
  margin-inline: auto;
}

.projects-hero {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(120px, .55fr) minmax(430px, 1.55fr) minmax(330px, .9fr);
  gap: clamp(2rem, 4vw, 5rem);
  align-items: center;
  padding: clamp(5rem, 9vw, 9rem) 0 6rem;
  position: relative;
}

.projects-hero::before {
  content: "";
  position: absolute;
  inset: 3rem -2rem;
  z-index: -1;
  border: 1px solid rgba(42, 119, 120, .09);
  border-radius: 2rem;
  background:
    linear-gradient(rgba(42,119,120,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,119,120,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.build-now-rail {
  display: grid;
  gap: 0;
  border-block: 1px solid var(--project-line);
}

.rail-label {
  padding: .9rem 0;
  color: var(--project-coral);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.rail-item {
  padding: 1.15rem 0;
  border-top: 1px solid var(--project-line);
  display: grid;
  gap: .15rem;
}

.rail-item strong {
  font-family: "Cormorant Garamond", serif;
  color: var(--project-teal);
  font-size: 1.65rem;
  line-height: 1;
}

.rail-item span {
  color: var(--project-muted);
  font-size: .74rem;
}

.eyebrow {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--project-coral);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 2rem;
  height: 1px;
  background: currentColor;
}

.projects-intro h1 {
  max-width: 820px;
  margin: 0;
  color: var(--project-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 7.2vw, 7.8rem);
  font-weight: 600;
  line-height: .83;
  letter-spacing: -.055em;
}

.projects-intro h1 em {
  display: block;
  color: var(--project-teal);
  font-weight: 600;
}

.hero-copy {
  max-width: 680px;
  margin: 2rem 0 0;
  color: var(--project-muted);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.8;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.primary-action {
  padding: .92rem 1.25rem;
  border-radius: 999px;
  background: var(--project-ink);
  color: #fffdf8;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .25s ease, background .25s ease;
}

.primary-action:hover {
  transform: translateY(-3px);
  background: var(--project-teal);
}

.text-action {
  color: var(--project-ink);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.text-action span {
  display: inline-block;
  transition: transform .25s ease;
}

.text-action:hover span {
  transform: translate(3px, -3px);
}

.build-dashboard {
  padding: 1.4rem;
  border: 1px solid var(--project-line);
  border-radius: 1.5rem;
  background: var(--project-paper);
  box-shadow: 0 26px 70px rgba(34, 66, 62, .1);
  backdrop-filter: blur(18px);
  transform: rotate(1deg);
}

.dashboard-heading,
.current-build,
.build-stats {
  display: flex;
  align-items: center;
}

.dashboard-heading {
  justify-content: space-between;
  padding-bottom: 1.2rem;
}

.dashboard-kicker {
  color: var(--project-coral);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.dashboard-heading h2 {
  margin: .2rem 0 0;
  color: var(--project-ink);
  font-size: 1.05rem;
}

.pulse-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #67b88c;
  box-shadow: 0 0 0 7px rgba(103,184,140,.14);
  animation: projectPulse 2.2s ease-in-out infinite;
}

.current-build {
  gap: .8rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--project-line);
  color: var(--project-ink);
  text-decoration: none;
}

.current-build > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: .2rem;
  flex: 1;
}

.current-build strong {
  font-size: .88rem;
}

.current-build small {
  color: var(--project-muted);
  font-size: .72rem;
}

.build-number {
  color: var(--project-coral);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
}

.build-arrow {
  transition: transform .25s ease;
}

a.current-build:hover .build-arrow {
  transform: translate(3px, -3px);
}

.status-chip {
  padding: .32rem .55rem;
  border-radius: 999px;
  background: rgba(42,119,120,.1);
  color: var(--project-teal);
  font-size: .62rem;
  font-weight: 700;
}

.build-stats {
  gap: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--project-line);
}

.build-stats div {
  display: grid;
  gap: .1rem;
  flex: 1;
}

.build-stats strong {
  color: var(--project-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
}

.build-stats span {
  color: var(--project-muted);
  font-size: .68rem;
}

.project-library {
  padding: clamp(5rem, 8vw, 8rem) 0;
  border-top: 1px solid var(--project-line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
}

.section-heading h2,
.project-note h2 {
  margin: 0;
  color: var(--project-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  line-height: .95;
  letter-spacing: -.035em;
}

.section-heading > p {
  color: var(--project-muted);
  font-size: .83rem;
}

.section-heading > p span {
  color: var(--project-teal);
  font-weight: 700;
}

.project-toolbar {
  margin: 2.5rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.search-field {
  width: min(100%, 390px);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .78rem 1rem;
  border: 1px solid var(--project-line);
  border-radius: 999px;
  background: rgba(255,255,255,.52);
}

.search-field:focus-within {
  border-color: var(--project-teal);
  box-shadow: 0 0 0 3px rgba(42,119,120,.1);
}

.search-field svg {
  width: 1.1rem;
  fill: none;
  stroke: var(--project-teal);
  stroke-width: 1.7;
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--project-ink);
  font: inherit;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.filter-btn {
  padding: .7rem .95rem;
  border: 1px solid var(--project-line);
  border-radius: 999px;
  background: rgba(255,255,255,.38);
  color: var(--project-muted);
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.filter-btn:hover {
  color: var(--project-teal);
  transform: translateY(-2px);
}

.filter-btn.active {
  border-color: var(--project-ink);
  background: var(--project-ink);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--project-line);
  border-radius: 1.35rem;
  background: rgba(255,253,248,.66);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(42,119,120,.34);
  box-shadow: 0 24px 60px rgba(34,66,62,.12);
}

.project-image-wrap {
  aspect-ratio: 16 / 10;
  margin: .55rem;
  overflow: hidden;
  position: relative;
  border-radius: 1rem;
  background: #dce9e4;
}

.project-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24,50,52,.42), transparent 50%);
  pointer-events: none;
}

.project-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.75,.25,1);
}

.project-card:hover .project-image {
  transform: scale(1.055);
}

.project-index,
.project-status {
  position: absolute;
  z-index: 1;
  top: .8rem;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.project-index {
  left: .8rem;
  padding: .35rem .55rem;
  background: rgba(255,253,248,.82);
  color: var(--project-ink);
  font-size: .65rem;
  font-weight: 700;
}

.project-status {
  right: .8rem;
  padding: .35rem .6rem;
  background: rgba(24,50,52,.78);
  color: white;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.project-content {
  padding: .9rem 1.2rem 1.3rem;
}

.project-category {
  margin: 0 0 .55rem;
  color: var(--project-coral);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.project-title {
  margin: 0;
  color: var(--project-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  line-height: 1;
}

.project-description {
  min-height: 4.8em;
  margin: .8rem 0 1rem;
  color: var(--project-muted);
  font-size: .84rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.15rem;
}

.project-tag {
  padding: .28rem .5rem;
  border-radius: 999px;
  background: rgba(42,119,120,.08);
  color: var(--project-teal);
  font-size: .62rem;
  font-weight: 700;
}

.project-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .9rem;
  border-top: 1px solid var(--project-line);
  color: var(--project-ink);
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

.project-link svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform .25s ease;
}

.project-link:hover svg {
  transform: translate(3px, -3px);
}

.empty-state {
  padding: 3rem;
  border: 1px dashed var(--project-line);
  border-radius: 1rem;
  color: var(--project-muted);
  text-align: center;
}

.project-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(5rem, 9vw, 9rem);
  padding: clamp(2rem, 4vw, 4rem);
  border: 1px solid var(--project-line);
  border-radius: 1.75rem;
  background: linear-gradient(135deg, rgba(42,119,120,.1), rgba(255,253,248,.65));
}

.note-index {
  align-self: start;
  color: var(--project-coral);
  font: 600 1.3rem "Cormorant Garamond", serif;
}

.project-note p:not(.eyebrow) {
  max-width: 680px;
  margin: 1rem 0 0;
  color: var(--project-muted);
  line-height: 1.7;
}

.project-note > a {
  color: var(--project-ink);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes projectPulse {
  50% { box-shadow: 0 0 0 12px rgba(103,184,140,0); }
}

@media (max-width: 1100px) {
  .projects-hero {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .build-dashboard {
    grid-column: 2;
    transform: none;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .projects-hero,
  .project-library,
  .project-note {
    width: min(calc(100% - 2rem), 1500px);
  }

  .projects-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3.5rem 0 4rem;
  }

  .projects-hero::before {
    inset: 1rem -.5rem;
  }

  .build-now-rail {
    grid-template-columns: repeat(4, 1fr);
    order: 2;
    border: 1px solid var(--project-line);
    border-radius: 1rem;
    overflow: hidden;
  }

  .rail-label {
    display: none;
  }

  .rail-item {
    padding: .8rem .5rem;
    border: 0;
    border-left: 1px solid var(--project-line);
    text-align: center;
  }

  .rail-item:first-of-type {
    border-left: 0;
  }

  .rail-item strong {
    font-size: 1.3rem;
  }

  .projects-intro {
    order: 1;
  }

  .projects-intro h1 {
    font-size: clamp(3.7rem, 16vw, 6rem);
  }

  .build-dashboard {
    grid-column: auto;
    order: 3;
  }

  .section-heading,
  .project-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .project-filters {
    justify-content: flex-start;
  }

  .search-field {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-description {
    min-height: 0;
  }

  .project-note {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 430px) {
  .build-now-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .rail-item:nth-of-type(3) {
    border-left: 0;
    border-top: 1px solid var(--project-line);
  }

  .rail-item:nth-of-type(4) {
    border-top: 1px solid var(--project-line);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot {
    animation: none;
  }

  .project-card,
  .project-image,
  .primary-action,
  .filter-btn {
    transition: none;
  }
}
