/* Xyncema Spaces — architectural editorial composition. Tokens: [data-theme="architecture"] */

.sp-wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3.5rem); }
.sp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 2rem); }
.sp-serif { font-family: var(--font-heading); font-weight: 400; letter-spacing: -0.01em; }
.sp-h1 { font-family: var(--font-heading); font-weight: 400; font-size: clamp(3.2rem, 7.6vw, 7.8rem); line-height: .92; letter-spacing: -0.025em; }
.sp-h2 { font-family: var(--font-heading); font-weight: 400; font-size: clamp(2.3rem, 4.6vw, 4.4rem); line-height: 1; letter-spacing: -0.02em; }
.sp-h3 { font-family: var(--font-heading); font-weight: 500; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.1; }
.sp-h1 em, .sp-h2 em { font-style: italic; color: var(--primary-ink); }
.sp-meta { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sp-body { color: var(--muted); max-width: 58ch; line-height: 1.7; }
.sp-section { padding-block: clamp(5rem, 11vw, 9rem); }
.sp-line { border-top: 1px solid var(--text); }

.sp-btn { display: inline-flex; align-items: center; gap: .7rem; min-height: 50px; padding: .8rem 1.4rem; background: var(--secondary); color: var(--on-secondary); border: 1px solid var(--secondary); font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; transition: background .25s, border-color .25s, color .25s; }
.sp-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sp-btn svg { width: 16px; height: 16px; }
.sp-btn--line { background: transparent; color: var(--text); border-color: var(--text); }
.sp-btn--line:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.sp-arrow { display: inline-flex; gap: .6rem; align-items: center; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; padding-bottom: .3rem; border-bottom: 1px solid currentColor; background: none; border-top: 0; border-left: 0; border-right: 0; }
.sp-arrow svg { width: 16px; height: 16px; transition: transform .3s; }
.sp-arrow:hover { color: var(--primary-ink); }
.sp-arrow:hover svg { transform: translateX(4px); }

/* Header */
.sp-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.sp-header__row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; min-height: 78px; }
.sp-mark { text-decoration: none; display: grid; line-height: 1; }
.sp-mark b { font-family: var(--font-heading); font-weight: 500; font-size: 1.75rem; letter-spacing: .02em; }
.sp-mark small { font-size: .6rem; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: .25rem; }
.sp-nav { display: flex; align-items: center; gap: .15rem; }
.sp-nav a { text-decoration: none; font-size: .9rem; padding: .5rem .7rem; }
.sp-nav a + a::before { content: "/"; margin-right: 1.1rem; color: var(--border); }
.sp-nav a:hover, .sp-nav a[aria-current="page"] { color: var(--primary-ink); }
.sp-nav .sp-arrow { margin-left: 1.25rem; }
.sp-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--text); background: transparent; place-items: center; }
.sp-toggle svg { width: 22px; height: 22px; }
.sp-mobile { display: none; }
@media (max-width: 899px) {
  .sp-nav a, .sp-nav .sp-arrow { display: none; }
  .sp-toggle { display: inline-grid; }
  .is-nav-open .sp-mobile { display: grid; padding-block: .5rem 1.5rem; }
  .sp-mobile a { font-family: var(--font-heading); font-size: 2.2rem; text-decoration: none; padding: .5rem 0; border-top: 1px solid var(--border); }
}

/* Hero: building first, words below */
.sp-hero__photo { position: relative; height: min(76vh, 820px); min-height: 380px; overflow: hidden; background: #D9D1C4; }
.sp-hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.sp-hero__photo figcaption { position: absolute; left: clamp(1.25rem, 4vw, 3.5rem); bottom: 1.25rem; color: #fff; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(0,0,0,.5); display: flex; gap: .8rem; align-items: center; }
.sp-hero__photo figcaption::before { content: ""; width: 3rem; height: 1px; background: #fff; }
.sp-hero__band { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3rem, 6vw, 5rem); align-items: end; }
.sp-hero__band h1 { grid-column: 1 / span 8; }
.sp-hero__side { grid-column: 9 / span 4; display: grid; gap: 1.5rem; padding-bottom: .6rem; }
.sp-hero__side p { color: var(--muted); font-size: 1.05rem; }
.sp-hero__actions { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 899px) { .sp-hero__band h1, .sp-hero__side { grid-column: 1 / -1; } .sp-hero__side { margin-top: 1.5rem; } .sp-hero__photo { height: 56vh; } }

/* Project index (architectural schedule) */
.sp-index { border-top: 1px solid var(--text); }
.sp-index__head, .sp-row { display: grid; grid-template-columns: 4rem minmax(0, 4fr) minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.8fr) 3rem; gap: 1rem; align-items: center; }
.sp-index__head { padding-block: .8rem; border-bottom: 1px solid var(--border); }
.sp-row { padding-block: 1.3rem; border-bottom: 1px solid var(--border); text-decoration: none; position: relative; transition: padding .3s; }
.sp-row__name { font-family: var(--font-heading); font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1; }
.sp-row__thumb { position: absolute; right: 5rem; top: 50%; width: 180px; aspect-ratio: 4 / 3; object-fit: cover; transform: translateY(-50%) scale(.96); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 2; }
.sp-row svg { width: 20px; height: 20px; justify-self: end; transition: transform .3s; }
.sp-row:hover { padding-left: .75rem; }
.sp-row:hover .sp-row__name { color: var(--primary-ink); font-style: italic; }
.sp-row:hover svg { transform: translateX(4px); }
.sp-row:hover .sp-row__thumb, .sp-row:focus-visible .sp-row__thumb { opacity: 1; transform: translateY(-50%) scale(1); }
@media (max-width: 899px) {
  .sp-index__head { display: none; }
  .sp-row { grid-template-columns: 3rem 1fr auto; row-gap: .3rem; }
  .sp-row > :nth-child(3), .sp-row > :nth-child(4), .sp-row > :nth-child(5) { grid-column: 2; font-size: .88rem; }
  .sp-row svg { grid-column: 3; grid-row: 1; }
  .sp-row__thumb { display: none; }
}

/* Philosophy */
.sp-philo__statement { grid-column: 3 / span 9; font-family: var(--font-heading); font-size: clamp(2rem, 3.8vw, 3.6rem); line-height: 1.1; }
.sp-philo__list { grid-column: 3 / span 10; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); margin-top: clamp(3rem, 6vw, 5rem); }
.sp-philo__list li { border-top: 1px solid var(--text); padding-top: 1.2rem; display: grid; gap: .6rem; }
.sp-philo__list b { font-family: var(--font-heading); font-weight: 500; font-size: 1.6rem; }
@media (max-width: 899px) { .sp-philo__statement, .sp-philo__list { grid-column: 1 / -1; } .sp-philo__list { grid-template-columns: 1fr; } }

/* Material story */
.sp-mat { background: var(--surface-2); color: var(--on-surface-2); }
.sp-mat .sp-meta { color: #BDB6AB; }
.sp-mat .sp-body { color: #CFC9BF; }
.sp-mat__img { grid-column: 1 / span 5; }
.sp-mat__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.sp-mat__text { grid-column: 7 / span 6; display: grid; gap: 1.5rem; align-content: start; }
.sp-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.sp-swatch { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; align-items: center; text-align: left; padding: 0; background: none; border: 0; border-top: 1px solid rgba(242,237,229,.2); padding-top: 1rem; color: inherit; cursor: pointer; }
.sp-swatch img { width: 88px; aspect-ratio: 1; object-fit: cover; transition: filter .3s; }
.sp-swatch b { font-family: var(--font-heading); font-weight: 500; font-size: 1.45rem; display: block; line-height: 1.1; }
.sp-swatch span { font-size: .8rem; color: #BDB6AB; }
.sp-swatch:hover b { color: var(--primary-on-dark); }
.sp-mat :focus-visible { outline-color: var(--primary-on-dark); }
@media (max-width: 899px) { .sp-mat__img, .sp-mat__text { grid-column: 1 / -1; } .sp-mat__img { margin-bottom: 2rem; } .sp-mat__img img { aspect-ratio: 16 / 10; } }
@media (max-width: 560px) { .sp-swatches { grid-template-columns: 1fr; } }

/* Featured project */
.sp-feature__img { grid-column: 1 / span 8; }
.sp-feature__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.sp-feature__text { grid-column: 9 / span 4; display: grid; gap: 1.25rem; align-content: end; }
.sp-facts { display: grid; border-top: 1px solid var(--text); }
.sp-facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding-block: .75rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.sp-facts dt { color: var(--muted); }
@media (max-width: 899px) { .sp-feature__img, .sp-feature__text { grid-column: 1 / -1; } .sp-feature__text { margin-top: 2rem; } }

/* Expertise */
.sp-exp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--text); }
.sp-exp article { padding: 1.5rem clamp(0rem, 1.5vw, 1.5rem) 1.5rem 0; display: grid; gap: .8rem; align-content: start; }
.sp-exp article + article { border-left: 1px solid var(--border); padding-left: clamp(1rem, 1.5vw, 1.5rem); }
.sp-exp p { color: var(--muted); font-size: .95rem; }
.sp-exp small { font-size: .8rem; color: var(--primary-ink); }
@media (max-width: 899px) { .sp-exp { grid-template-columns: 1fr 1fr; } .sp-exp article:nth-child(3) { border-left: 0; padding-left: 0; } .sp-exp article:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 520px) { .sp-exp { grid-template-columns: 1fr; } .sp-exp article { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--border); } }

/* Stages */
.sp-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: st; }
.sp-stage { counter-increment: st; padding: 0 1rem 0 0; display: grid; gap: .75rem; align-content: start; position: relative; }
.sp-stage::before { content: counter(st, decimal-leading-zero); font-family: var(--font-heading); font-size: 3rem; line-height: 1; color: var(--primary-ink); }
.sp-stage::after { content: ""; position: absolute; top: 1.6rem; left: 3.6rem; right: 1rem; height: 1px; background: var(--border); }
.sp-stage b { font-weight: 600; }
.sp-stage p { color: var(--muted); font-size: .92rem; }
@media (max-width: 899px) { .sp-stages { grid-template-columns: 1fr; gap: 1.5rem; } .sp-stage { grid-template-columns: 4rem 1fr; } .sp-stage::before { grid-row: span 2; } .sp-stage::after { display: none; } }

/* Studio + inquiry */
.sp-studio__text { grid-column: 1 / span 5; display: grid; gap: 1.5rem; align-content: start; }
.sp-studio__form { grid-column: 7 / span 6; }
@media (max-width: 899px) { .sp-studio__text, .sp-studio__form { grid-column: 1 / -1; } .sp-studio__form { margin-top: 2.5rem; } }
.sp-form { display: grid; gap: 1.5rem; }
.sp-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sp-form legend { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.sp-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.sp-choice { position: relative; }
.sp-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sp-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem; border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); font-size: .92rem; }
.sp-choice input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.sp-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.sp-form .xy-input { background: transparent; border: 0; border-bottom: 1px solid var(--text); border-radius: 0; padding-inline: 0; }
.sp-form .xy-input:focus-visible { outline: none; border-bottom-color: var(--primary); box-shadow: 0 2px 0 0 var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.sp-form label { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sp-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 560px) { .sp-form__row { grid-template-columns: 1fr; } }
.sp-summary { display: grid; gap: 1.1rem; }
.sp-summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; border-top: 1px solid var(--text); padding-top: 1rem; }
.sp-summary dt { color: var(--muted); }
.sp-ok { display: inline-flex; gap: .55rem; align-items: center; font-weight: 600; color: var(--primary-ink); }
.sp-ok svg { width: 22px; height: 22px; padding: 3px; background: var(--primary); color: #fff; }

/* Projects page */
.sp-pagehead { padding-block: clamp(3rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem); }
.sp-crumbs { display: flex; gap: .6rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.sp-crumbs a { color: var(--muted); text-decoration: none; }
.sp-crumbs a:hover { color: var(--text); text-decoration: underline; }
.sp-filter { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; border-block: 1px solid var(--text); }
.sp-tabs { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.sp-tabs button { background: none; border: 0; padding: .6rem 0; font-family: var(--font-heading); font-size: 1.45rem; color: var(--muted); border-bottom: 1px solid transparent; }
.sp-tabs button sup { font-family: var(--font-body); font-size: .65rem; margin-left: .2rem; }
.sp-tabs button[aria-pressed="true"] { color: var(--text); border-color: var(--text); font-style: italic; }
.sp-tabs button:hover { color: var(--text); }
.sp-cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 2vw, 2rem); padding-block: clamp(2.5rem, 5vw, 4rem) clamp(5rem, 10vw, 8rem); }
.sp-card { text-decoration: none; display: grid; gap: 1rem; align-content: start; }
.sp-card:nth-child(4n+1) { grid-column: 1 / span 7; } .sp-card:nth-child(4n+2) { grid-column: 9 / span 4; margin-top: clamp(3rem, 10vw, 8rem); }
.sp-card:nth-child(4n+3) { grid-column: 1 / span 5; } .sp-card:nth-child(4n+4) { grid-column: 7 / span 6; margin-top: clamp(2rem, 6vw, 5rem); }
.sp-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: filter .4s; }
.sp-card:nth-child(4n+2) img { aspect-ratio: 4 / 5; }
.sp-card:hover img { filter: brightness(.94); }
.sp-card__row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-top: 1px solid var(--text); padding-top: .8rem; }
.sp-card__name { font-family: var(--font-heading); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1; }
.sp-card:hover .sp-card__name { font-style: italic; color: var(--primary-ink); }
.sp-empty { grid-column: 1 / -1; border: 1px dashed var(--border); padding: 3rem; display: grid; gap: 1rem; justify-items: start; }
@media (max-width: 760px) { .sp-card { grid-column: 1 / -1 !important; margin-top: 0 !important; } .sp-card img { aspect-ratio: 4 / 3 !important; } }

/* Project detail */
.sp-dhead { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); align-items: end; }
.sp-dhead h1 { grid-column: 1 / span 8; }
.sp-dhead .sp-facts { grid-column: 9 / span 4; }
@media (max-width: 899px) { .sp-dhead h1, .sp-dhead .sp-facts { grid-column: 1 / -1; } .sp-dhead .sp-facts { margin-top: 2rem; } }
.sp-dimg { margin-inline: calc(-1 * clamp(1.25rem, 4vw, 3.5rem)); }
.sp-dimg button { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; line-height: 0; }
.sp-dimg img { width: 100%; max-height: 88vh; object-fit: cover; }
.sp-idea { padding-block: clamp(4rem, 8vw, 7rem); }
.sp-idea__label { grid-column: 1 / span 3; }
.sp-idea__lead { grid-column: 4 / span 8; font-family: var(--font-heading); font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.15; }
.sp-idea__plan { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.sp-idea__plan li { border-top: 1px solid var(--text); padding-top: 1rem; color: var(--muted); }
@media (max-width: 899px) { .sp-idea__label, .sp-idea__lead, .sp-idea__plan { grid-column: 1 / -1; } .sp-idea__plan { grid-template-columns: 1fr; } .sp-idea__lead { margin-top: 1rem; } }
.sp-gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(.75rem, 1.5vw, 1.25rem); }
.sp-gallery button { border: 0; padding: 0; background: #D9D1C4; cursor: zoom-in; display: grid; gap: .5rem; text-align: left; line-height: 1.3; }
.sp-gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.sp-gallery span { background: var(--bg); font-size: .8rem; color: var(--muted); padding-top: .3rem; }
.sp-gallery button:nth-child(4n+1) { grid-column: span 7; } .sp-gallery button:nth-child(4n+2) { grid-column: span 5; }
.sp-gallery button:nth-child(4n+3) { grid-column: span 5; } .sp-gallery button:nth-child(4n+4) { grid-column: span 7; }
.sp-gallery button:only-child, .sp-gallery button:nth-child(2):last-child { grid-column: span 6; }
.sp-gallery button:first-child:nth-last-child(2) { grid-column: span 6; }
@media (max-width: 640px) { .sp-gallery button { grid-column: 1 / -1 !important; } }
.sp-dmat { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.sp-dmat button { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--border); padding: .75rem; cursor: pointer; }
.sp-dmat button:hover { border-color: var(--text); }
.sp-dmat img { width: 96px; aspect-ratio: 1; object-fit: cover; }
.sp-dmat b { font-family: var(--font-heading); font-weight: 500; font-size: 1.4rem; display: block; }
.sp-dmat span { font-size: .8rem; color: var(--muted); }
.sp-drawerimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 1rem; }
.sp-faq details { border-top: 1px solid var(--border); }
.sp-faq details:last-child { border-bottom: 1px solid var(--border); }
.sp-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.2; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::after { content: "+"; font-family: var(--font-body); font-weight: 300; font-size: 1.5rem; transition: transform .25s; }
.sp-faq details[open] summary::after { transform: rotate(45deg); }
.sp-faq details p { padding-bottom: 1.2rem; color: var(--muted); max-width: 62ch; }
.sp-next { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; text-decoration: none; padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--text); }
.sp-next b { font-family: var(--font-heading); font-weight: 400; font-size: clamp(2.8rem, 8vw, 7rem); line-height: .95; }
.sp-next:hover b { font-style: italic; color: var(--primary-ink); }
.sp-next img { width: clamp(120px, 20vw, 280px); aspect-ratio: 4 / 3; object-fit: cover; }
[data-theme="architecture"] dialog.xy-dialog:not(.xy-lightbox) { border-radius: 0; }
[data-theme="architecture"] .xy-dialog__title { font-weight: 500; font-size: 2rem; }

/* Footer */
.sp-footer { background: var(--surface-2); color: var(--on-surface-2); padding-block: clamp(4rem, 8vw, 6rem) 2rem; }
.sp-footer__top { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(242,237,229,.2); }
.sp-footer__top p { font-family: var(--font-heading); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; max-width: 16ch; }
.sp-footer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding-block: 2.5rem; }
.sp-footer h3 { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: #BDB6AB; margin-bottom: .9rem; font-weight: 600; }
.sp-footer ul { display: grid; gap: .45rem; }
.sp-footer a { text-decoration: none; }
.sp-footer a:hover { color: var(--primary-on-dark); }
.sp-footer__bottom { padding-top: 1.5rem; border-top: 1px solid rgba(242,237,229,.2); color: #CFC9BF; }
.sp-footer .xy-attribution a, .sp-footer .xy-attribution button { color: var(--on-surface-2); }
.sp-footer .sp-arrow { color: var(--on-surface-2); }
@media (max-width: 700px) { .sp-footer__grid { grid-template-columns: 1fr; } }
