/* NAMMINI prototype. Colours and faces are custom properties the picker sets (app.js);
   html[data-design] switches between the three designs: erdve, brezinys, galerija. */

@font-face { font-family: 'Playfair Display'; src: url(fonts/playfair-display-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Playfair Display'; src: url(fonts/playfair-display-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }
@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Manrope'; src: url(fonts/manrope-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02FF, U+1E00-1EFF; }

:root {
  --bg: #F3F0EA; --ink: #171615; --muted: #6E6860; --line: #DAD3C8; --card: #E9E4DC; --accent: #B08A3E;
  --head: 'Playfair Display', Georgia, serif; --body: 'Manrope', system-ui, sans-serif; --hw: 500; --track: -0.01em;
  --gut: clamp(16px, 4vw, 56px);
  --t: 0;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 clamp(15px, 1.05vw, 17px)/1.6 var(--body);
  transition: background-color .5s, color .5s;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: var(--hw); letter-spacing: var(--track); line-height: 1.04; margin: 0; text-wrap: balance; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut); pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: .28em; font-size: 13px; }
.mark { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center;
  font: 700 15px/1 var(--body); letter-spacing: 0; padding-bottom: 2px; }
.top nav { display: flex; gap: clamp(14px, 2.2vw, 32px); font-size: 13px; letter-spacing: .06em; }
.top nav a { text-decoration: none; position: relative; }
.top nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -3px; height: 1px; background: currentColor; transition: right .3s; }
.top nav a:hover::after { right: 0; }
.nav-cta { padding: 7px 14px; border: 1px solid currentColor; border-radius: 99px; margin-top: -8px; }
.nav-cta::after { display: none; }
@media (max-width: 640px) { .top nav a:not(.nav-cta) { display: none; } .word { display: none; } }

/* ---------- hero, 3D ---------- */
.hero3d { position: relative; height: 340vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#room { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s; }
.has3d #room { opacity: 1; }
.stage::before { /* while three.js loads, and without WebGL: a soft room-coloured glow */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 55% at 55% 55%, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg) 70%);
}
.has3d .stage::before { opacity: 0; transition: opacity 1s; }
.hero-copy { position: absolute; left: var(--gut); bottom: clamp(28px, 9vh, 96px); width: min(62vw, 1000px); z-index: 2; pointer-events: none;
  opacity: calc(1 - var(--t) * 3); transform: translateY(calc(var(--t) * -60px)); }
.hero-copy h1 { font-size: clamp(2.6rem, 6.4vw, 6.6rem); max-width: 11ch; }
.eyebrow { font: 600 12px/1 var(--body); letter-spacing: .3em; text-transform: uppercase; margin-bottom: 22px; color: var(--muted); }
.lede { margin-top: 20px; color: var(--muted); font-size: 15px; letter-spacing: .04em; }
.steps { position: absolute; right: var(--gut); bottom: clamp(28px, 9vh, 96px); list-style: none; margin: 0; padding: 0; z-index: 2;
  font: 500 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; display: grid; gap: 14px; text-align: right; }
.steps li { color: var(--muted); opacity: .55; transition: opacity .4s, color .4s, transform .4s; }
.steps li span { color: var(--accent); margin-right: 8px; }
.steps li.on { opacity: 1; color: var(--ink); transform: translateX(-10px); }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
  opacity: calc(1 - var(--t) * 6); }
.scroll-cue::after { content: ''; display: block; width: 1px; height: 36px; margin: 10px auto 0; background: currentColor; animation: cue 2s infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (max-width: 640px) { .steps { top: 84px; bottom: auto; } .hero-copy { width: auto; right: var(--gut); } }

/* ---------- hero, picture ---------- */
.hero-img { display: none; position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--card); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
.hero-img::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / .55)); }
.hero-img-copy { position: absolute; left: var(--gut); right: var(--gut); bottom: clamp(32px, 8vh, 88px); z-index: 2; color: #fff; }
.hero-img-copy .eyebrow { color: rgb(255 255 255 / .8); }
.hero-img-copy h1 { font-size: clamp(2.4rem, 6.4vw, 6.6rem); max-width: 16ch; }
.hero-img .scroll-cue { color: #fff; z-index: 2; }

/* ---------- sections ---------- */
section:not(.hero3d):not(.hero-img) { padding: clamp(72px, 14vh, 170px) var(--gut); }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 24px; }
.kicker { font: 600 12px/1.6 var(--body); letter-spacing: .3em; color: var(--accent); padding-top: .9em; }
.statement { font: var(--hw) clamp(1.6rem, 3.4vw, 3.3rem)/1.18 var(--head); letter-spacing: var(--track); max-width: 26ch; text-wrap: pretty; }
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; } }

.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(32px, 6vh, 72px); border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.sec-head h2 { font-size: clamp(2.2rem, 5vw, 4.8rem); }
.sec-head p { color: var(--muted); max-width: 30ch; }
@media (max-width: 640px) { .sec-head { flex-direction: column; align-items: start; } }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(20px, 3vw, 44px); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card a { display: block; text-decoration: none; }
.card .ph { overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), filter .8s; }
.card a:hover img { transform: scale(1.06); }
.meta { display: flex; align-items: baseline; gap: 14px; padding-top: 14px; }
.meta h3 { font-size: clamp(1.3rem, 2vw, 1.9rem); }
.meta .no { font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.meta .kind { margin-left: auto; font-size: 12px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }

.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.feature figure { margin: 0; overflow: hidden; aspect-ratio: 4 / 3; background: var(--card); }
.feature img { width: 100%; height: 100%; object-fit: cover; }
.feature blockquote { margin: 0; font: var(--hw) clamp(1.4rem, 2.4vw, 2.3rem)/1.22 var(--head); letter-spacing: var(--track); }
.feature blockquote::before { content: '“'; display: block; color: var(--accent); font-size: 3em; line-height: .6; height: .45em; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } }

.svc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.svc li { border-top: 1px solid var(--ink); padding-top: 22px; }
.svc .n { font-size: 12px; color: var(--accent); letter-spacing: .14em; }
.svc h3 { font-size: clamp(1.4rem, 2vw, 1.9rem); margin: 18px 0 14px; }
.svc p { color: var(--muted); max-width: 34ch; }
@media (max-width: 860px) { .svc { grid-template-columns: 1fr; } }

.cta { text-align: center; border-top: 1px solid var(--line); }
.cta h2 { font-size: clamp(2.4rem, 7vw, 7rem); max-width: 14ch; margin: 0 auto; }
.cta-links { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: center; font-size: clamp(1rem, 1.4vw, 1.25rem); }
.cta-links a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat; padding-bottom: 4px; transition: background-size .3s; }
.cta-links a:hover { background-size: 100% 100%; color: var(--bg); }

.foot { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 28px var(--gut) 96px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot .proto { margin-left: auto; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s, transform 1s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) % 4 * 80ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- design: Erdvė ---------- */
[data-design=erdve] .card { grid-column: span 6; }
[data-design=erdve] .card:nth-child(4n+1) { grid-column: 1 / span 7; }
[data-design=erdve] .card:nth-child(4n+2) { grid-column: 9 / span 4; margin-top: 22vh; }
[data-design=erdve] .card:nth-child(4n+3) { grid-column: 2 / span 5; }
[data-design=erdve] .card:nth-child(4n+4) { grid-column: 7 / span 6; margin-top: 12vh; }
[data-design=erdve] .card:nth-child(4n+2) .ph, [data-design=erdve] .card:nth-child(4n+3) .ph { aspect-ratio: 4 / 5; }
[data-design=erdve] .card a { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
[data-design=erdve] .card .ph { clip-path: inset(18% 8% 18% 8%); transition: clip-path 1.4s cubic-bezier(.2,.7,.2,1); }
[data-design=erdve] .card.in .ph { clip-path: inset(0); }
[data-design=erdve] .card .meta { transform: translateZ(40px); }
@media (max-width: 760px) { [data-design=erdve] .card:nth-child(n) { grid-column: 1 / -1; margin-top: 0; } }

/* ---------- design: Brėžinys ---------- */
[data-design=brezinys] body {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; background-attachment: fixed;
}
[data-design=brezinys] .hero-copy h1 { font-weight: calc(var(--hw) - 100); }
[data-design=brezinys] .hero-copy::before { content: 'M 1:50 · A3'; display: block; font: 500 11px/1 var(--body); letter-spacing: .2em; color: var(--accent); margin-bottom: 16px; }
[data-design=brezinys] .card { grid-column: span 4; border: 1px solid var(--line); background: var(--bg); padding: 14px; }
[data-design=brezinys] .card img { filter: grayscale(1) contrast(1.15) brightness(1.08); }
[data-design=brezinys] .card a:hover img { filter: none; }
[data-design=brezinys] .card .ph { aspect-ratio: 1; }
[data-design=brezinys] .meta .no::before { content: 'Nr. '; }
[data-design=brezinys] .svc li { border: 1px solid var(--line); border-top: 2px solid var(--accent); padding: 22px; background: var(--bg); }
[data-design=brezinys] section.intro, [data-design=brezinys] .feature { position: relative; }
[data-design=brezinys] .feature figure { outline: 1px solid var(--ink); outline-offset: 10px; }
@media (max-width: 900px) { [data-design=brezinys] .card { grid-column: span 6; } }
@media (max-width: 560px) { [data-design=brezinys] .card { grid-column: 1 / -1; } }

/* ---------- design: Kelionė ---------- */
#world, .tour { display: none; }
[data-design=kelione] .hero3d { height: 100vh; height: 100svh; }
[data-design=kelione] #room { display: none; }
[data-design=kelione] #world { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s; }
[data-design=kelione].has3d #world { opacity: 1; }
[data-design=kelione] .steps, [data-design=kelione] .hero3d .scroll-cue { display: none; }
[data-design=kelione] .stage::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, color-mix(in srgb, var(--bg) 82%, transparent) 0%, transparent 46%),
              linear-gradient(0deg, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 22%); transition: opacity .6s; }
[data-design=kelione].travelling .stage::after { opacity: 0; }
[data-design=kelione] .hero-copy { opacity: 1; transform: none; bottom: auto; top: clamp(96px, 16vh, 160px); transition: opacity .6s; }
[data-design=kelione] .hero-copy h1 { font-size: clamp(2.2rem, 4.6vw, 4.8rem); }
[data-design=kelione].travelling .hero-copy { opacity: 0; }
[data-design=kelione] .tour {
  display: flex; align-items: center; gap: 18px; position: absolute; z-index: 3; left: var(--gut); right: var(--gut); bottom: clamp(24px, 6vh, 64px);
  font: 500 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
}
.tour p { display: flex; gap: 14px; align-items: baseline; transition: opacity .4s; }
.tour p b { font: var(--hw) clamp(1.4rem, 2.4vw, 2.2rem)/1 var(--head); letter-spacing: var(--track); text-transform: none; }
.tour #tour-no { color: var(--accent); }
.travelling .tour p { opacity: .25; }
.tour button { border: 1px solid currentColor; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); border-radius: 99px;
  padding: 12px 18px; font: inherit; letter-spacing: .12em; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s, color .2s; }
.tour button:hover { background: var(--ink); color: var(--bg); }
.tour #next { margin-left: auto; margin-right: 110px; }
.travelling .tour button { opacity: .4; pointer-events: none; }
@media (max-width: 640px) { .tour #next { margin-right: 0; } .tour { bottom: 88px; } .tour p b { font-size: 1.2rem; } }

/* ---------- design: Galerija ---------- */
[data-design=galerija] .hero3d { display: none; }
[data-design=galerija] .hero-img { display: block; }
[data-design=galerija] .top { color: #fff; mix-blend-mode: difference; }
[data-design=galerija] .mark { background: #fff; color: #000; }
[data-design=galerija] h1, [data-design=galerija] h2, [data-design=galerija] h3 { text-transform: uppercase; letter-spacing: .02em; }
[data-design=galerija] .statement { text-transform: none; }
[data-design=galerija] .card { grid-column: span 3; }
[data-design=galerija] .card .ph { aspect-ratio: 4 / 5; }
[data-design=galerija] .meta { flex-direction: column; gap: 4px; }
[data-design=galerija] .meta .kind { margin-left: 0; order: -1; }
[data-design=galerija] .meta h3 { font-size: clamp(1rem, 1.3vw, 1.2rem); letter-spacing: .12em; }
[data-design=galerija] .meta .no { display: none; }
[data-design=galerija] .feature { grid-template-columns: 1fr; padding-inline: 0; }
[data-design=galerija] .feature figure { aspect-ratio: 21 / 9; }
[data-design=galerija] .feature blockquote { padding-inline: var(--gut); max-width: 30ch; justify-self: center; text-align: center; }
@media (max-width: 1000px) { [data-design=galerija] .card { grid-column: span 6; } }
@media (max-width: 520px) { [data-design=galerija] .card { grid-column: 1 / -1; } }

/* ---------- the picker ---------- */
.dock, .panel { font: 500 13px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; text-transform: none; }
.dock {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border: 0; border-radius: 99px; background: var(--ink); color: var(--bg); cursor: pointer;
  box-shadow: 0 10px 30px rgb(0 0 0 / .25);
}
.dock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.panel {
  position: fixed; right: 16px; bottom: 72px; z-index: 40; width: min(380px, calc(100vw - 32px)); max-height: calc(100svh - 96px); overflow: auto;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 18px;
  box-shadow: 0 24px 60px rgb(0 0 0 / .22); overscroll-behavior: contain;
}
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.panel-head h2 { font: 600 15px/1 system-ui, sans-serif; letter-spacing: 0; text-transform: none; }
.x { border: 0; background: none; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 12px 0 0; padding: 12px 0 0; min-width: 0; }
legend { float: left; width: 100%; margin-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.opts { display: grid; gap: 8px; clear: both; }
fieldset > label, fieldset > p { clear: both; }
.opt { position: relative; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: grid; gap: 2px; transition: border-color .2s, background .2s; }
.opt:hover { border-color: var(--muted); }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt small { color: var(--muted); font-size: 12px; }
.designs { grid-template-columns: repeat(2, 1fr); }
.design b { font-size: 13px; }
.swatches { grid-template-columns: repeat(5, 1fr); }
.swatch { justify-items: center; padding: 8px 4px; gap: 6px; font-size: 11px; }
.swatch i { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--s1) 0 50%, var(--s2) 0 80%, var(--s3) 0); border: 1px solid rgb(0 0 0 / .15); }
.accent-pick { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.accent-pick input { width: 40px; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: none; cursor: pointer; }
.accent-pick button, .panel-foot button { border: 1px solid var(--line); background: none; color: inherit; border-radius: 99px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 12px; }
.fonts { grid-template-columns: 1fr 1fr; }
.font b { font-size: 22px; line-height: 1.1; }
.thumbs { grid-template-columns: repeat(3, 1fr); }
.thumb { padding: 4px; gap: 4px; font-size: 11px; }
.thumb img, .thumb .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: var(--card); }
.thumb span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload { display: block; margin-top: 10px; text-align: center; border: 1px dashed var(--muted); border-radius: 8px; padding: 10px; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:has(input:focus-visible) { outline: 2px solid var(--accent); }
.hint { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.panel-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
#copied { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .panel { right: 8px; left: 8px; width: auto; bottom: 68px; max-height: 70svh; }
  .dock { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero3d { height: 100vh; height: 100svh; }
}
