/* The Divia — page components (sections, cards, layouts) */
/* ---------- sections ---------- */
section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 780px; }
.rule-top { border-top: 1px solid var(--rule); }
.band { background: var(--surface); border-block: 1px solid var(--rule); }
.on-deep { background: var(--deep); color: var(--deep-ink); position: relative; overflow: hidden; }
.on-deep .eyebrow { color: var(--deep-ink-2); }
.on-deep .lead, .on-deep .prose { color: var(--deep-ink-2); }
.on-deep a:not(.btn) { color: var(--deep-ink); }

.on-deep > .wrap { position: relative; }

/* ---------- image slots ---------- */
.slot {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, var(--slot-a) 0%, color-mix(in srgb, var(--slot-a) 55%, var(--slot-b)) 58%, var(--slot-b) 100%);
  background-size: cover; background-position: center;
  color: #fff;
  aspect-ratio: 4 / 3;
  max-width: 100%;
}
.slot::before {
  content: ""; position: absolute; inset: 0;
  background: #fff; opacity: .13;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M22 2 L42 22 L22 42 L2 22Z'/%3E%3Crect x='8' y='8' width='28' height='28'/%3E%3Ccircle cx='22' cy='22' r='3.2'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M22 2 L42 22 L22 42 L2 22Z'/%3E%3Crect x='8' y='8' width='28' height='28'/%3E%3Ccircle cx='22' cy='22' r='3.2'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 44px 44px; mask-size: 44px 44px;
}
.slot.loaded::before { display: none; }
.slot figcaption {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .06em;
  display: flex; gap: 8px; align-items: baseline;
}
.slot figcaption span {
  background: rgba(8, 28, 31, .62); padding: 5px 8px; border-radius: 2px; line-height: 1.35;
}
.slot .tag { position: absolute; top: 12px; left: 12px; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; background: rgba(8, 28, 31, .62); padding: 5px 8px; border-radius: 2px; }
.slot.tall { aspect-ratio: 4 / 5; }
.slot.wide { aspect-ratio: 16 / 9; }
.slot.pano { aspect-ratio: 21 / 9; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 22px; }
.coords { font-family: var(--f-mono); font-size: .78rem; color: var(--ink-3); letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.page-hero { padding-block: clamp(40px, 6vw, 72px) clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--rule); }
.page-hero .wrap { display: grid; gap: 18px; }

/* ---------- fact strip ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 22px 20px 22px 0; display: grid; gap: 4px; align-content: start; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts .v { font-family: var(--f-display); font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.15; }
.facts .k { font-size: .86rem; color: var(--ink-3); }
@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- split layouts ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
@media (max-width: 860px) { .split, .split.wide-left { grid-template-columns: 1fr; } }

/* ---------- product cards ---------- */
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.product { display: grid; gap: 16px; align-content: start; }
.product .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--f-mono); font-size: .76rem; color: var(--ink-3); letter-spacing: .04em; }
.product .meta b { color: var(--ink); font-weight: 500; }
.product p { color: var(--ink-2); }
.gloss { font-style: italic; color: var(--ink-3); }
@media (max-width: 760px) { .products { grid-template-columns: 1fr; } }

/* ---------- phase roll-out ---------- */
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.phase { padding: 24px 24px 8px 0; display: grid; gap: 12px; align-content: start; }
.phase + .phase { padding-left: 24px; border-left: 1px solid var(--rule); }
.phase .when { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cowrie); }
.phase h3 { font-family: var(--f-display); font-size: 1.4rem; }
.phase ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: .95rem; display: grid; gap: 4px; }
.keysbar { display: grid; gap: 6px; }
.keysbar .track { height: 8px; background: var(--tint); border-radius: 2px; overflow: hidden; }
.keysbar .fill { height: 100%; background: var(--accent); border-radius: 2px; }
.keysbar .lbl { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.on-deep .phases, .on-deep .phase + .phase { border-color: rgba(255,255,255,.14); }
.on-deep .phase ul { color: var(--deep-ink-2); }
.on-deep .phase .when { color: #D2B47A; }
.on-deep .keysbar .track { background: rgba(255,255,255,.12); }
.on-deep .keysbar .fill { background: #A9D3BA; }
.on-deep .keysbar .lbl { color: var(--deep-ink-2); }
@media (max-width: 760px) {
  .phases { grid-template-columns: 1fr; }
  .phase + .phase { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .on-deep .phase + .phase { border-top-color: rgba(255,255,255,.14); }
}

/* ---------- lists of points ---------- */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.point { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 1px solid var(--rule); }
.point h3 { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.2; }
.point p { color: var(--ink-2); font-size: .98rem; }
.on-deep .point { border-top-color: rgba(255,255,255,.18); }
.on-deep .point p { color: var(--deep-ink-2); }
@media (max-width: 860px) { .points { grid-template-columns: 1fr; } }

/* ---------- definition / detail tables ---------- */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); border-top: 1px solid var(--rule); margin: 0; }
.dl dt, .dl dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.dl dt { color: var(--ink-3); font-size: .9rem; padding-right: 16px; }
.dl dd { color: var(--ink); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .94rem; min-width: 520px; }
table.data th, table.data td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 0; }
table.data thead th { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
table.data tbody th { font-weight: 500; color: var(--ink); }
table.data tr.total td, table.data tr.total th { font-weight: 600; border-top: 1px solid var(--ink-3); }
table.data td.l { text-align: left; }
.caption { font-size: .82rem; color: var(--ink-3); margin-top: 10px; max-width: 80ch; }

/* ---------- glossary chips ---------- */
.glossary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.glossary div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.glossary dt { font-family: var(--f-display); font-size: 1.2rem; }
.glossary dd { margin: 0; color: var(--ink-3); font-size: .9rem; }
@media (max-width: 860px) { .glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- distance bars ---------- */
.dist { display: grid; gap: 18px; }
.dist-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 16px; align-items: center; }
.dist-row .name { font-size: .96rem; }
.dist-row .name small { display: block; color: var(--ink-3); font-size: .82rem; }
.dist-row .bar { display: flex; align-items: center; gap: 12px; }
.dist-row .bar i { display: block; height: 10px; background: var(--accent); border-radius: 0 3px 3px 0; min-width: 4px; }
.dist-row .bar span { font-family: var(--f-mono); font-size: .82rem; white-space: nowrap; color: var(--ink-2); }
@media (max-width: 600px) { .dist-row { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery .slot:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; min-height: 320px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery .slot:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16/10; min-height: 0; } }

/* ---------- people ---------- */
.people { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.person { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); padding-block: 32px; border-bottom: 1px solid var(--rule); }
.portrait { width: 120px; height: 140px; object-fit: cover; filter: grayscale(1); border-radius: var(--radius); }
.monogram { width: 120px; height: 140px; border-radius: var(--radius); background: var(--tint); display: grid; place-items: center; font-family: var(--f-display); font-size: 2rem; color: var(--accent); position: relative; overflow: hidden; }
.person h2 { font-family: var(--f-display); font-size: 1.7rem; }
.person .role { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cowrie); margin-top: 4px; }
.person .prose { margin-top: 14px; }
@media (max-width: 600px) { .person { grid-template-columns: 1fr; } .monogram, .portrait { width: 88px; height: 100px; font-size: 1.6rem; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 20px; padding-block: 18px; border-bottom: 1px solid var(--rule); }
.timeline .d { font-family: var(--f-mono); font-size: .86rem; color: var(--cowrie); padding-top: 2px; }
.timeline p { color: var(--ink-2); }
.timeline b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- project card ---------- */
.project-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.project-card .slot { border-radius: 0; aspect-ratio: auto; min-height: 340px; }
.project-card .body { padding: clamp(24px, 3.5vw, 44px); display: grid; gap: 18px; align-content: start; }
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c2) 25%, transparent); }
.pipeline { border: 1px dashed var(--ink-3); border-radius: var(--radius); padding: 24px; display: grid; gap: 8px; color: var(--ink-2); }
@media (max-width: 860px) { .project-card { grid-template-columns: 1fr; } .project-card .slot { min-height: 240px; } }


/* real photographs inside image slots */
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot:has(img)::before { display: none; }
.slot:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.38)); pointer-events: none; }
.slot figcaption, .slot .tag { z-index: 1; }
.slot.contain { background: #fff; }
.slot.contain img { object-fit: contain; padding: 10px; }
.slot.contain::after { display: none; }
.slot.contain figcaption span { background: rgba(8, 28, 20, .7); }

/* ---------- Ulifushi section pages ---------- */
.subnav { background: var(--surface); border-bottom: 1px solid var(--rule); }
.subnav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.subnav .links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; overscroll-behavior-inline: contain; }
.subnav .links::-webkit-scrollbar { display: none; }
.subnav .links a { color: var(--ink-2); text-decoration: none; font-size: .9rem; padding: 7px 11px; border-radius: 3px; white-space: nowrap; }
.subnav .links a:hover { color: var(--ink); background: var(--tint); }
.subnav .links a[aria-current="page"] { color: var(--green); background: var(--tint); font-weight: 600; }
.subnav .dev { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cowrie); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.subnav .dev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c2); }
@media (max-width: 960px) { .subnav .dev { display: none; } }

.u-hero { position: relative; min-height: clamp(360px, 52vw, 520px); display: flex; align-items: flex-end; overflow: hidden; background: var(--deep); }
.u-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.u-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,28,20,.10) 0%, rgba(6,28,20,.25) 45%, rgba(6,28,20,.82) 100%); }
.u-hero .wrap { position: relative; z-index: 1; padding-block: 56px 44px; display: grid; gap: 14px; width: 100%; }
.u-hero .eyebrow { color: #E6CD95; }
.u-hero .display { color: #FFFFFF; }
.u-hero p { color: #EEF3EF; max-width: 62ch; font-size: clamp(1.02rem, 1.7vw, 1.2rem); }
.u-hero .credit { position: absolute; right: 16px; bottom: 10px; z-index: 1; font-size: .72rem; color: rgba(255,255,255,.8); }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.feature + .feature { margin-top: clamp(48px, 7vw, 88px); }
.feature.flip > :first-child { order: 2; }
.feature .copy { display: grid; gap: 16px; align-content: start; }
.feature .copy p { color: var(--ink-2); }
.feature .pics { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.feature .pics .slot:first-child { grid-column: 1 / -1; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature.flip > :first-child { order: 0; } }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--ink-2); }
.pill.gold { background: color-mix(in srgb, var(--c2) 18%, transparent); color: var(--ink); }

.residences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.residence { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--c2); }
.residence h3 { font-family: var(--f-display); font-size: 1.35rem; color: var(--green); }
.residence p { color: var(--ink-2); font-size: .96rem; }
@media (max-width: 860px) { .residences { grid-template-columns: 1fr; } }

.explore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 24px); }
.explore a { display: grid; gap: 0; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.explore a:hover { border-color: var(--accent); }
.explore .slot { border-radius: 0; aspect-ratio: 16 / 10; }
.explore .t { padding: 16px 18px 18px; display: grid; gap: 4px; }
.explore .t b { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; color: var(--green); }
.explore .t span { font-size: .92rem; color: var(--ink-2); }
@media (max-width: 860px) { .explore { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .explore { grid-template-columns: 1fr; } }

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 32px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.4rem; color: var(--cowrie); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 70ch; }

.quote { font-family: var(--f-display); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.3; color: var(--green); max-width: 30ch; }
.on-deep .quote { color: var(--deep-ink); }

/* ---------- restrained project motion ---------- */
.hero-experience h1.display { font-size: clamp(2.5rem, 5.5vw, 4.7rem); letter-spacing: -.018em; }
.hero-experience__visual { border: 1px solid var(--rule); }
.on-deep .jaali { opacity: .018; }

.development-graphic {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px); list-style: none; margin: 0 0 clamp(40px, 5vw, 64px);
  padding: 28px 0 0; border-top: 1px solid rgba(255,255,255,.18);
}
.development-graphic::after {
  content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px;
  background: rgba(231, 238, 227, .62); transform-origin: left center;
}
.development-graphic li { position: relative; display: grid; gap: 5px; align-content: start; }
.development-graphic li::before {
  content: ""; position: absolute; z-index: 1; left: 0; top: -34px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid rgba(231, 238, 227, .7); background: var(--deep);
}
.development-graphic li.is-current::before { border-color: #d2b47a; background: #d2b47a; }
.development-graphic li span { font-family: var(--f-mono); color: #d2b47a; font-size: .69rem; letter-spacing: .11em; text-transform: uppercase; }
.development-graphic li:not(.is-current) span { color: var(--deep-ink-2); }
.development-graphic li strong { font-family: var(--f-display); color: var(--deep-ink); font-size: clamp(1.55rem, 2.5vw, 2.1rem); font-weight: 400; line-height: 1.2; }
.development-graphic li small { color: var(--deep-ink-2); font-size: .87rem; }
@media (max-width: 640px) {
  .development-graphic { grid-template-columns: 1fr; gap: 27px; margin-left: 5px; padding: 0 0 0 26px; border-top: 0; border-left: 1px solid rgba(255,255,255,.18); }
  .development-graphic::after { left: -1px; top: 0; width: 1px; height: 100%; transform-origin: center top; }
  .development-graphic li::before { left: -32px; top: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes divia-enter { from { transform: translateY(10px); } to { transform: none; } }
  .hero-experience .hero-copy, .page-hero .wrap, .u-hero .wrap { animation: divia-enter .68s cubic-bezier(.2,0,0,1) .08s both; }
  .motion-ready .development-graphic:not(.is-visible)::after { transform: scaleX(0); }
  .motion-ready .development-graphic.is-visible::after { transform: scaleX(1); transition: transform 1s cubic-bezier(.2,0,0,1); }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .motion-ready .development-graphic:not(.is-visible)::after { transform: scaleY(0); }
  .motion-ready .development-graphic.is-visible::after { transform: scaleY(1); }
}
