/* Layout: one fixed WebGL stage (the lamps) sits behind the page; the content
   scrolls over it in a text-left / object-right rhythm. Single dark theme by design: washi only glows in a night room. */
:root {
  --ink: #0f0d0a;          /* room */
  --ink-2: #171310;        /* raised band */
  --paper: #efe6d4;        /* text, washi tone */
  --paper-dim: #a59a8b;    /* secondary text */
  --brass: #caa266;        /* accent, from the fittings */
  --glow: #ffd6a0;         /* bulb light */
  --rule: rgba(239, 230, 212, .13);
  --display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --room: 1;               /* 1 = lights on, dims the UI a touch when off */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--body); font-size: 16px; line-height: 1.65; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* stage */
#stage { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#stage.dragging { cursor: grabbing; }
#pool { position: fixed; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen; opacity: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 40%), rgba(255, 206, 150, .11), rgba(255, 206, 150, 0) 62%); transition: opacity .6s; }
@media (hover: hover) { body.has-mouse #pool { opacity: var(--room); } }
#dim { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0; font-family: var(--mono); font-size: 12px; color: var(--paper-dim); letter-spacing: .06em; }
#dim .line { position: absolute; left: 0; width: 1px; background: var(--rule); }
#dim .line::before, #dim .line::after { content: ""; position: absolute; left: -5px; width: 11px; height: 1px; background: var(--paper-dim); }
#dim .line::before { top: 0; } #dim .line::after { bottom: 0; }
#dim .lab { position: absolute; left: 14px; white-space: nowrap; transform: translateY(-50%); text-shadow: 0 1px 8px rgba(15, 13, 10, .95), 0 0 2px rgba(15, 13, 10, 1); }
#dim .lab b { color: var(--paper); font-weight: 500; }
#hint { position: fixed; z-index: 2; pointer-events: none; opacity: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-dim); display: flex; align-items: center; gap: 10px; white-space: nowrap; transform: translateX(-50%); transition: opacity .5s; }
#hint svg { width: 22px; height: 22px; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }

main { position: relative; z-index: 2; pointer-events: none; }
main .col, nav, footer, .ticker, .stats .wrap, .contact .inner, .lamps-head, dialog { pointer-events: auto; }

/* veil (page load) */
#veil { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; place-items: center; transition: opacity .9s ease, visibility .9s; }
#veil.off { opacity: 0; visibility: hidden; }
#veil svg { width: 96px; height: 140px; overflow: visible; }
#veil .trace { fill: none; stroke: var(--brass); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace 1.3s ease-out forwards; }
#veil .fill { fill: var(--glow); opacity: 0; animation: fillin .5s ease-out .9s forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { opacity: .9; } }
#veil .mark { margin-top: 14px; font-family: var(--display); font-size: 20px; letter-spacing: .14em; color: var(--paper-dim); opacity: 0; animation: fillin .6s ease-out .6s forwards; }

/* nav */
nav { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 20; transition: background .4s, border-color .4s, backdrop-filter .4s; border-bottom: 1px solid transparent; }
nav.solid { background: rgba(15, 13, 10, .6); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-color: var(--rule); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .02em; text-decoration: none; }
.logo span { color: var(--brass); }
.logo i { width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px 3px rgba(255, 214, 160, calc(.7 * var(--room))); transition: box-shadow .6s, background .6s; }
body.off .logo i { background: #4a4238; }
nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; font-size: 14px; align-items: center; }
nav ul a { text-decoration: none; color: var(--paper-dim); position: relative; }
nav ul a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--brass); transition: right .3s; }
nav ul a:hover::after, nav ul a.on::after { right: 0; }
nav ul a:hover, nav ul a.on { color: var(--paper); }
/* pull cord: hangs from the top edge of the viewport beside the nav links. The button sits at the knob and is the real
   control; the line and the percentage are decoration. --cord is the rest length in px, unitless so the knob and label
   can be placed with calc(); app.js stretches the line (scaleY) and moves the knob (translateY) and sways the whole
   thing (rotate) around its anchor at the top. */
nav .wrap { position: relative; }
nav ul { padding-right: 44px; }
.pull { position: absolute; top: 0; right: max(16px, env(safe-area-inset-right, 0px)); width: 30px; --cord: 30; transform-origin: 50% 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pull .line { position: absolute; left: 50%; top: 0; width: 1px; height: calc(var(--cord) * 1px); margin-left: -.5px; transform-origin: 50% 0; background: linear-gradient(to bottom, rgba(239, 230, 212, .12), rgba(239, 230, 212, .3)); }
.cord { position: absolute; left: 0; top: calc(var(--cord) * 1px - 9px); width: 30px; height: 30px; padding: 0; margin: 0; border: 0; background: none; border-radius: 50%; cursor: grab; touch-action: none; display: grid; place-items: center; color: inherit; }
.pull.held .cord { cursor: grabbing; }
.cord:focus-visible { outline: none; }
.cord:focus-visible .knob { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--brass); }
.knob { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f3dcaa, var(--brass) 45%, #7d5f33 100%); box-shadow: 0 1px 3px rgba(0, 0, 0, .7), inset 0 -1px 1px rgba(0, 0, 0, .35); transition: filter .5s, transform .25s; }
.cord:hover .knob { transform: scale(1.12); }
body.off .knob { filter: saturate(.55) brightness(.72); }
.pct { position: absolute; right: calc(100% + 4px); top: calc(var(--cord) * 1px + 6px); transform: translateY(-50%); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--brass); white-space: nowrap; opacity: 0; transition: opacity .25s; pointer-events: none; text-shadow: 0 1px 8px rgba(15, 13, 10, .95); }
.pull.dimming .pct { opacity: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hero */
.hero { min-height: 100svh; display: grid; align-items: end; padding-block: 120px 72px; }
.hero > .wrap { width: 100%; }
.hero .col { max-width: 560px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(44px, 7vw, 96px); line-height: 1.02; margin: 18px 0 24px; letter-spacing: -.01em; text-wrap: balance; }
h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
/* The hero entrance waits for the veil: body.ready is set the moment the veil starts to lift, so the words rise
   while the room is still brightening instead of behind the cover. body.hero-in releases the clip afterwards so the
   glow on "light." is not cut off by the word wrappers. */
h1 .w > span { display: inline-block; transform: translateY(110%); }
body.ready h1 .w > span { animation: rise .9s cubic-bezier(.2, .7, .1, 1) both; animation-delay: calc(var(--i) * 90ms + .3s); }
body.hero-in h1 .w { overflow: visible; }
h1 em { font-style: normal; color: var(--brass); text-shadow: 0 0 28px rgba(255, 214, 160, calc(.45 * var(--room))); transition: text-shadow .6s; }
@keyframes rise { from { transform: translateY(110%); } to { transform: translateY(0); } }
.hero .eyebrow { opacity: 0; }
body.ready .hero .eyebrow { animation: fade .8s ease both .2s; }
.lede { max-width: 30em; color: var(--paper-dim); font-size: clamp(16px, 1.4vw, 19px); margin: 0 0 32px; opacity: 0; }
body.ready .lede { animation: fade .9s ease both .75s; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.actions { display: flex; gap: 14px; flex-wrap: wrap; opacity: 0; }
body.ready .actions { animation: fade .9s ease both .95s; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border: 1px solid var(--brass); color: var(--paper); text-decoration: none; font-size: 15px; border-radius: 999px; position: relative; overflow: hidden; isolation: isolate; transition: color .25s; }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--brass); transform: translateY(101%); transition: transform .35s cubic-bezier(.2, .7, .1, 1); z-index: -1; }
.btn:hover { color: var(--ink); } .btn:hover::before { transform: translateY(0); }
.btn.ghost { border-color: var(--rule); } .btn.ghost::before { background: var(--paper); }
.cue { position: absolute; left: 50%; bottom: 22px; width: 1px; height: 56px; background: var(--rule); overflow: hidden; }
.cue::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--brass); animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { to { top: 110%; } }
.hero { position: relative; }

/* ticker */
.ticker { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: rgba(15, 13, 10, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--paper-dim); }
.ticker .track { display: flex; width: max-content; gap: 0; animation: slide 46s linear infinite; }
.ticker span { padding: 13px 0; white-space: nowrap; }
.ticker span::after { content: "·"; color: var(--brass); margin: 0 28px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* lamps */
/* heading and subtitle stay in the text column so they never sit on top of the first lamp */
.lamps-head .wrap { padding-block: 110px 40px; }
h2 { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4vw, 50px); margin: 0; text-wrap: balance; }
.lamps-head p { margin: 12px 0 0; color: var(--paper-dim); font-size: 14px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.lamp { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 46%) 1fr; align-items: center; padding-block: 60px; }
.lamp .col { min-width: 0; }
.lamp .jp { font-family: var(--display); color: var(--brass); font-size: 15px; letter-spacing: .12em; display: block; }
.lamp h3 { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 6vw, 84px); margin: 4px 0 2px; line-height: 1.02; letter-spacing: -.01em; }
.lamp h3 small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .14em; color: var(--paper-dim); margin-top: 10px; }
.lamp p { max-width: 30em; color: var(--paper-dim); margin: 20px 0 26px; }
dl.spec { display: grid; grid-template-columns: max-content 1fr; margin: 0 0 28px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--rule); max-width: 440px; }
dl.spec dt, dl.spec dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
dl.spec dt { color: var(--paper-dim); padding-right: 28px; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; display: flex; align-items: center; }
.buy { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 44px; }
.price { font-family: var(--display); font-size: 21px; }
.photo { position: relative; width: min(320px, 100%); aspect-ratio: 4 / 5; border: 0; padding: 0; background: var(--ink-2); cursor: zoom-in; transform: rotate(-2.2deg); transition: transform .5s cubic-bezier(.2, .7, .1, 1), box-shadow .5s; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); overflow: hidden; }
.photo:hover { transform: rotate(0) scale(1.02); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .9); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .1, 1), filter .8s; }
.photo:hover img { transform: scale(1.06); }
body.off .photo img { filter: brightness(.7) saturate(.85); }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper); background: linear-gradient(to top, rgba(15, 13, 10, .8), rgba(15, 13, 10, 0)); display: flex; justify-content: space-between; }

/* stats */
.stats .wrap { padding-block: 100px 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stat { border-top: 1px solid var(--brass); padding-top: 16px; min-width: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; font-variant-numeric: tabular-nums; }
.stat b small { font-size: .42em; color: var(--brass); margin-left: 4px; }
.stat > span { display: block; color: var(--paper-dim); font-size: 14px; margin-top: 10px; }

/* contact */
.contact .wrap { padding-block: 70px 110px; }
.contact .inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: end; border-top: 1px solid var(--rule); padding-top: 60px; }
.contact p { color: var(--paper-dim); max-width: 30em; }
.mail { display: grid; gap: 14px; }
.mail .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mail code { font-family: var(--mono); font-size: clamp(18px, 2.4vw, 28px); user-select: all; }
.copy { background: none; border: 1px solid var(--rule); color: var(--paper); font: 13px var(--body); padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: border-color .3s; }
.copy:hover { border-color: var(--brass); }
.subject { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--paper-dim); }
.subject b { color: var(--paper); font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: none; border: 1px solid var(--rule); color: var(--paper-dim); font: 13px var(--body); padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: all .25s; }
.chip.on, .chip:hover { border-color: var(--brass); color: var(--paper); }
.chip.on { background: rgba(202, 162, 102, .14); }
footer .wrap { padding-block: 26px 36px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--paper-dim); }

/* lightbox */
dialog { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 94vh; overflow: visible; }
dialog::backdrop { background: rgba(8, 7, 5, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
dialog img { max-height: 84vh; width: auto; max-width: 96vw; margin: 0 auto; }
dialog .cap { text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-dim); margin-top: 14px; }
dialog .x { position: absolute; top: -8px; right: 0; transform: translateY(-100%); background: none; border: 1px solid var(--rule); color: var(--paper); font: 13px var(--body); padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: border-color .3s; }
dialog .x:hover { border-color: var(--brass); }
dialog[open] { animation: lb-in .45s cubic-bezier(.2, .7, .1, 1); }
dialog[open]::backdrop { animation: lb-bg .45s ease; }
dialog.closing { animation: lb-out .25s ease forwards; }
dialog.closing::backdrop { animation: lb-bg-out .25s ease forwards; }
@keyframes lb-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes lb-bg { from { opacity: 0; } }
@keyframes lb-out { to { opacity: 0; transform: scale(.98); } }
@keyframes lb-bg-out { to { opacity: 0; } }

/* scroll-driven reveals: native where supported, plain visible elsewhere */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rv { animation: reveal linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
    @keyframes reveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  }
}
.no3d #stage, .no3d #dim, .no3d #hint { display: none; }
.no3d .lamp { grid-template-columns: 1fr 1fr; }
.no3d .photo { width: min(520px, 100%); transform: none; }

@media (max-width: 900px) {
  .hero { min-height: 100svh; align-items: end; padding-top: 46svh; padding-bottom: 48px; }
  .lede { margin-bottom: 24px; }
  .cue { display: none; } /* the stacked buttons reach the bottom edge, so the scroll cue would cut through them */
  .lamp, .contact .inner { grid-template-columns: 1fr; }
  .lamp { padding-top: 54svh; align-items: end; }
  .stats .wrap { grid-template-columns: 1fr 1fr; gap: 22px; }
  nav ul { gap: 16px; padding-right: 36px; } .pull { --cord: 24; }
  #dim, #hint { display: none; }
  .photo { width: min(260px, 70%); }
  /* a soft scrim behind every block of text that scrolls over a lamp; it fades out at both ends so no hard edge
     ever crosses the glow */
  .lamp .col, .hero .col, .lamps-head .wrap { position: relative; }
  .lamp .col, .hero .col { padding-top: 48px; }
  .lamp .col::before, .hero .col::before, .lamps-head .wrap::before { content: ""; position: absolute; left: -24px; right: -24px; top: 0; bottom: -80px; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 13, 10, 0) 0%, rgba(15, 13, 10, .9) 110px, rgba(15, 13, 10, .9) calc(100% - 120px), rgba(15, 13, 10, 0) 100%); }
  .lamps-head .wrap { padding-block: 80px 30px; }
  .lamps-head .wrap::before { top: -40px; bottom: -40px; background: linear-gradient(180deg, rgba(15, 13, 10, 0) 0%, rgba(15, 13, 10, .85) 70px, rgba(15, 13, 10, .85) calc(100% - 70px), rgba(15, 13, 10, 0) 100%); }
}
@media (max-width: 480px) { .stats .wrap { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) {
  h1 .w > span, .hero .eyebrow, .lede, .actions, #veil .trace, #veil .fill, #veil .mark, .ticker .track, .cue::after, #hint svg,
  dialog[open], dialog[open]::backdrop, dialog.closing, dialog.closing::backdrop { animation: none !important; }
  h1 .w > span { transform: none; } h1 .w { overflow: visible; } .hero .eyebrow, .lede, .actions { opacity: 1; }
  #veil .trace { stroke-dashoffset: 0; } #veil .fill, #veil .mark { opacity: 1; }
  .btn::before, .photo, .photo img { transition: none; }
}
