/* ELUD studio layer (web-art-direction). Loaded after site.css on every page.

   Thesis      "The quiet object": a warm linen studio, one object under one softbox, type that
               states things calmly at a large scale.
   Grid        12 columns; heroes split 5 / 7 (words / object). Sections open on a mono index.
   Type        Manrope display at 0.9 line-height and -0.05em tracking. Inter body. JetBrains Mono for indices only.
   Colour      Brand monochrome. One dark chapter per page for rhythm (data-theme="dark" on the section).
               Signal orange stays on the device's status light only.
   Signature   The device at 45 degrees, which you can turn. Everything else stays calm.
   Motion      One ease (--elud-ease). Headline lines rise in once. Reveals are scroll-driven.
               Cross-document view transitions carry the device from tile to product page.
               Reduced motion: no line rise, no pin, no scroll turn, no transitions. */

:root { --studio-light: rgb(255 255 255 / .8); --studio-floor: rgb(59 57 52 / .07); --studio-radius: 28px; }
[data-theme="dark"] { --studio-light: rgb(255 244 228 / .07); --studio-floor: rgb(0 0 0 / .28); }

/* ---------- type scale ---------- */
.display { font-weight: 450; letter-spacing: -.05em; line-height: .9; }
.h2 { font: 450 clamp(34px, 4.4vw, 64px)/1.02 var(--elud-font-display); letter-spacing: -.035em; }
.lead { font-size: clamp(17px, 1.35vw, 20px); }
.sec-idx { display: flex; align-items: center; gap: 14px; font: 500 11px/1 var(--elud-font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--elud-muted); margin-bottom: 22px; }
.sec-idx span { color: var(--elud-fg); }
.sec-idx::after { content: ""; flex: 0 1 96px; height: 1px; background: var(--elud-border); }
.center .sec-idx, .closing .sec-idx { justify-content: center; }

/* ---------- kinetic headline (kinetic-typography): masked lines rise once, weight settles ---------- */
.kt-line { display: block; overflow: clip; overflow-clip-margin: .14em; padding-bottom: .02em; }
.kt-line > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .kt-line > span { animation: kt-rise 1100ms var(--elud-ease) both, kt-weight 1500ms var(--elud-ease) both; animation-delay: 120ms; }
  .kt-line:nth-child(2) > span { animation-delay: 210ms; }
  .kt-line:nth-child(3) > span { animation-delay: 300ms; }
}
@keyframes kt-rise { from { translate: 0 108%; } }
@keyframes kt-weight { from { font-weight: 300; } }

/* ---------- 3D viewer ---------- */
.viewer { border-radius: var(--studio-radius); box-shadow: none; aspect-ratio: 16 / 10;
          background-color: var(--elud-surface-2);
          background-image: radial-gradient(120% 90% at 28% 14%, var(--studio-light), transparent 62%),
                            linear-gradient(180deg, transparent 56%, var(--studio-floor)), var(--elud-texture); }
.viewer.hero { aspect-ratio: 1 / 1; }
.viewer-poster, .viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer-poster { object-fit: cover; transition: opacity 500ms var(--elud-ease); }
.viewer canvas { opacity: 0; transition: opacity 500ms var(--elud-ease); }
/* First visit uses the Open Design art-directed poster, not a GPU-dependent first frame.
   Turn/drag/keyboard/mode input activates the actual WebGL canvas. */
.viewer.is-live.is-engaged canvas { opacity: 1; }
.viewer.is-live.is-engaged .viewer-poster { opacity: 0; }
.viewer-surface { position: absolute; inset: 0; z-index: 2; cursor: grab; touch-action: pan-y; border-radius: inherit; }
.viewer.is-dragging .viewer-surface { cursor: grabbing; }
.viewer-surface:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--elud-ink), inset 0 0 0 4px var(--elud-surface); }
.no-gl .viewer-surface { cursor: auto; }
.viewer .tag { z-index: 3; box-shadow: none; }
.viewer .caption-note { position: absolute; z-index: 3; right: 18px; top: 18px; max-width: 24ch; text-align: right; font-size: 12px; color: var(--elud-muted); }
.viewer-hint { position: absolute; z-index: 3; left: 18px; bottom: 26px; display: flex; align-items: center; gap: 10px; font: 500 11px/1 var(--elud-font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--elud-muted); pointer-events: none; transition: opacity 400ms var(--elud-ease); }
.viewer-hint i { width: 26px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 14' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3 1 7l4 4M21 3l4 4-4 4M1 7h24'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 14' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3 1 7l4 4M21 3l4 4-4 4M1 7h24'/%3E%3C/svg%3E") center / contain no-repeat; }
.viewer.has-turned .viewer-hint { opacity: 0; }
.viewer-ctrl { position: absolute; z-index: 3; right: 14px; bottom: 14px; display: flex; gap: 2px; padding: 4px; border-radius: 999px; border: var(--elud-line);
               background: color-mix(in srgb, var(--elud-surface) 84%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.viewer-ctrl button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--elud-fg); display: grid; place-items: center; cursor: pointer;
                      font: 500 12px/1 var(--elud-font-mono); letter-spacing: .02em; transition: background-color var(--elud-dur-hover-out) var(--elud-ease); }
.viewer-ctrl button:hover { background: var(--elud-surface-2); transition-duration: var(--elud-dur-hover-in); }
.viewer-ctrl button:active { transform: scale(.94); }
.viewer-ctrl button:focus-visible { outline: none; box-shadow: var(--elud-focus); }
.viewer-ctrl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.viewer .viewer-ctrl .pause { position: static; display: none; width: 44px; height: 44px; border: 0; box-shadow: none; background: transparent; }
.viewer .viewer-ctrl .pause svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: no-preference) { .viewer .viewer-ctrl .pause { display: grid; } }
.no-gl .viewer-ctrl, .no-gl .viewer-hint,
.viewer-fallback .viewer-ctrl, .viewer-fallback .viewer-hint { display: none; }
.viewer-fallback .viewer-surface { cursor: auto; }
.viewer .engrave-preview { position: absolute; z-index: 3; left: 18px; bottom: 58px; font: 500 12px/1 var(--elud-font-mono); letter-spacing: .06em; color: var(--elud-fg);
                           background: var(--elud-surface); border: var(--elud-line); border-radius: var(--elud-radius-chip); padding: 8px 10px; }
.viewer .engrave-preview::before { content: "Engraving · "; color: var(--elud-muted); }

/* ---------- tiles: 45-degree renders on the studio surface ---------- */
.ptile { background: transparent; border: 0; padding: 0; gap: 14px; border-radius: 0; }
.ptile:hover { border-color: transparent; }
.tiles-4 .ptile { padding: 0; }
.tile-media { position: relative; aspect-ratio: 16 / 11; border-radius: 22px; overflow: hidden;
              background-color: var(--elud-surface-2);
              background-image: radial-gradient(120% 90% at 28% 14%, var(--studio-light), transparent 62%), linear-gradient(180deg, transparent 56%, var(--studio-floor)); }
.tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--elud-ease); }
.tile-media .tag { position: absolute; left: 14px; top: 14px; font: 500 10px/1 var(--elud-font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--elud-muted);
                   background: var(--elud-surface); border: var(--elud-line); border-radius: var(--elud-radius-chip); padding: 6px 8px; }
.ptile h3 { transition: color var(--elud-dur-hover-out) var(--elud-ease); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .ptile:hover .tile-media img { transform: translateY(-2.5%) scale(1.045); }
}
.ptile:focus-visible { outline: none; }
.ptile:focus-visible .tile-media { box-shadow: var(--elud-focus); }

/* ---------- home hero ---------- */
.hero-studio { padding: clamp(28px, 4vw, 56px) 0 clamp(48px, 6vw, 88px); }
.hs-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.hs-copy .display { font-size: clamp(60px, 8.6vw, 140px); margin: 4px 0 28px; }
.hs-copy .lead { max-width: 36ch; margin-bottom: 32px; }
.hs-foot { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: var(--elud-line); margin-top: clamp(32px, 5vw, 64px); }
.hs-foot li { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 4px; padding: 22px 24px 0 0; }
.hs-foot li + li { padding-left: 24px; border-left: var(--elud-line); }
.hs-foot .idx { grid-row: span 2; padding-top: 5px; }
.hs-foot b { font: 500 20px/1.2 var(--elud-font-display); letter-spacing: -.01em; }
.hs-foot span:last-child { color: var(--elud-muted); font-size: 15px; }

/* ---------- pinned product story (ELUD One) ---------- */
.story { padding: clamp(16px, 2vw, 32px) 0 clamp(48px, 6vw, 96px); }
.story-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 88px); align-items: start; }
.story-stage { position: sticky; top: calc(64px + 56px + 24px); }
.story-stage .viewer.hero { aspect-ratio: auto; height: min(78vh, 760px); }
.story-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.story-step .h2 { margin-bottom: 18px; }
.story-intro { min-height: 78vh; }
.story-intro .display { font-size: clamp(60px, 8vw, 128px); margin: 18px 0 18px; }
.story-intro .sub-title { font: 450 clamp(24px, 2.4vw, 34px)/1.2 var(--elud-font-display); letter-spacing: -.02em; color: var(--elud-fg); max-width: 18ch; margin-bottom: 18px; }
.story-intro .lead { margin-bottom: 30px; }
@media (prefers-reduced-motion: reduce) {
  .story-stage { position: static; }
  .story-step { min-height: 0; padding: 32px 0; }
}

/* ---------- dark chapter ---------- */
.chapter { background-color: var(--elud-bg); color: var(--elud-fg); }
.chapter .lead, .chapter p { color: var(--elud-muted); }
.chapter .h2, .chapter h3 { color: var(--elud-fg); }
.section.chapter + .section { border-top: 0; }
.chapter .principles { counter-reset: p; border-top-color: var(--elud-border); }
.chapter .principles li { counter-increment: p; grid-template-columns: 72px minmax(180px, 1fr) 2fr; border-bottom-color: var(--elud-border); padding: 34px 0; }
.chapter .principles li::before { content: counter(p, decimal-leading-zero); font: 500 12px/1.8 var(--elud-font-mono); letter-spacing: .1em; color: var(--elud-muted); }
.chapter .principles h3 { font: 450 clamp(24px, 2.4vw, 36px)/1.1 var(--elud-font-display); letter-spacing: -.025em; }

/* ---------- render figures (stand-ins until photography) ---------- */
.render-fig { margin: 0; border-radius: var(--studio-radius); overflow: hidden; position: relative; aspect-ratio: 16 / 11;
              background-color: var(--elud-surface-2);
              background-image: radial-gradient(120% 90% at 28% 14%, var(--studio-light), transparent 62%), linear-gradient(180deg, transparent 56%, var(--studio-floor)), var(--elud-texture); }
.render-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.render-fig figcaption { position: absolute; left: 18px; right: 18px; bottom: 16px; font-size: 12px; color: var(--elud-muted); }

/* ---------- sections and generic upgrades ---------- */
.section { padding: clamp(80px, 10vw, 152px) 0; }
.section-head { max-width: 760px; }
.center .section-head, .section-head.center { margin-left: auto; margin-right: auto; }
.p-hero .h1 { font-size: clamp(52px, 7.4vw, 112px); letter-spacing: -.05em; line-height: .92; font-weight: 450; }
.btn-lg { border-radius: 999px; }
.closing .h1, .closing .h2 { font-size: clamp(40px, 5.6vw, 88px); letter-spacing: -.045em; line-height: .96; }
.u-stage-gap .viewer { aspect-ratio: 16 / 9; }

/* ---------- cross-document view transitions (modern-css-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .vt-one { view-transition-name: device-one; } .vt-clip { view-transition-name: device-clip; }
  .vt-shift { view-transition-name: device-shift; } .vt-shell { view-transition-name: device-shell; }
  .vt-park { view-transition-name: device-park; } .vt-sweep { view-transition-name: device-sweep; }
  ::view-transition-group(*) { animation-duration: 640ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
  ::view-transition-old(root) { animation: 240ms cubic-bezier(.7, 0, .84, 0) both vt-out; }
  ::view-transition-new(root) { animation: 640ms cubic-bezier(.16, 1, .3, 1) both vt-in; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 12px; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hs-grid, .story-grid { grid-template-columns: 1fr; }
  .hs-stage { order: -1; }
  .viewer.hero { aspect-ratio: 1 / 1; }
  .story-stage { position: static; }
  .story-stage .viewer.hero { height: auto; aspect-ratio: 1 / 1; }
  .story-step, .story-intro { min-height: 0; padding: 28px 0; }
  .story-steps { order: 0; }
  .hs-foot { grid-template-columns: 1fr; }
  .hs-foot li + li { padding-left: 0; border-left: 0; border-top: var(--elud-line); }
  .hs-foot li { padding-bottom: 18px; }
  .chapter .principles li { grid-template-columns: 48px 1fr; }
  .chapter .principles li p { grid-column: 2; }
}
@media (max-width: 520px) {
  .viewer-hint { display: none; }
  .viewer .caption-note { display: none; }
}

/* ---------- editorial steps (replaces boxed cards) ---------- */
.steps { gap: clamp(20px, 3vw, 48px); }
.steps li { background: transparent; border: 0; border-top: 1px solid var(--elud-fg); border-radius: 0; padding: 22px 0 0; }
.steps h3 { font: 450 clamp(26px, 2.6vw, 40px)/1.08 var(--elud-font-display); letter-spacing: -.03em; margin: 18px 0 12px; }
.steps p { max-width: 34ch; }
.ptile .chip { align-self: flex-start; }
.highlights b { font-weight: 450; letter-spacing: -.03em; }
.faq summary { font-size: 17px; }

/* Inputs at 16px on touch-sized screens: smaller text makes mobile browsers (iOS Safari, Android Chrome) zoom on focus,
   which pushed the fixed reserve bar and its submit button off-screen. */
@media (max-width: 760px) { .input, .select, textarea { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .viewer-poster, .viewer canvas, .viewer-hint, .tile-media img { transition: none; }
}
.closing .actions { justify-content: center; }
.p-hero .h1 { margin-bottom: 28px; padding-bottom: .04em; }

/* five concepts (Shift, Shell, Veil, Park, Sweep) */
main .tiles-4, main .fam-4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { main .tiles-4, main .fam-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { main .tiles-4, main .fam-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { main .tiles-4, main .fam-4 { grid-template-columns: 1fr; } }

/* planned modes (ELUD One): native radios that drive the model's status light */
.modes { border: 0; padding: 0; margin: 22px 0 6px; display: grid; gap: 8px; max-width: 440px; }
.modes legend { margin-bottom: 10px; }
.mode { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; border: var(--elud-line); border-radius: 14px; background: var(--elud-surface); cursor: pointer; transition: border-color var(--elud-dur-hover-out) var(--elud-ease); }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode:has(input:checked) { border-color: var(--elud-fg); box-shadow: inset 0 0 0 1px var(--elud-fg); }
.mode:has(input:focus-visible) { box-shadow: var(--elud-focus); }
.mode b { display: block; font: 500 15px/1.3 var(--elud-font-display); }
.mode span span { display: block; font-size: 13px; color: var(--elud-muted); }
.mode-dot { width: 10px; height: 10px; border-radius: 50%; grid-column: 1; }
.mode > span:last-child { grid-column: 2 / 4; }
.m-silent { background: #f4ecd6; box-shadow: 0 0 0 1px var(--elud-border), 0 0 10px 2px rgb(244 236 214 / .9); }
.m-adaptive { background: #3d7dff; box-shadow: 0 0 10px 2px rgb(61 125 255 / .55); }
.m-maximum { background: var(--elud-signal); box-shadow: 0 0 10px 2px rgb(255 90 31 / .5); }

/* A precise, readable hero without ultra-long line wraps. */
.hs-copy .display { font-size: clamp(48px, 6.3vw, 108px); line-height: .94; }
.viewer-angle { position: absolute; z-index: 3; right: 22px; bottom: 72px; font: 500 12px/1.2 var(--elud-font-mono); color: var(--elud-muted); }
.viewer-fallback .viewer-angle, .no-gl .viewer-angle { display: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }
@media (max-width: 520px) { .hs-copy .display { font-size: clamp(46px, 11vw, 70px); } }

/* Render-fit: keep the object fully visible when the 2:1 source meets a tall tile. */
.tiles-2 .tile-media img { object-fit: contain; padding: clamp(8px, 1.5vw, 18px); }
