/* Finishes & Details: surface finishes, the edge studio and stone details ----------------- */

/* reveal on scroll (finishes.js adds .in) */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* shared */
.fx-dark { background: var(--night); color: var(--on-night); }
.fx-dark .lead, .fx-dark .muted { color: color-mix(in srgb, var(--on-night) 72%, transparent); }
.fx-dark .eyebrow { color: var(--highlight-2); }
.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-chips button {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: var(--pill);
  padding: 8px 15px; font: 600 .86rem var(--sans); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.fx-chips button:hover { border-color: var(--ink-2); }
.fx-chips button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.fx-chips .sep { width: 1px; background: var(--line-2); margin: 4px 6px; }
.fx-count { color: var(--muted); font-size: .86rem; margin-left: auto; align-self: center; }

.fx-meter { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.fx-meter i { position: relative; height: 5px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.fx-meter i::after {
  content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--lime)); transition: transform 1.1s cubic-bezier(.2,.7,.2,1) .25s;
}
.in .fx-meter i::after, .fx-meter.in i::after, .es-panel .fx-meter i::after { transform: scaleX(var(--v, 0)); }
.fx-dark .fx-meter i { background: rgba(255,255,255,.12); }

/* hub hero: a slowly drifting mosaic of real finishes */
.fx-hero { position: relative; overflow: hidden; padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 6vw, 88px); isolation: isolate; }
.fx-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.fx-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); line-height: 1.02; margin: 14px 0 18px; max-width: 13ch; }
.fx-hero h1 em { font-style: italic; color: var(--highlight-2); }
.fx-hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.fx-stats { display: flex; gap: clamp(18px, 3vw, 40px); margin-top: 34px; }
.fx-stats strong { display: block; font: 500 clamp(1.8rem, 3vw, 2.4rem)/1 var(--display); color: #fff; }
.fx-stats span { font-size: .8rem; color: color-mix(in srgb, var(--on-night) 65%, transparent); }
.fx-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(92px, 11vw, 150px); gap: 10px; transform: rotate(-4deg) scale(1.04); }
.fx-mosaic figure { margin: 0; position: relative; overflow: hidden; border-radius: calc(12px * var(--r)); opacity: 0; transform: translateY(30px) scale(.96);
  animation: fx-tile .9s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
.fx-mosaic figure:nth-child(3n+2) { margin-top: -30px; margin-bottom: 30px; }
.fx-mosaic img { width: 100%; height: 100%; object-fit: cover; animation: fx-drift 18s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -2s); }
.fx-mosaic figcaption { position: absolute; left: 8px; bottom: 8px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(18,21,18,.62); color: #fff; padding: 3px 8px; border-radius: var(--pill); backdrop-filter: blur(4px); }
@keyframes fx-tile { to { opacity: 1; transform: none; } }
@keyframes fx-drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.16) translate(-3%, -2%); } }

/* finish cards */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(16px, 2vw, 26px); }
.fx-card { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.fx-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.fx-card .media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.fx-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.fx-card:hover .media img { transform: scale(1.06); }
.sheen::after {
  content: ""; position: absolute; inset: -20% -60%; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.85) 50%, transparent 62%); transform: translateX(-70%);
}
.fx-card:hover .sheen::after { animation: fx-sheen 1.1s ease-out; }
@keyframes fx-sheen { to { transform: translateX(70%); } }
.fx-card .body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.fx-card h3 { font-size: 1.32rem; margin: 0; }
.fx-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.fx-card .meters { display: grid; gap: 6px; margin-top: 4px; }
.fx-card .tags { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* edges teaser + cards */
.fx-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.ec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.ec-card {
  display: grid; gap: 8px; text-align: left; padding: 14px 14px 16px; border-radius: var(--radius); cursor: pointer; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s;
}
.ec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.ec-card[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.ec-card .art { aspect-ratio: 16 / 10; display: grid; place-items: center; border-radius: calc(10px * var(--r)); background: linear-gradient(160deg, var(--bg), var(--bg-2)); }
.ec-card strong { font: 500 1.06rem/1.2 var(--display); }
.ec-card small { color: var(--muted); font-size: .78rem; }
.ec-card .rate { display: flex; gap: 10px; font-size: .72rem; color: var(--muted); }
.ec-card .rate b { color: var(--ink-2); font-weight: 700; }
.ec-svg { width: 82%; height: auto; overflow: visible; }
.ec-fill { fill: color-mix(in srgb, var(--ink) 10%, var(--surface)); opacity: 0; transition: opacity .8s ease .9s; }
.ec-line { opacity: 0; fill: none; stroke: var(--brand); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 200); stroke-dashoffset: var(--len, 200); transition: stroke-dashoffset 1.4s cubic-bezier(.6,.1,.2,1); transition-delay: calc(var(--i, 0) * 90ms); }
.ec-seam { fill: none; stroke: var(--bronze); stroke-width: .5; stroke-dasharray: 1.5 1.2; opacity: 0; transition: opacity .6s 1.3s; }
.ec-dot { fill: var(--lime); opacity: 0; transition: opacity .2s; }
.ec-card:hover .ec-dot { opacity: 1; }
.drawn .ec-line { stroke-dashoffset: 0; opacity: 1; }
.drawn .ec-fill, .drawn .ec-seam { opacity: 1; }
.fx-dark .ec-card { background: var(--night-2); border-color: rgba(255,255,255,.08); }
.fx-dark .ec-card .art { background: linear-gradient(160deg, #262b25, #1a1e19); }
.fx-dark .ec-card small, .fx-dark .ec-card .rate { color: color-mix(in srgb, var(--on-night) 60%, transparent); }
.fx-dark .ec-card .rate b { color: var(--on-night); }
.fx-dark .ec-fill { fill: #3a4038; }
.fx-dark .ec-line { stroke: var(--highlight-2); }

/* guide matrix */
.fx-guide { display: grid; border-top: 1px solid var(--line); }
.fx-guide > div { display: grid; grid-template-columns: minmax(150px, .7fr) 1fr 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.fx-guide h3 { margin: 0; font-size: 1.15rem; }
.fx-guide .label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: block; margin-bottom: 6px; }
.fx-guide .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-guide a.chip:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* details */
.dt-grid { columns: 4 240px; column-gap: 16px; }
.dt-card { break-inside: avoid; margin: 0 0 16px; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dt-card img { width: 100%; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.dt-card .ph { overflow: hidden; background: #fff; }
.dt-card:hover img { transform: scale(1.05); }
.dt-card .body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.dt-card strong { font: 500 1.02rem/1.25 var(--display); }
.dt-card small { color: var(--muted); font-size: .8rem; }
.dt-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dt-strip a { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.dt-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.dt-strip a:hover img { transform: scale(1.07); }

/* finish detail */
.fd-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.fd-photo { position: relative; border-radius: calc(18px * var(--r)); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); box-shadow: var(--shadow); }
.fd-photo img, .fd-photo .tex { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-photo .tex { min-height: 100%; }
.fd-photo::after {
  content: ""; position: absolute; inset: -30% -80%; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(100deg, transparent 40%, rgba(255,255,255,.9) 50%, transparent 60%);
  animation: fd-rake 6s cubic-bezier(.45,0,.2,1) infinite; animation-delay: 1s;
}
@keyframes fd-rake { 0% { transform: translateX(-60%); } 45%, 100% { transform: translateX(60%); } }
.fd-photo .hint { position: absolute; right: 12px; bottom: 12px; z-index: 1; }
.fd-hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 12px 0 10px; }
.fd-meters { display: grid; gap: 12px; margin: 22px 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fd-meters .fx-meter { grid-template-columns: 110px 1fr 28px; font-size: .86rem; }
.fd-meters .fx-meter i { height: 8px; }
.fd-meters .fx-meter b { color: var(--ink); text-align: right; }
.fd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.fd-facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fd-facts div:nth-child(odd) { padding-right: 18px; }
.fd-facts span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.fd-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 36px); counter-reset: step; position: relative; }
.fd-steps::before { content: ""; position: absolute; top: 22px; left: 22px; right: 22px; height: 2px; background: rgba(255,255,255,.14); }
.fd-steps::after { content: ""; position: absolute; top: 22px; left: 22px; right: 22px; height: 2px; background: linear-gradient(90deg, var(--lime), var(--highlight-2)); transform-origin: left; transform: scaleX(0); transition: transform 1.6s cubic-bezier(.6,.1,.2,1) .2s; }
.fd-steps.in::after { transform: scaleX(1); }
.fd-steps li { list-style: none; position: relative; z-index: 1; display: grid; gap: 14px; }
.fd-steps li::before { counter-increment: step; content: counter(step); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--night-2); border: 2px solid var(--highlight-2); color: #fff; font: 600 1.1rem var(--display); }
.fd-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(16px, 3vw, 32px); }
.fd-cols > div { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.fd-cols h3 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 1.15rem; }
.fd-cols p { margin: 0; color: var(--ink-2); }
.fd-cols .ok .ic { color: var(--ok); }
.fd-cols .no .ic { color: var(--danger); }
.fd-pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 22px; }
.fd-pager a { display: grid; gap: 2px; }
.fd-pager a small { color: var(--muted); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.fd-pager a strong { font: 500 1.3rem var(--display); }
.fd-pager a:last-child { text-align: right; }

/* edge studio */
.es { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 0; border-radius: calc(22px * var(--r)); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); scroll-margin-top: 90px; }
.es-stage {
  position: relative; min-height: clamp(340px, 46vw, 560px); display: grid; place-items: center; cursor: grab; touch-action: pan-y; outline: none;
  background: radial-gradient(120% 90% at 30% 20%, #3b4239 0%, #1d221c 55%, #121512 100%);
}
.es-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--lime); }
.es-stage.dragging { cursor: grabbing; }
.es-svg { width: 100%; height: 100%; position: absolute; inset: 0; padding: 4% 6% 8%; overflow: visible; }
.es-shadow { fill: #000; opacity: .45; filter: blur(6px); }
.es-cap-shade { fill: #000; fill-opacity: .1; stroke: rgba(255,255,255,.55); stroke-width: .35; }
.es-seams path { fill: none; stroke: rgba(255,255,255,.55); stroke-width: .5; stroke-dasharray: 2 1.4; }
.es-ghost { fill: none; stroke: var(--highlight-2); stroke-width: .6; stroke-dasharray: 2 2; opacity: 0; transition: opacity .6s; }
.es-ghost.on { opacity: .85; }
.es-dims path { fill: none; stroke: rgba(255,255,255,.5); stroke-width: .4; }
.es-dims text { fill: rgba(255,255,255,.75); font: 600 5.5px var(--sans); }
.es-hud { position: absolute; left: 18px; top: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.es-hud .chip { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); backdrop-filter: blur(6px); }
.es-nav { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; }
.es-nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.es-nav button:hover { background: rgba(255,255,255,.2); }
.es-nav .ic { width: 18px; height: 18px; }
.es-nav [data-es-step="-1"] .ic { transform: scaleX(-1); }
.es-drag { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: rgba(255,255,255,.55); font-size: .78rem; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.es-drag .ic { width: 16px; height: 16px; animation: es-nudge 2.4s ease-in-out infinite; }
@keyframes es-nudge { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.es-panel { padding: clamp(22px, 3vw, 34px); display: grid; gap: 16px; align-content: start; border-left: 1px solid var(--line); }
.es-panel h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 0; line-height: 1.05; }
.es-panel .aka { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.es-panel p { margin: 0; color: var(--ink-2); }
.es-panel .fx-meter { grid-template-columns: 112px 1fr; font-size: .84rem; }
.es-panel .fx-meter i { height: 7px; }
.es-panel .fx-meter i::after { transition-delay: 0s; transition-duration: .7s; }
.es-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; margin: 0; }
.es-kv dt { color: var(--muted); }
.es-kv dd { margin: 0; font-weight: 600; }
.es-kv .cost { letter-spacing: .12em; font-family: var(--mono); }
.es-note { font-size: .82rem; background: var(--lime-soft); color: var(--lime-ink); padding: 8px 12px; border-radius: var(--radius-sm); }
.es-row { display: grid; gap: 8px; }
.es-row > span { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; }
.es-row > span em { font-style: normal; letter-spacing: 0; text-transform: none; color: var(--ink-2); font-weight: 600; }
.es-stones { display: flex; gap: 8px; flex-wrap: wrap; }
.es-stones button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); background: center / cover; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.es-stones button:hover { transform: scale(1.08); }
.es-stones button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand); }
.es-panel .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.eg-section { display: grid; gap: 16px; padding: 26px 0; border-top: 1px solid var(--line); }
.eg-section header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.eg-section h3 { margin: 0; font-size: 1.5rem; }
.eg-section header p { margin: 0; color: var(--muted); }
.ek-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 32px); }
.ek-steps > div { display: grid; gap: 8px; align-content: start; }
.ek-steps strong { font: 500 1.25rem var(--display); }
.ek-steps p { margin: 0; }
.ek-steps .num { font: 500 2.6rem/1 var(--display); color: var(--highlight-2); }

/* the Finishes nav item lights up on its pages */
.nav-item > button[aria-current="page"] { background: color-mix(in srgb, var(--brand) 9%, transparent); }
/* eight items: tighten the bar before it folds into the menu */
@media (max-width: 1240px) and (min-width: 961px) {
  .nav > a, .nav-item > button { padding: 9px 9px; font-size: .9rem; }
  .brand small { display: none; }
}

@media (max-width: 1000px) {
  .fx-hero .wrap, .fx-split, .fd-hero, .es { grid-template-columns: 1fr; }
  .fx-mosaic { transform: none; }
  .es-panel { border-left: 0; border-top: 1px solid var(--line); }
  .fd-cols { grid-template-columns: 1fr; }
  .fx-guide > div { grid-template-columns: 1fr 1fr; }
  .fx-guide > div h3 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .fx-mosaic { grid-template-columns: repeat(2, 1fr); }
  .fx-mosaic figure:nth-child(n+5) { display: none; }
  .fd-steps, .ek-steps { grid-template-columns: 1fr; }
  .fd-steps::before, .fd-steps::after { display: none; }
  .fd-facts { grid-template-columns: 1fr; }
  .fx-guide > div { grid-template-columns: 1fr; }
  .dt-strip { grid-template-columns: 1fr 1fr; }
  .fx-count { margin-left: 0; width: 100%; }
  .es-drag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .fx-mosaic figure { opacity: 1; transform: none; }
}
