:root {
  --blue: #1a2ee6;
  --blue-deep: #1222c4;
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, .62);
  --line: rgba(255, 255, 255, .22);
  --glass: rgba(255, 255, 255, .1);
  --font: 'Space Grotesk', system-ui, sans-serif;
  --gutter: clamp(16px, 2.2vw, 32px);
  --ease: cubic-bezier(.7, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--blue);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }

/* ── background grid ─────────────────────────────── */
#grid {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(5, 10, 90, .45) 100%),
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 80px 80px;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ── loader ──────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 100; background: #fff;
  display: grid; place-items: center;
  transition: clip-path 1s var(--ease);
  clip-path: inset(0 0 0 0);
}
#loader.done { clip-path: inset(0 0 100% 0); }
.loader-box {
  width: min(300px, 60vw); aspect-ratio: 3/4; position: relative;
  border: 1px solid var(--blue); padding: 6px; overflow: hidden;
}
.loader-inner {
  width: 100%; height: 100%; background: var(--blue);
  transform-origin: bottom; transform: scaleY(0);
  transition: transform .3s ease-out;
}
.loader-count {
  position: absolute; top: calc(50% - min(200px, 40vw) - 18px);
  left: calc(50% + min(150px, 30vw) + 14px);
  color: var(--blue); font-size: 13px;
}

/* ── header ──────────────────────────────────────── */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--gutter);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 34px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.logo-word { font-weight: 700; font-size: 11px; letter-spacing: .2em; opacity: .85; }

.mode-toggle {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; padding: 4px; border-radius: 99px;
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.mode { position: relative; z-index: 1; padding: 8px 16px; border-radius: 99px; color: var(--ink-dim); transition: color .3s; font-weight: 500; }
.mode.active { color: var(--blue); }
.mode-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 99px; background: #fff;
  transition: transform .5s var(--ease), width .5s var(--ease);
}

.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 44px); font-weight: 500; }
.nav a { position: relative; overflow: hidden; display: inline-block; }
.nav a span { display: inline-block; transition: transform .45s var(--ease); }
.nav a::after {
  content: attr(data-label); position: absolute; left: 0; top: 100%;
  transition: transform .45s var(--ease);
}
.nav a:hover span, .nav a:hover::after { transform: translateY(-100%); }
.lang { color: var(--ink-dim); }
.lang button { color: var(--ink-dim); }
.lang button.on { color: #fff; }

.menu-btn {
  display: none; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); font-weight: 500;
}
.menu-btn i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }

/* ── bottom bar ──────────────────────────────────── */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: var(--gutter); font-weight: 500; pointer-events: none;
}
.bottom > * { pointer-events: auto; }
.b-left { display: flex; align-items: center; gap: 10px; }
.ring-icon {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid #fff; position: relative;
  animation: spin 6s linear infinite;
}
.ring-icon::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.b-center { text-align: center; min-width: 220px; text-transform: uppercase; transition: opacity .2s; }
.b-center em { font-style: normal; color: var(--ink-dim); }
.b-right { text-align: right; }
.scroll-pill {
  display: inline-block; padding: 8px 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px);
}

/* ── cursor ──────────────────────────────────────── */
#cursor {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: #fff; color: var(--blue); display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  transform: scale(0); transition: transform .35s var(--ease);
}
#cursor.on { transform: scale(1); }
body.hovering #scene { cursor: none; }

/* ── panels ──────────────────────────────────────── */
.panel {
  position: fixed; inset: 0; z-index: 15; background: var(--blue);
  overflow-y: auto; overscroll-behavior: contain;
  clip-path: inset(100% 0 0 0); visibility: hidden;
  transition: clip-path .9s var(--ease), visibility 0s .9s;
}
.panel.open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .9s var(--ease), visibility 0s; }
.panel-inner { padding: calc(var(--gutter) * 2 + 60px) var(--gutter) calc(var(--gutter) * 2 + 40px); max-width: 1600px; margin: 0 auto; }
.panel.open .panel-inner > * { animation: rise .9s var(--ease) both; }
.panel.open .panel-inner > *:nth-child(2) { animation-delay: .08s; }
.panel.open .panel-inner > *:nth-child(3) { animation-delay: .16s; }
.panel.open .panel-inner > *:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }

.close-btn {
  position: fixed; z-index: 25; right: var(--gutter); bottom: var(--gutter);
  width: 52px; height: 52px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform .4s var(--ease);
}
.close-btn.on { transform: scale(1); }
.close-btn span { position: absolute; left: 16px; right: 16px; top: 50%; height: 2px; background: var(--blue); }
.close-btn span:first-child { transform: rotate(45deg); }
.close-btn span:last-child { transform: rotate(-45deg); }
.close-btn:hover { transform: scale(1.08) rotate(90deg); }

.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.panel-head h2 { font-size: clamp(40px, 9vw, 140px); line-height: .85; font-weight: 700; letter-spacing: -.04em; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.f { padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line); font-weight: 500; transition: background .3s, color .3s; }
.f sup { font-size: 9px; opacity: .7; }
.f.on, .f:hover { background: #fff; color: var(--blue); }

.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(14px, 2vw, 28px); }
.work { display: block; text-align: left; }
.work .cover { aspect-ratio: 3/4; overflow: hidden; position: relative; background: var(--blue-deep); }
.work img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s var(--ease); }
.work:hover img { transform: scale(1.06); }
.work .meta { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; font-weight: 500; text-transform: uppercase; }
.work .meta em { font-style: normal; color: var(--ink-dim); }
.work.hide { display: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-transform: uppercase; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3dff8b; box-shadow: 0 0 10px #3dff8b; }
.badge.soon::before { background: #ffcf3d; box-shadow: 0 0 10px #ffcf3d; }

.eyebrow { font-weight: 500; color: var(--ink-dim); margin-bottom: 24px; }
.big { font-size: clamp(38px, 7.4vw, 120px); line-height: .92; font-weight: 700; letter-spacing: -.04em; max-width: 14ch; }
.studio .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; max-width: 900px; margin-left: auto; font-size: clamp(15px, 1.4vw, 20px); line-height: 1.45; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 80px; border-top: 1px solid var(--line); }
.stats div { padding: 20px 0; border-right: 1px solid var(--line); padding-left: 20px; }
.stats div:first-child { padding-left: 0; }
.stats div:last-child { border-right: 0; }
.stats dt { color: var(--ink-dim); font-weight: 500; text-transform: uppercase; }
.stats dd { font-size: clamp(48px, 8vw, 120px); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-top: 10px; }

.contact .mail { display: inline-block; margin-top: 50px; font-size: clamp(24px, 4.6vw, 72px); font-weight: 500; letter-spacing: -.03em; border-bottom: 2px solid #fff; overflow-wrap: anywhere; }
.contact .mail:hover { opacity: .75; }
.contact-meta { display: flex; gap: 60px; margin-top: 70px; flex-wrap: wrap; font-weight: 500; }
.contact-meta span { display: block; color: var(--ink-dim); margin-bottom: 8px; }
.contact-meta b { font-weight: 500; font-size: 16px; }
#socialList a { display: block; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; margin-bottom: 4px; }

/* detail */
.d-wrap { display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.d-wrap > * { min-width: 0; }
.d-cover { position: sticky; top: 100px; }
.d-cover img { width: 100%; display: block; }
.d-title { font-size: clamp(44px, 8vw, 130px); line-height: .86; font-weight: 700; letter-spacing: -.045em; margin: 18px 0 36px; overflow-wrap: anywhere; }
.d-table { border-top: 1px solid var(--line); margin-bottom: 36px; }
.d-table div { display: grid; grid-template-columns: 140px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 500; text-transform: uppercase; }
.d-table dt { color: var(--ink-dim); }
.d-desc { font-size: clamp(15px, 1.35vw, 19px); line-height: 1.5; max-width: 60ch; white-space: pre-line; }
.d-desc.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 36px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border-radius: 99px; background: #fff; color: var(--blue); font-weight: 700; text-transform: uppercase; transition: transform .3s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid var(--line); }
.soon-btn { cursor: default; opacity: .75; }
.soon-btn:hover { transform: none; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.d-shots { display: flex; gap: 14px; overflow-x: auto; margin-top: 50px; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.d-shots.wide img { height: auto; width: 100%; border-radius: 10px; }
.d-shots img { height: min(52vh, 460px); border-radius: 18px; scroll-snap-align: start; flex: none; }

body.panel-open .bottom, body.panel-open .mode-toggle { opacity: 0; pointer-events: none; }
.bottom, .mode-toggle { transition: opacity .4s; }
.d-table dd { text-transform: none; }
body.panel-open .top { background: linear-gradient(var(--blue) 65%, rgba(26, 46, 230, 0)); }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 18; background: var(--blue);
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: var(--gutter);
  font-size: 44px; font-weight: 700; letter-spacing: -.03em;
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease);
}
.mobile-menu.open { clip-path: inset(0 0 0 0); }
.mobile-menu .lang { font-size: 16px; margin-top: 30px; font-weight: 500; letter-spacing: 0; }

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .mode-toggle { top: auto; bottom: calc(var(--gutter) + 50px); position: fixed; }
  .bottom { grid-template-columns: 1fr auto; }
  .b-center { display: none; }
  .b-left span:last-child { font-size: 10px; }
  .studio .cols { grid-template-columns: 1fr; margin-top: 40px; }
  .d-wrap { grid-template-columns: 1fr; }
  .d-cover { position: static; max-width: 320px; }
  .d-table div { grid-template-columns: 110px 1fr; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .loader-count { display: none; }
}
@media (max-width: 420px) {
  .works-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .work .meta { flex-direction: column; gap: 2px; font-size: 10px; }
  .logo-word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-icon { animation: none; }
}
