:root {
  --ink: #172126;
  --slate: #243239;
  --slate-deep: #111b20;
  --slate-soft: #526169;
  --ivory: #f4f0e7;
  --paper: #fbfaf6;
  --limestone: #ded7c9;
  --stone: #b8ad9d;
  --walnut: #765b44;
  --bronze: #9b7a55;
  --red: #b91e3b;
  --red-dark: #8c1730;
  --red-soft: #f4e5e8;
  --white: #fff;
  --line: rgba(23, 33, 38, 0.16);
  --line-light: rgba(255, 255, 255, 0.2);
  --shadow: 0 28px 80px rgba(17, 27, 32, 0.16);
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", Inter, Arial, sans-serif;
  --rail: 92px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  margin: 0;
  min-width: 320px;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link {
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  left: 16px;
  padding: 12px 18px;
  position: fixed;
  top: -80px;
  transition: top 180ms ease;
  z-index: 2000;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 3px solid #d5a000;
  outline-offset: 4px;
}

.primary-button,
.text-action,
.shelf-heading button,
.message-form button,
.detail-action,
.folder-open {
  align-items: center;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 46px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-button {
  background: var(--red);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px 22px;
  text-transform: uppercase;
}

.primary-button:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
}

.primary-button.light {
  background: var(--paper);
  color: var(--ink);
}

.primary-button.light:hover {
  background: var(--white);
}

/* Login */
.login-screen {
  background: var(--slate-deep);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  min-height: 100vh;
}

.portal-ready .login-screen {
  display: none;
}

.login-atmosphere {
  align-items: flex-end;
  background:
    radial-gradient(circle at 30% 18%, rgba(184, 154, 112, 0.18), transparent 32%),
    linear-gradient(145deg, #26363d, #111b20 72%);
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  min-height: 100%;
  overflow: hidden;
  padding: clamp(30px, 6vw, 90px);
  position: relative;
}

.login-atmosphere::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  position: absolute;
}

.login-atmosphere svg {
  inset: 6% 7% 14%;
  opacity: 0.42;
  position: absolute;
}

.login-atmosphere path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.login-atmosphere span {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 4.3vw, 5.4rem);
  line-height: 0.96;
  max-width: 680px;
  position: relative;
}

.login-card {
  align-self: center;
  background: var(--paper);
  margin: clamp(18px, 4vw, 60px);
  padding: clamp(30px, 5vw, 68px);
}

.login-card > img {
  height: 58px;
  margin-bottom: 38px;
  object-fit: contain;
  object-position: left;
  width: 210px;
}

.login-kicker,
.section-kicker,
.portal-header-label,
.hero-kicker,
.shelf-heading > span {
  color: var(--red);
  display: block;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-card h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  margin: 13px 0 18px;
}

.login-card > p {
  color: var(--slate-soft);
  line-height: 1.65;
  margin: 0 0 32px;
  max-width: 540px;
}

.login-tabs {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.login-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 68px;
  padding: 9px 4px 12px;
}

.login-tab span {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  font-size: 0.7rem;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.login-tab strong {
  font-size: 0.72rem;
}

.login-tab.active {
  border-bottom-color: var(--red);
  color: var(--red);
}

.login-panel {
  display: grid;
  gap: 12px;
}

.login-panel label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel input,
.message-form textarea,
.change-order-form textarea,
.change-order-form input {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  min-height: 50px;
  padding: 13px 15px;
  width: 100%;
}

.login-panel .primary-button {
  width: 100%;
}

.panel-note,
.helper-link,
.login-message {
  color: var(--slate-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.helper-link {
  justify-self: start;
}

.login-message {
  min-height: 24px;
  padding-top: 12px;
}

/* Application shell */
.portal-shell {
  display: none;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.portal-ready .portal-shell {
  display: grid;
}

.nav-rail {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--slate-deep);
  background-size: 100% 22px;
  color: var(--white);
  display: grid;
  grid-row: 1 / 3;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  left: 0;
  padding: 17px 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.rail-brand,
.rail-logout,
.portal-nav button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.67);
  cursor: pointer;
}

.rail-brand {
  height: 62px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.rail-brand img {
  height: 54px;
  object-fit: cover;
  opacity: 0.95;
  width: 100%;
}

.rail-brand span {
  display: none;
}

.portal-nav {
  align-content: center;
  display: grid;
  gap: 5px;
}

.portal-nav button,
.rail-logout {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  min-height: 68px;
  padding: 8px 3px;
  position: relative;
  width: 100%;
}

.portal-nav button::before {
  background: transparent;
  content: "";
  height: 34px;
  left: -10px;
  position: absolute;
  transition: background 180ms ease;
  width: 2px;
}

.portal-nav button:hover,
.portal-nav button.active,
.rail-logout:hover {
  color: var(--white);
}

.portal-nav button.active::before {
  background: var(--red);
}

.portal-nav svg,
.rail-logout svg,
.mobile-nav svg,
.mobile-more-button svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
  width: 22px;
}

.portal-nav span,
.rail-logout span {
  font-size: 0.59rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.portal-header {
  align-items: center;
  background: rgba(244, 240, 231, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  grid-column: 2;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px clamp(22px, 4vw, 68px);
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  z-index: 40;
}

.portal-header > div {
  display: flex;
  gap: 16px;
}

.portal-header strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
}

.mobile-more-button,
.mobile-nav,
.mobile-more-menu {
  display: none;
}

.portal-main {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  padding: clamp(18px, 3.4vw, 56px);
}

.portal-main > section,
.portal-footer {
  margin-left: auto;
  margin-right: auto;
  max-width: 1540px;
}

/* Project arrival */
.project-hero {
  color: var(--white);
  display: grid;
  grid-template-areas: "hero";
  min-height: clamp(620px, 76vh, 920px);
  overflow: hidden;
  position: relative;
}

.hero-media,
.hero-story {
  grid-area: hero;
}

.hero-media {
  background: var(--slate);
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

.hero-slides,
.hero-slide,
.hero-fallback,
.hero-shade {
  inset: 0;
  position: absolute;
}

.hero-slide {
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 900ms ease, transform 8s ease;
  width: 100%;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-fallback {
  background:
    radial-gradient(circle at 78% 28%, rgba(203, 179, 142, 0.25), transparent 28%),
    linear-gradient(135deg, #46585f, #17252b 72%);
}

.hero-fallback::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  inset: 0;
  position: absolute;
}

.hero-fallback svg {
  height: 88%;
  left: 10%;
  opacity: 0.32;
  position: absolute;
  top: 4%;
  width: 82%;
}

.hero-fallback path,
.buildview-visual path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(9, 18, 22, 0.93) 0%, rgba(9, 18, 22, 0.62) 43%, rgba(9, 18, 22, 0.08) 78%),
    linear-gradient(0deg, rgba(9, 18, 22, 0.55), transparent 44%);
}

.hero-story {
  align-content: end;
  display: grid;
  max-width: 760px;
  padding: clamp(34px, 6vw, 100px);
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.hero-kicker {
  color: #e0b6a8;
}

.hero-story h1 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 6.3vw, 7.8rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.91;
  margin: 18px 0 12px;
  max-width: 880px;
}

.hero-address {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  margin: 0 0 clamp(24px, 4vw, 48px);
}

.hero-phase {
  border-left: 2px solid var(--red);
  display: grid;
  gap: 5px;
  margin-bottom: 26px;
  padding-left: 18px;
}

.hero-phase span,
.hero-progress span,
.hero-dates dt,
.status-ribbon span,
.section-stat,
.artifact-meta,
.message-meta {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-phase strong {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.6vw, 2.8rem);
  font-weight: 400;
}

.hero-phase p {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

.hero-progress {
  max-width: 540px;
}

.hero-progress > div:first-child {
  display: flex;
  justify-content: space-between;
}

.hero-progress strong {
  font-size: 0.76rem;
}

.progress-track {
  background: rgba(255, 255, 255, 0.23);
  height: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-track i {
  background: var(--red);
  display: block;
  height: 100%;
  transition: width 900ms cubic-bezier(.22,.8,.25,1);
  width: 0;
}

.hero-dates {
  display: flex;
  gap: 42px;
  margin: 28px 0 0;
}

.hero-dates div {
  display: grid;
  gap: 6px;
}

.hero-dates dd {
  font-size: 0.88rem;
  margin: 0;
}

.hero-controls {
  align-items: center;
  bottom: 26px;
  display: flex;
  gap: 12px;
  pointer-events: auto;
  position: absolute;
  right: 28px;
  z-index: 4;
}

.hero-controls > button,
.hero-dots button {
  background: rgba(17, 27, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  cursor: pointer;
  height: 42px;
  width: 42px;
}

.hero-dots {
  display: flex;
  gap: 7px;
}

.hero-dots button {
  background: rgba(255, 255, 255, 0.45);
  border: 0;
  height: 3px;
  min-width: 26px;
  padding: 0;
  width: 26px;
}

.hero-dots button.active {
  background: var(--white);
}

/* Status ribbon */
.status-ribbon {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr 1.15fr .75fr .9fr;
  margin-bottom: clamp(80px, 10vw, 150px);
}

.status-ribbon > div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 24px clamp(13px, 1.8vw, 28px);
  position: relative;
}

.status-ribbon > div:not(:last-child)::after {
  background: var(--line);
  content: "";
  height: 50%;
  position: absolute;
  right: 0;
  top: 25%;
  width: 1px;
}

.status-ribbon span {
  color: var(--slate-soft);
}

.status-ribbon strong {
  align-self: end;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.45vw, 1.5rem);
  font-weight: 400;
}

/* Shared editorial sections */
.story-section {
  margin-bottom: clamp(100px, 12vw, 180px);
  scroll-margin-top: 100px;
}

.section-intro {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  margin-bottom: clamp(38px, 5vw, 72px);
  padding-top: 24px;
}

.section-number {
  color: var(--red);
  font-family: var(--serif);
  font-size: 1.1rem;
}

.section-intro h2,
.buildview-copy h2,
.studio-section h2,
.detail-header h2,
.detail-hero h3 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5.2vw, 6rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin: 10px 0 12px;
}

.section-intro p,
.buildview-copy > p,
.studio-section p {
  color: var(--slate-soft);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  margin: 0;
}

.section-stat {
  color: var(--slate-soft);
  padding-bottom: 8px;
}

.text-action,
.shelf-heading button {
  align-self: end;
  background: transparent;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 38px;
  padding: 0;
  text-transform: uppercase;
}

/* Build Journey */
.journey-line {
  counter-reset: journey;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.journey-line::before,
.journey-line::after {
  content: "";
  height: 1px;
  left: 5%;
  position: absolute;
  right: 5%;
  top: 33px;
}

.journey-line::before {
  background: var(--line);
}

.journey-line::after {
  background: var(--bronze);
  right: auto;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s ease;
  width: var(--journey-progress, 0%);
}

.journey-line.revealed::after {
  transform: scaleX(1);
}

.journey-step {
  counter-increment: journey;
  display: grid;
  gap: 18px;
  justify-items: center;
  min-width: 0;
  padding: 0 7px;
  position: relative;
  text-align: center;
  z-index: 2;
}

.journey-marker {
  align-items: center;
  background: var(--ivory);
  border: 1px solid var(--stone);
  border-radius: 50%;
  color: var(--slate-soft);
  display: flex;
  font-family: var(--serif);
  font-size: 0.9rem;
  height: 66px;
  justify-content: center;
  width: 66px;
}

.journey-step.complete .journey-marker {
  background: var(--slate-deep);
  border-color: var(--slate-deep);
  color: var(--white);
}

.journey-step.current .journey-marker {
  background: var(--red);
  border: 8px solid var(--red-soft);
  color: var(--white);
  height: 78px;
  margin-top: -6px;
  width: 78px;
}

.journey-step.current .journey-marker::after {
  border: 1px solid rgba(185, 30, 59, 0.38);
  border-radius: 50%;
  content: "";
  height: 90px;
  position: absolute;
  top: -12px;
  width: 90px;
}

.journey-copy {
  display: grid;
  gap: 6px;
}

.journey-copy strong {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.2vw, 1.18rem);
  font-weight: 400;
  line-height: 1.15;
}

.journey-copy span {
  color: var(--slate-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Photography */
.photos-editorial {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.65fr 0.75fr;
  min-height: 620px;
}

.photo-feature,
.photo-secondary {
  background: var(--slate);
  border: 0;
  cursor: pointer;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.photo-feature img,
.photo-secondary img,
.folder-photo img {
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease;
  width: 100%;
}

.photo-feature:hover img,
.photo-secondary:hover img {
  transform: scale(1.025);
}

.photo-feature span,
.photo-secondary span {
  background: rgba(17, 27, 32, 0.78);
  bottom: 0;
  color: var(--white);
  font-size: 0.7rem;
  left: 0;
  letter-spacing: 0.08em;
  padding: 12px 15px;
  position: absolute;
  text-transform: uppercase;
}

.photo-secondary-grid {
  display: grid;
  gap: 14px;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.architectural-empty {
  align-items: center;
  background:
    linear-gradient(rgba(23, 33, 38, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 38, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  border: 1px solid var(--line);
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  min-height: 420px;
  padding: 45px;
  text-align: center;
}

.architectural-empty svg {
  height: 150px;
  margin-bottom: 30px;
  width: 260px;
}

.architectural-empty path {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1.2;
}

.architectural-empty strong {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
}

.architectural-empty p {
  color: var(--slate-soft);
  line-height: 1.6;
  max-width: 500px;
}

/* Document library */
.document-shelf {
  display: grid;
  gap: clamp(30px, 5vw, 80px);
  grid-template-columns: 1fr 1fr;
}

.document-shelf > section {
  border-top: 5px solid var(--slate-deep);
}

.document-shelf > section:last-child {
  border-top-color: var(--bronze);
}

.shelf-heading {
  align-items: end;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 25px 0;
}

.shelf-heading > span {
  grid-column: 1 / -1;
}

.shelf-heading h3 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.3vw, 3.7rem);
  font-weight: 400;
  margin: 7px 0 0;
}

.artifact-list {
  border-top: 1px solid var(--line);
}

.artifact-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  min-height: 112px;
  padding: 18px 0;
}

.artifact-icon {
  align-items: center;
  background: var(--slate-deep);
  color: var(--white);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  height: 72px;
  justify-content: center;
  letter-spacing: 0.08em;
  position: relative;
  width: 54px;
}

.artifact-icon::after {
  border-left: 11px solid transparent;
  border-top: 11px solid var(--ivory);
  content: "";
  position: absolute;
  right: 0;
  top: 0;
}

.artifact-item > div:nth-child(2) {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.artifact-item strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.artifact-meta {
  color: var(--slate-soft);
}

.artifact-item a {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  min-height: 44px;
  padding: 13px 3px;
  text-transform: uppercase;
}

.artifact-empty {
  color: var(--slate-soft);
  line-height: 1.6;
  padding: 32px 0;
}

/* BuildView */
.buildview-section {
  background: var(--slate-deep);
  color: var(--white);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  margin-bottom: clamp(100px, 12vw, 180px);
  min-height: 590px;
  overflow: hidden;
  scroll-margin-top: 100px;
}

.buildview-visual {
  align-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 60% 34%, rgba(155, 122, 85, 0.28), transparent 38%);
  background-size: 42px 42px, 42px 42px, auto;
  display: flex;
  justify-content: center;
  min-height: 440px;
  overflow: hidden;
  position: relative;
}

.buildview-visual svg {
  opacity: 0.28;
  position: absolute;
  width: 86%;
}

.camera-frame {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  height: 140px;
  justify-content: center;
  position: relative;
  width: 210px;
  z-index: 2;
}

.camera-frame::before,
.camera-frame::after {
  background: var(--red);
  content: "";
  height: 24px;
  position: absolute;
  top: 57px;
  width: 2px;
}

.camera-frame::before { left: -1px; }
.camera-frame::after { right: -1px; }

.camera-frame span {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  height: 58px;
  width: 58px;
}

.camera-frame i {
  background: var(--red);
  border-radius: 50%;
  height: 7px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 7px;
}

.buildview-copy {
  align-content: center;
  display: grid;
  padding: clamp(42px, 6vw, 88px);
}

.buildview-copy h2 {
  color: var(--white);
}

.buildview-copy > p,
.buildview-copy small {
  color: rgba(255, 255, 255, 0.68);
}

.buildview-preview-status {
  border-left: 1px solid var(--bronze);
  line-height: 1.55;
  margin: 30px 0;
  min-height: 48px;
  padding: 12px 0 12px 18px;
}

.buildview-copy .primary-button {
  justify-self: start;
  margin-bottom: 16px;
}

/* Team */
.team-layout {
  background: var(--paper);
  display: grid;
  grid-template-columns: .72fr 1.28fr;
}

.contact-story {
  background: var(--slate);
  color: var(--white);
  display: grid;
  padding: clamp(38px, 5vw, 78px);
}

.contact-monogram {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  display: flex;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.contact-story h3,
.message-studio h3 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 3.7rem);
  font-weight: 400;
  line-height: 1;
  margin: 70px 0 16px;
}

.contact-story p {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
  max-width: 420px;
}

.contact-story a {
  align-self: end;
  color: var(--white);
  font-size: 0.86rem;
  margin-top: 40px;
  overflow-wrap: anywhere;
}

.message-studio {
  padding: clamp(38px, 5vw, 78px);
}

.message-studio h3 {
  margin-top: 0;
}

.message-form {
  display: grid;
  gap: 10px;
}

.message-form label,
.change-order-form label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.message-form textarea {
  min-height: 126px;
  resize: vertical;
}

.message-form-actions {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-height: 48px;
}

.message-form-actions span {
  color: var(--slate-soft);
  font-size: 0.8rem;
}

.message-form button,
.change-order-form button {
  background: var(--red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 13px 22px;
  text-transform: uppercase;
}

.message-history-head {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 38px;
  padding-top: 22px;
}

.message-history-head button {
  background: transparent;
  border: 0;
  color: var(--red);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.message-preview {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.message-preview-item,
.message-item {
  border-left: 2px solid var(--limestone);
  display: grid;
  gap: 6px;
  padding: 4px 0 4px 16px;
}

.message-preview-item p,
.message-item p {
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}

.message-meta {
  color: var(--slate-soft);
}

/* HomeStyle Studio */
.studio-section {
  align-items: center;
  background: #e4ddd0;
  display: grid;
  gap: clamp(45px, 8vw, 130px);
  grid-template-columns: 1fr 1fr;
  margin-bottom: 90px;
  min-height: 570px;
  padding: clamp(40px, 7vw, 110px);
  scroll-margin-top: 100px;
}

.studio-samples {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.25fr .75fr;
  grid-template-rows: 1fr 1fr;
  height: 360px;
  transform: rotate(-2deg);
}

.studio-samples span {
  box-shadow: 0 20px 50px rgba(48, 39, 30, 0.13);
}

.studio-samples span:nth-child(1) { background: linear-gradient(135deg, #8c6e52, #5a4331); grid-row: 1 / 3; }
.studio-samples span:nth-child(2) { background: repeating-linear-gradient(90deg, #f2eee5 0 12px, #d9d2c5 12px 13px); }
.studio-samples span:nth-child(3) { background: radial-gradient(circle at 25% 20%, #aeb9b4, #53635e); }
.studio-samples span:nth-child(4) { background: linear-gradient(45deg, #272523 50%, #b28f68 50%); display: none; }

.studio-section strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 400;
  margin: 0 0 18px;
}

.selection-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.selection-preview span {
  border: 1px solid rgba(23, 33, 38, 0.24);
  font-size: 0.7rem;
  padding: 10px 12px;
}

.portal-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--slate-soft);
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  padding: 28px 0 4px;
}

.portal-footer span {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
}

/* Dialogs and detailed views */
.detail-dialog,
.photo-lightbox {
  align-items: center;
  background: rgba(9, 18, 22, 0.82);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 1000;
}

.detail-panel {
  background: var(--paper);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 48px);
  max-width: 1280px;
  overflow: auto;
  width: min(1280px, 96vw);
}

.detail-header {
  align-items: center;
  background: var(--slate-deep);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  padding: 26px clamp(24px, 4vw, 58px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.detail-header span {
  color: #d8b08c;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.detail-header h2 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  margin: 6px 0 0;
}

.detail-header button,
.photo-lightbox-close,
.photo-lightbox-nav {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  cursor: pointer;
  min-height: 44px;
  padding: 10px 16px;
}

.detail-body {
  min-height: 340px;
  padding: clamp(28px, 5vw, 72px);
}

.detail-hero {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 15px;
  margin-bottom: 36px;
  padding-bottom: 28px;
}

.detail-hero h3 {
  font-size: clamp(2rem, 4vw, 4.5rem);
  margin: 0;
}

.detail-hero p {
  color: var(--slate-soft);
  line-height: 1.65;
  margin: 0;
  max-width: 740px;
}

.detail-list,
.folder-grid,
.message-feed {
  display: grid;
  gap: 14px;
}

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

.folder-item {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  min-height: 104px;
  padding: 18px;
}

.folder-item strong,
.folder-item span {
  overflow-wrap: anywhere;
}

.folder-item > div:nth-child(2) {
  display: grid;
  gap: 5px;
}

.folder-item > div:nth-child(2) span {
  color: var(--slate-soft);
  font-size: 0.75rem;
}

.folder-open,
.detail-action {
  background: var(--slate-deep);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 17px;
  text-transform: uppercase;
}

.folder-open.disabled {
  opacity: 0.5;
}

.file-icon {
  align-items: center;
  background: var(--slate-deep);
  color: var(--white);
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  height: 60px;
  justify-content: center;
  width: 44px;
}

.folder-photo {
  background: var(--slate);
  border: 0;
  cursor: pointer;
  min-height: 260px;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.folder-photo span {
  background: rgba(17, 27, 32, 0.82);
  bottom: 0;
  color: var(--white);
  left: 0;
  padding: 12px 15px;
  position: absolute;
  right: 0;
  text-align: left;
}

.change-order-request {
  background: #e5ded2;
  display: grid;
  gap: 38px;
  grid-template-columns: .8fr 1.2fr;
  margin-bottom: 45px;
  padding: clamp(24px, 4vw, 48px);
}

.change-order-request h3 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  margin: 10px 0;
}

.change-order-request p {
  color: var(--slate-soft);
  line-height: 1.6;
}

.change-order-form {
  display: grid;
  gap: 13px;
}

.form-message,
.message-status {
  font-size: 0.8rem;
  min-height: 20px;
}

.form-message.error,
.message-status.error {
  color: var(--red-dark);
}

.buildview-detail {
  display: grid;
  gap: 36px;
}

.buildview-detail-layout {
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
}

.buildview-code-wrap {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  min-height: 340px;
  padding: 24px;
}

.buildview-code-wrap img {
  max-height: 420px;
  object-fit: contain;
  width: 100%;
}

.buildview-instructions {
  align-content: start;
  display: grid;
  gap: 18px;
}

.buildview-instructions ol {
  counter-reset: steps;
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.buildview-instructions li {
  align-items: start;
  counter-increment: steps;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 1fr;
  line-height: 1.55;
}

.buildview-instructions li::before {
  align-items: center;
  border: 1px solid var(--bronze);
  border-radius: 50%;
  content: counter(steps);
  display: flex;
  font-size: 0.7rem;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.buildview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buildview-state {
  background:
    linear-gradient(rgba(23, 33, 38, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 38, 0.04) 1px, transparent 1px),
    var(--white);
  background-size: 30px 30px;
  border: 1px solid var(--line);
  display: grid;
  gap: 9px;
  min-height: 280px;
  padding: 38px;
  place-content: center;
  text-align: center;
}

.buildview-state strong {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 400;
}

.buildview-state span {
  color: var(--slate-soft);
  line-height: 1.6;
}

.buildview-meta {
  color: var(--slate-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.74rem;
  gap: 18px;
}

.studio-detail {
  align-items: center;
  background: #e5ded2;
  display: grid;
  gap: 40px;
  grid-template-columns: .8fr 1.2fr;
  padding: clamp(28px, 5vw, 70px);
}

.studio-detail-art {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}

.studio-detail-art span {
  aspect-ratio: 1.2;
  background: var(--walnut);
}

.studio-detail-art span:nth-child(2) { background: var(--paper); }
.studio-detail-art span:nth-child(3) { background: #7b8b84; }
.studio-detail-art span:nth-child(4) { background: #292927; }

.photo-lightbox {
  background: rgba(6, 12, 15, 0.96);
}

.photo-lightbox figure {
  align-items: center;
  display: grid;
  height: calc(100vh - 90px);
  justify-items: center;
  margin: 0;
  max-width: min(1400px, 84vw);
}

.photo-lightbox img {
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.photo-lightbox figcaption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  padding-top: 12px;
}

.photo-lightbox-close {
  position: absolute;
  right: 24px;
  top: 24px;
}

.photo-lightbox-nav {
  border-radius: 50%;
  height: 52px;
  padding: 0;
  position: absolute;
  top: 50%;
  width: 52px;
}

.photo-lightbox-nav.previous { left: 24px; }
.photo-lightbox-nav.next { right: 24px; }

/* Progressive reveal */
.reveal-section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal-section.visible {
  opacity: 1;
  transform: none;
}

/* Tablet */
@media (max-width: 1180px) {
  :root { --rail: 82px; }

  .portal-main {
    padding: 28px;
  }

  .project-hero {
    min-height: 700px;
  }

  .hero-story {
    max-width: 680px;
    padding: 54px;
  }

  .status-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }

  .status-ribbon > div:nth-child(3)::after {
    display: none;
  }

  .status-ribbon > div:nth-child(-n+3) {
    border-bottom: 1px solid var(--line);
  }

  .journey-line {
    gap: 18px 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .journey-line::before,
  .journey-line::after {
    display: none;
  }

  .journey-step {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }

  .photos-editorial {
    min-height: 540px;
  }

  .buildview-section {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile and Android desktop-site defensive layout */
@media (max-width: 1024px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-atmosphere {
    display: none;
  }

  .login-card {
    margin: auto;
    max-width: 680px;
    width: calc(100% - 32px);
  }

  .portal-shell {
    display: none;
  }

  .portal-ready .portal-shell {
    display: block;
  }

  .nav-rail {
    display: none;
  }

  .portal-header {
    min-height: 62px;
    padding: 10px 18px;
  }

  .portal-header > div {
    display: grid;
    gap: 2px;
  }

  .portal-header strong {
    font-size: 0.9rem;
  }

  .mobile-more-button {
    align-items: center;
    background: transparent;
    border: 1px solid var(--line);
    cursor: pointer;
    display: flex;
    gap: 6px;
    min-height: 44px;
    padding: 9px 12px;
  }

  .mobile-more-button span {
    font-size: 0.72rem;
    font-weight: 700;
  }

  .portal-main {
    padding: 14px 14px 104px;
  }

  .mobile-nav {
    align-items: stretch;
    background: rgba(17, 27, 32, 0.96);
    bottom: 0;
    color: rgba(255, 255, 255, 0.66);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    left: 0;
    min-height: 72px;
    padding-bottom: env(safe-area-inset-bottom);
    position: fixed;
    right: 0;
    z-index: 80;
  }

  .mobile-nav button {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-size: 0.58rem;
    gap: 5px;
    justify-content: center;
    min-height: 66px;
    padding: 6px 2px;
  }

  .mobile-nav button.active {
    color: var(--white);
  }

  .mobile-nav button.active::before {
    background: var(--red);
    content: "";
    height: 2px;
    position: absolute;
    top: 0;
    width: 24px;
  }

  .mobile-more-menu {
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: grid;
    gap: 1px;
    min-width: 250px;
    position: fixed;
    right: 14px;
    top: 68px;
    z-index: 90;
  }

  .mobile-more-menu button {
    background: var(--white);
    border: 0;
    cursor: pointer;
    min-height: 52px;
    padding: 12px 18px;
    text-align: left;
  }

  .mobile-more-menu button:last-child {
    color: var(--red);
  }

  .project-hero {
    min-height: min(780px, calc(100vh - 92px));
  }

  .hero-shade {
    background:
      linear-gradient(0deg, rgba(9, 18, 22, 0.96) 0%, rgba(9, 18, 22, 0.76) 45%, rgba(9, 18, 22, 0.12) 78%),
      linear-gradient(90deg, rgba(9, 18, 22, 0.2), transparent);
  }

  .hero-story {
    max-width: none;
    padding: clamp(28px, 7vw, 60px);
  }

  .hero-story h1 {
    font-size: clamp(2.8rem, 10vw, 6rem);
  }

  .hero-controls {
    bottom: auto;
    right: 14px;
    top: 14px;
  }

  .hero-dots {
    display: none;
  }

  .status-ribbon {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 94px;
  }

  .status-ribbon > div {
    border-bottom: 1px solid var(--line);
    min-height: 92px;
    padding: 18px;
  }

  .status-ribbon > div:nth-child(2n)::after {
    display: none;
  }

  .section-intro {
    align-items: start;
    gap: 16px;
    grid-template-columns: 38px 1fr;
  }

  .section-intro > :last-child {
    grid-column: 2;
    justify-self: start;
  }

  .section-intro h2,
  .buildview-copy h2,
  .studio-section h2 {
    font-size: clamp(2.45rem, 10vw, 4.8rem);
  }

  .journey-line {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    padding-left: 8px;
  }

  .journey-step {
    border: 0;
    gap: 20px;
    grid-template-columns: 58px 1fr;
    justify-items: start;
    min-height: 112px;
    padding: 0;
    text-align: left;
  }

  .journey-step:not(:last-child)::after {
    background: var(--line);
    content: "";
    height: 46px;
    left: 28px;
    position: absolute;
    top: 64px;
    width: 1px;
  }

  .journey-marker,
  .journey-step.current .journey-marker {
    height: 58px;
    margin: 0;
    width: 58px;
  }

  .journey-step.current .journey-marker {
    border-width: 6px;
  }

  .journey-step.current .journey-marker::after {
    display: none;
  }

  .journey-copy {
    align-self: center;
  }

  .journey-copy strong {
    font-size: 1.25rem;
  }

  .photos-editorial {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .photo-feature {
    min-height: 460px;
  }

  .photo-secondary-grid {
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .photo-secondary {
    min-height: 220px;
  }

  .photo-secondary:nth-child(3) {
    display: none;
  }

  .document-shelf,
  .buildview-section,
  .team-layout,
  .studio-section,
  .buildview-detail-layout,
  .studio-detail,
  .change-order-request {
    grid-template-columns: 1fr;
  }

  .buildview-section {
    min-height: 0;
  }

  .buildview-visual {
    min-height: 360px;
  }

  .buildview-copy {
    padding: 44px 28px;
  }

  .contact-story h3 {
    margin-top: 44px;
  }

  .studio-section {
    gap: 50px;
  }

  .studio-samples {
    height: 280px;
  }

  .detail-dialog {
    align-items: stretch;
    padding: 0;
  }

  .detail-panel {
    max-height: 100vh;
    width: 100vw;
  }

  .detail-header {
    padding: 18px;
  }

  .detail-body {
    padding: 24px 18px 100px;
  }

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

  .photo-lightbox {
    padding: 70px 12px 74px;
  }

  .photo-lightbox figure {
    height: calc(100vh - 150px);
    max-width: 100%;
  }

  .photo-lightbox-nav {
    bottom: 16px;
    top: auto;
  }

  .photo-lightbox-nav.previous { left: calc(50% - 62px); }
  .photo-lightbox-nav.next { right: calc(50% - 62px); }
}

@media (max-width: 560px) {
  .login-card {
    margin: 0;
    min-height: 100vh;
    padding: 28px 20px;
    width: 100%;
  }

  .login-card > img {
    margin-bottom: 26px;
  }

  .login-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-header-label {
    font-size: 0.58rem;
  }

  .project-hero {
    min-height: 690px;
  }

  .hero-story {
    padding: 26px 22px;
  }

  .hero-address {
    margin-bottom: 22px;
  }

  .hero-phase {
    margin-bottom: 20px;
  }

  .hero-dates {
    gap: 18px;
    justify-content: space-between;
  }

  .hero-dates div {
    max-width: 48%;
  }

  .status-ribbon strong {
    font-size: 1rem;
  }

  .photo-feature {
    min-height: 390px;
  }

  .photo-secondary {
    min-height: 170px;
  }

  .architectural-empty {
    min-height: 360px;
    padding: 26px;
  }

  .shelf-heading {
    grid-template-columns: 1fr;
  }

  .shelf-heading button {
    justify-self: start;
  }

  .artifact-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .artifact-item a {
    grid-column: 2;
    justify-self: start;
  }

  .buildview-visual {
    min-height: 290px;
  }

  .team-layout,
  .contact-story,
  .message-studio {
    min-width: 0;
  }

  .contact-story,
  .message-studio {
    padding: 34px 22px;
  }

  .message-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .message-form button {
    width: 100%;
  }

  .message-history-head {
    align-items: flex-start;
    gap: 12px;
  }

  .studio-section {
    padding: 45px 24px;
  }

  .studio-samples {
    height: 220px;
  }

  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .folder-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .folder-item .folder-open {
    grid-column: 2;
    justify-self: start;
  }

  .change-order-request {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal-section {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  .journey-marker,
  .camera-frame,
  .artifact-item,
  .folder-item,
  .status-ribbon {
    border: 1px solid CanvasText;
  }
}
