/* ==========================================================================
   WEBZY — Concept project pages
   Editorial case-study layout for the six self-initiated design studies.
   ========================================================================== */

.detail-page .main {
  overflow: clip;
}

/* ---------- Project hero ---------- */
.project-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(46px, 6vw, 82px));
  background:
    radial-gradient(ellipse at 82% 4%, rgba(67, 139, 255, 0.1), transparent 30%),
    radial-gradient(ellipse at 4% 34%, rgba(255, 255, 255, 0.026), transparent 26%);
}
.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 72%, rgba(5, 5, 5, 0.5));
}
.project-hero .container {
  position: relative;
  z-index: 2;
}
.breadcrumb {
  margin-bottom: clamp(38px, 5vw, 66px);
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.breadcrumb li + li::before {
  content: "/";
  color: rgba(255, 255, 255, 0.2);
}
.breadcrumb a {
  color: var(--muted);
  transition: color 0.25s ease;
}
.breadcrumb a:hover {
  color: var(--white);
}
.breadcrumb [aria-current="page"] {
  color: var(--silver-2);
}
.project-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  align-items: end;
  gap: clamp(42px, 7vw, 110px);
  padding-bottom: clamp(44px, 5.5vw, 78px);
}
.project-hero__copy .eyebrow {
  margin-bottom: clamp(22px, 3vw, 38px);
}
.project-hero__title {
  max-width: 980px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: clamp(3.3rem, 8.2vw, 8.2rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.058em;
  text-wrap: balance;
}
.project-hero__title span {
  display: block;
  margin-top: clamp(16px, 2vw, 26px);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.3vw, 2.05rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.project-hero__lede {
  max-width: 600px;
  margin-top: clamp(26px, 3.2vw, 42px);
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.78;
}
.project-hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 24px;
  margin-top: clamp(28px, 3.4vw, 42px);
}
.project-hero__note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-meta {
  border-top: 1px solid var(--line);
}
.project-meta > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.project-meta dt {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.project-meta dd {
  margin: 0;
  color: var(--silver-2);
  font-size: 12px;
  line-height: 1.6;
}
.project-meta .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid rgba(67, 139, 255, 0.3);
  border-radius: 999px;
  color: #a9c6ff;
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project-meta .status-pill::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

/* ---------- Cover ---------- */
.project-cover {
  width: min(calc(100% - (var(--gutter) * 2)), 1600px);
  margin: 0 auto;
}
.project-cover__media {
  position: relative;
  aspect-ratio: 16 / 8.4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0b0d;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.36);
}
.project-cover__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.2), transparent 30%, transparent 74%, rgba(5, 5, 5, 0.48)),
    radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, 0.08), transparent 44%);
}
.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-cover__badge {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 2.6vw, 34px);
  left: clamp(18px, 2.6vw, 34px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.42);
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.project-cover__badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}
.project-cover figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 2px 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Concept disclosure ---------- */
.concept-note {
  display: flex;
  align-items: baseline;
  gap: 22px;
  width: min(calc(100% - (var(--gutter) * 2)), 1600px);
  margin: 0 auto;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.concept-note__label {
  flex: 0 0 auto;
  color: #a9c6ff;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.concept-note p {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.65;
}

/* ---------- Shared detail sections ---------- */
.detail-section {
  position: relative;
  padding-block: clamp(76px, 9.5vw, 148px);
  border-top: 1px solid var(--line-soft);
}
.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: clamp(34px, 6vw, 100px);
  margin-bottom: clamp(42px, 5.5vw, 78px);
}
.detail-title {
  max-width: 780px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: clamp(2.35rem, 4.7vw, 4.7rem);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.detail-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.detail-head__intro {
  max-width: 430px;
  justify-self: end;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.detail-head .section-label {
  margin-bottom: clamp(20px, 2.8vw, 32px);
}

/* ---------- Overview ---------- */
.detail-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.72fr);
  gap: clamp(44px, 7vw, 110px);
  align-items: start;
}
.detail-body p {
  max-width: 680px;
  color: var(--silver-2);
  font-size: clamp(15px, 1.25vw, 16.5px);
  line-height: 1.82;
}
.detail-body p + p {
  margin-top: 20px;
  color: var(--muted);
}
.detail-body .detail-lead {
  color: var(--white);
  font-size: clamp(1.35rem, 2.2vw, 1.95rem);
  line-height: 1.42;
  letter-spacing: -0.033em;
}
.detail-aside {
  padding-left: clamp(22px, 3vw, 38px);
  border-left: 1px solid var(--line);
}
.mini-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.detail-aside p:not(.mini-label) {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}
.tags li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--silver-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

/* ---------- Principles ---------- */
.detail-principles {
  padding-top: 0;
  border-top: 0;
}
.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.principle {
  min-height: 230px;
  padding: 30px clamp(20px, 3vw, 42px) 8px 0;
  border-right: 1px solid var(--line-soft);
}
.principle + .principle {
  padding-left: clamp(20px, 3vw, 42px);
}
.principle:last-child {
  padding-right: 0;
  border-right: 0;
}
.principle__num {
  display: block;
  color: #8db4ff;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.1em;
}
.principle h3 {
  margin-top: clamp(30px, 4vw, 58px);
  color: var(--white);
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.principle p {
  max-width: 310px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.72;
}

/* ---------- Responsive preview ---------- */
.detail-preview {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 76% 20%, rgba(67, 139, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #08090b, #07080a);
}
.detail-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
.device-stage {
  position: relative;
  z-index: 1;
  margin-top: clamp(40px, 5.5vw, 72px);
  padding: 0 5% 7%;
}
.device-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 6%;
  width: 78%;
  height: 64%;
  border-radius: 50%;
  background: rgba(67, 139, 255, 0.1);
  filter: blur(100px);
  transform: translateX(-50%);
  pointer-events: none;
}
.device-stage__desktop {
  width: 84%;
  filter: drop-shadow(0 50px 90px rgba(0, 0, 0, 0.42));
}
.device-stage__desktop > .browser {
  width: 100%;
}
.device-stage__phone {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  width: 21%;
  filter: drop-shadow(0 30px 55px rgba(0, 0, 0, 0.55));
}
.device-stage__phone .phone-frame {
  transform: rotate(-1.4deg);
}
.device-labels {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.device-labels span:last-child {
  text-align: right;
}

/* ---------- Visual language ---------- */
.language-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  align-items: start;
  gap: clamp(42px, 6vw, 92px);
}
.language-copy p:not(.section-label) {
  max-width: 520px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.78;
}
.palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: clamp(34px, 4vw, 52px);
}
.swatch {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}
.swatch__chip {
  aspect-ratio: 1 / 1.12;
  background: var(--swatch);
}
.swatch.is-light .swatch__chip {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.swatch__info {
  padding: 10px 10px 11px;
}
.swatch__name {
  display: block;
  color: var(--silver-2);
  font-size: 10px;
  line-height: 1.4;
}
.swatch__hex {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.type-card {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent 30%),
    #0a0b0d;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}
.type-card__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.type-sample {
  padding: clamp(32px, 4vw, 48px) 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--white);
  font-size: clamp(2.4rem, 4vw, 4.1rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.type-sample--serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.type-sample em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.type-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}
.type-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.type-row:last-child {
  border-bottom: 0;
}
.type-row span:first-child {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.type-row strong {
  color: var(--silver);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
}
.type-row span:last-child {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-align: right;
}
.type-card__foot {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.65;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 22px);
  align-items: start;
}
.gallery__item {
  grid-column: span 6;
}
.gallery__item--7 {
  grid-column: span 7;
}
.gallery__item--5 {
  grid-column: span 5;
}
.gallery__item--12 {
  grid-column: span 12;
}
.gallery__item--offset {
  margin-top: clamp(28px, 4.5vw, 72px);
}
.gallery__media {
  aspect-ratio: var(--ar, 4 / 3);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0a0b0d;
}
.gallery__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.gallery__item:hover .gallery__media img {
  transform: scale(1.025);
}
.gallery__item figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 1px 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gallery__item figcaption span:last-child {
  flex: 0 0 auto;
  color: var(--muted-2);
}
.gallery-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(26px, 3.4vw, 42px);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.gallery-note::before {
  content: "";
  width: 18px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--line-strong);
}

/* ---------- Next project ---------- */
.detail-next {
  padding-block: clamp(60px, 7.5vw, 110px);
}
.next-card {
  position: relative;
  display: block;
  min-height: clamp(340px, 42vw, 540px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0b0d;
  isolation: isolate;
}
.next-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  transition: transform 1.1s var(--ease), opacity 0.6s ease;
}
.next-card:hover .next-card__image {
  transform: scale(1.035);
  opacity: 0.72;
}
.next-card__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.45) 58%, rgba(5, 5, 5, 0.15) 100%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.72), transparent 48%);
}
.next-card__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: inherit;
  padding: clamp(28px, 4.5vw, 64px);
}
.next-card__eyebrow {
  color: #a9c6ff;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.next-card h2 {
  margin-top: 12px;
  color: var(--white);
  font-size: clamp(2.4rem, 5.4vw, 5rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.05em;
}
.next-card__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: var(--silver-2);
  font-size: 12px;
  line-height: 1.4;
}
.next-card__link svg {
  width: 13px;
  height: 13px;
  transition: transform 0.35s var(--ease);
}
.next-card:hover .next-card__link svg {
  transform: translate(3px, -3px);
}
.next-card__arrow {
  position: absolute;
  z-index: 3;
  top: clamp(24px, 3.5vw, 46px);
  right: clamp(24px, 3.5vw, 46px);
  display: grid;
  place-items: center;
  width: clamp(48px, 5vw, 64px);
  height: clamp(48px, 5vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--white);
  background: rgba(5, 5, 5, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.next-card__arrow svg {
  width: 19px;
  height: 19px;
  transition: transform 0.35s var(--ease);
}
.next-card:hover .next-card__arrow {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.1);
}
.next-card:hover .next-card__arrow svg {
  transform: translate(2px, -2px);
}

/* ---------- End CTA ---------- */
.detail-cta {
  position: relative;
  overflow: hidden;
  padding-block: clamp(76px, 10vw, 150px);
  border-top: 1px solid var(--line-soft);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(67, 139, 255, 0.11), transparent 50%),
    #060708;
}
.detail-cta .eyebrow {
  justify-content: center;
}
.detail-cta h2 {
  max-width: 840px;
  margin: clamp(22px, 3vw, 34px) auto 0;
  color: var(--white);
  font-size: clamp(2.5rem, 5.4vw, 5.4rem);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.detail-cta h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.detail-cta__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(30px, 4vw, 44px);
}

/* ---------- Legal / utility pages ---------- */
.legal-hero {
  padding-top: calc(var(--header-h) + clamp(52px, 7vw, 94px));
  padding-bottom: clamp(44px, 5vw, 66px);
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 84% 0%, rgba(67, 139, 255, 0.08), transparent 32%);
}
.legal-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.55fr);
  align-items: end;
  gap: clamp(34px, 6vw, 90px);
}
.legal-title {
  margin-top: clamp(22px, 3vw, 34px);
  color: var(--white);
  font-size: clamp(3rem, 6.8vw, 6.6rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.055em;
}
.legal-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.legal-hero__intro {
  max-width: 560px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.78;
}
.legal-meta {
  border-top: 1px solid var(--line);
}
.legal-meta > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.legal-meta dt {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.legal-meta dd {
  margin: 0;
  color: var(--silver-2);
  font-size: 11.5px;
  line-height: 1.6;
}
.legal-wrap {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px) 1fr;
  gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(60px, 8vw, 110px);
}
.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  align-self: start;
}
.legal-toc p {
  margin-bottom: 14px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.legal-toc ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: legal;
}
.legal-toc li {
  counter-increment: legal;
}
.legal-toc a {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  transition: color 0.25s ease;
}
.legal-toc a::before {
  content: counter(legal, decimal-leading-zero);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.9;
}
.legal-toc a:hover {
  color: var(--white);
}
.legal-content {
  min-width: 0;
}
.legal-content section {
  padding-bottom: clamp(36px, 4.5vw, 54px);
  scroll-margin-top: calc(var(--header-h) + 30px);
}
.legal-content section + section {
  padding-top: clamp(36px, 4.5vw, 54px);
  border-top: 1px solid var(--line-soft);
}
.legal-content h2 {
  margin-bottom: 18px;
  color: var(--white);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.03em;
}
.legal-content h2 span {
  margin-right: 12px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  vertical-align: 2px;
}
.legal-content h3 {
  margin: 24px 0 8px;
  color: var(--silver);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
}
.legal-content p,
.legal-content li {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.82;
}
.legal-content p + p {
  margin-top: 14px;
}
.legal-content ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-left: 18px;
  list-style: disc;
}
.legal-content li::marker {
  color: var(--blue);
}
.legal-content a {
  color: var(--silver);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.26);
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.legal-content a:hover {
  color: var(--white);
  text-decoration-color: var(--blue);
}
.legal-note {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(213, 164, 92, 0.22);
  border-radius: 3px;
  background: rgba(213, 164, 92, 0.045);
  color: #c9b28f;
  font-size: 11.5px;
  line-height: 1.7;
}
.legal-side {
  align-self: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
}
.legal-side p {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}
.legal-side a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--silver);
  font-size: 11.5px;
}
.legal-side svg {
  width: 11px;
  height: 11px;
}

/* ---------- 404 ---------- */
.error-main {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 50px) 0 80px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(67, 139, 255, 0.11), transparent 42%),
    radial-gradient(ellipse at 84% 16%, rgba(255, 255, 255, 0.035), transparent 30%);
}
.error-main::before {
  content: "404";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  color: transparent;
  font-family: var(--font-sans);
  font-size: clamp(15rem, 42vw, 38rem);
  font-weight: 500;
  line-height: 0.7;
  letter-spacing: -0.09em;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
  transform: translate(-52%, -50%);
  pointer-events: none;
  white-space: nowrap;
}
.error-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
}
.error-code {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.error-title {
  margin-top: 24px;
  color: var(--white);
  font-size: clamp(3.6rem, 9vw, 8.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.06em;
}
.error-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.error-copy {
  max-width: 470px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.78;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.error-links a:hover {
  color: var(--silver);
}

/* ---------- Detail responsive ---------- */
@media (max-width: 1080px) {
  .project-hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 36px;
  }
  .project-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
  }
  .project-meta > div {
    grid-template-columns: 82px minmax(0, 1fr);
    border-bottom: 1px solid var(--line-soft);
  }
  .project-meta > div:nth-child(odd) {
    padding-right: 20px;
  }
  .project-meta > div:nth-child(even) {
    padding-left: 20px;
    border-left: 1px solid var(--line-soft);
  }
  .detail-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
  }
  .detail-head__intro {
    justify-self: start;
    max-width: 560px;
  }
  .detail-two {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .detail-aside {
    padding-top: 24px;
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
  .detail-aside p:not(.mini-label) {
    max-width: 560px;
  }
  .language-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .type-card {
    max-width: 620px;
  }
  .legal-wrap {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .legal-side {
    display: none;
  }
}

@media (max-width: 820px) {
  .project-cover {
    width: calc(100% - (var(--gutter) * 2));
  }
  .project-cover__media {
    aspect-ratio: 4 / 3;
  }
  .concept-note {
    width: calc(100% - (var(--gutter) * 2));
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-block: 15px;
  }
  .principles {
    grid-template-columns: 1fr;
    border-top: 1px solid var(--line);
  }
  .principle,
  .principle + .principle {
    min-height: 0;
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .principle:last-child {
    border-bottom: 0;
  }
  .principle h3 {
    margin-top: 16px;
  }
  .principle p {
    max-width: 520px;
  }
  .device-stage {
    padding: 0 0 8%;
  }
  .device-stage__desktop {
    width: 100%;
  }
  .device-stage__phone {
    position: relative;
    right: auto;
    bottom: auto;
    width: 36%;
    margin: -14% 3% 0 auto;
  }
  .device-labels {
    margin-top: 8px;
  }
  .palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gallery__item--7,
  .gallery__item--5,
  .gallery__item {
    grid-column: span 12;
  }
  .gallery__item--offset {
    margin-top: 0;
  }
  .next-card {
    min-height: 400px;
  }
  .legal-hero__grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 30px;
  }
  .legal-wrap {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .legal-toc {
    position: relative;
    top: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-soft);
  }
  .legal-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
  }
}

@media (max-width: 580px) {
  .project-hero {
    padding-top: calc(var(--header-h) + 34px);
  }
  .breadcrumb {
    margin-bottom: 32px;
  }
  .project-hero__title {
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }
  .project-hero__title span {
    font-size: clamp(1.15rem, 5vw, 1.55rem);
  }
  .project-hero__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .project-hero__actions .btn {
    width: 100%;
  }
  .project-hero__note {
    justify-content: center;
  }
  .project-meta {
    grid-template-columns: 1fr;
  }
  .project-meta > div,
  .project-meta > div:nth-child(odd),
  .project-meta > div:nth-child(even) {
    grid-template-columns: 88px minmax(0, 1fr);
    padding-inline: 0;
    border-left: 0;
  }
  .project-cover {
    width: 100%;
    padding-inline: var(--gutter);
  }
  .project-cover__media {
    border-radius: 2px;
  }
  .project-cover figcaption {
    flex-direction: column;
    gap: 3px;
    padding-top: 10px;
  }
  .concept-note {
    width: 100%;
    padding-inline: var(--gutter);
  }
  .detail-section {
    padding-block: 72px;
  }
  .detail-title {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }
  .detail-body .detail-lead {
    font-size: 1.35rem;
  }
  .device-stage__phone {
    width: 42%;
  }
  .device-labels {
    flex-direction: column;
    gap: 3px;
  }
  .device-labels span:last-child {
    text-align: left;
  }
  .type-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .type-row span:last-child {
    grid-column: 2;
    margin-top: -5px;
    text-align: left;
  }
  .gallery__item figcaption {
    flex-direction: column;
    gap: 2px;
  }
  .next-card {
    min-height: 410px;
  }
  .next-card__shade {
    background:
      linear-gradient(0deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.38) 70%, rgba(5, 5, 5, 0.25) 100%);
  }
  .next-card__arrow {
    width: 44px;
    height: 44px;
  }
  .detail-cta__actions {
    align-items: stretch;
    flex-direction: column;
  }
  .detail-cta__actions .btn {
    width: 100%;
  }
  .legal-toc ol {
    grid-template-columns: 1fr;
  }
  .legal-content section {
    padding-bottom: 32px;
  }
  .legal-content section + section {
    padding-top: 32px;
  }
  .error-title {
    font-size: clamp(3.1rem, 15vw, 4.8rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .next-card__image,
  .next-card__arrow svg,
  .gallery__media img {
    transition: none;
  }
}
