:root {
  --paper: #F4F2ED;
  --ink:   #131311;
  --dim:   #7A756C;
  --line:  rgba(19, 19, 17, 0.14);

  --accent: var(--ink);
  --glow: var(--ink);
  --glow-o: 0;

  --disp: "Bricolage Grotesque", "Arial Black", sans-serif;
  --body: "Instrument Sans", -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 24px 48px -12px rgba(19, 19, 17, 0.18);

  --pad: clamp(20px, 5vw, 80px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .nav__logo, .footer__logo, .contact__line {
  font-family: var(--disp); font-weight: 600; letter-spacing: -0.02em;
}
.mono { font-family: var(--mono); font-size: 11.5px; font-weight: 500;
        letter-spacing: 0.08em; text-transform: uppercase; }
.dim { color: var(--dim); }

.outline, .contact__line em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.contact__line em { -webkit-text-stroke: 1.5px var(--paper); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

.reveal { opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .4s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__logo { font-size: 20px; }
.nav__links { display: flex; gap: 30px; align-items: center; }
.nav__links a { font-size: 15px; font-weight: 500; position: relative; }
.nav__links a:not(.nav__cta)::after { content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { border: 1.5px solid var(--accent); border-radius: 999px; padding: 10px 22px;
  transition: background .3s, color .3s, border-color .3s; }
.nav__cta:hover { background: var(--accent); color: var(--paper); }

.hero { min-height: 94vh; display: flex; flex-direction: column;
  justify-content: center; padding: 130px var(--pad) 40px; }
.hero__eyebrow { color: var(--dim); margin-bottom: 26px; }
.hero__title { font-size: clamp(48px, 8.6vw, 140px); line-height: 1.02;
  letter-spacing: -0.03em; }
.hero__line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero__line > span { display: block; }

.role { display: inline-block; vertical-align: bottom; overflow: hidden;
  white-space: nowrap; }
.role__word { display: inline-block; color: transparent;
  -webkit-text-stroke: 1.5px var(--ink); will-change: transform; }

.hero__foot { display: flex; justify-content: space-between;
  align-items: flex-end; gap: 40px; margin-top: clamp(40px, 6vh, 72px); }
.hero__lead { max-width: 44ch; font-size: 18px; font-weight: 500; }
.hero__scroll { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.hero__scroll-ring { display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; font-size: 18px; color: var(--paper); background: var(--accent);
  transition: transform .4s var(--ease), background .3s; }
.hero__scroll:hover .hero__scroll-ring { transform: translateY(6px); }

.section-head { display: flex; align-items: baseline; gap: 18px;
  padding: clamp(28px, 4vh, 44px) 0 clamp(36px, 6vh, 60px);
  border-top: 1.5px solid var(--ink); }
.section-head h2 { font-size: clamp(40px, 5.4vw, 76px); line-height: 1; }
.section-head__num { color: var(--dim); }
.section-head__note { margin-left: auto; }

.services, .about, .contact { padding: 0 var(--pad); }

.viewer { position: relative; overflow-x: hidden; padding: 0 var(--pad); margin-top: clamp(30px, 6vh, 70px); }
.viewer__glow { position: absolute; left: -10%; right: -10%; top: -6%; height: 85%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  opacity: var(--glow-o, 0); filter: blur(70px); pointer-events: none; z-index: 0; }
.viewer .section-head { position: relative; z-index: 1; }

.viewer__grid { position: relative; z-index: 1; display: flex; flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(20px, 2.4vw, 32px); padding-bottom: clamp(40px, 6vh, 80px);
  --card-h: clamp(260px, 24vw, 380px); }

.pcard { position: relative; flex: 0 0 auto;
  height: var(--card-h); width: calc(var(--card-h) * 4 / 3);
  border: 1.5px solid var(--line); border-radius: 24px;
  cursor: pointer; overflow: hidden; background: var(--ink);
  transition: border-color .3s var(--ease);
  animation: pcardFloat 10s ease-in-out infinite; }
.pcard:nth-child(2n) { animation-duration: 12.5s; animation-delay: -3.4s; }
.pcard:nth-child(3n) { animation-duration: 8.6s; animation-delay: -1.6s; }
.pcard:nth-child(3n+1) { animation-duration: 11.2s; animation-delay: -5.8s; }
.pcard:hover { border-color: var(--accent); }
.pcard.is-opening { overflow: visible; z-index: 10; }
@keyframes pcardFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(3px, -4px); }
  50% { transform: translate(-3px, 2px); }
  75% { transform: translate(2px, 4px); }
}
@media (prefers-reduced-motion: reduce) { .pcard { animation: none; } }

.pcard__stage { position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; padding: 4%; }
.pcard__laptop { width: 100%; will-change: transform; }

.pcard--media { width: auto; }
.pcard__stage--media { position: static; inset: auto; display: block; padding: 0; height: 100%; }
.pcard__media { display: block; height: 100%; width: auto; will-change: transform; }
.pcard__caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: clamp(52px, 8vw, 96px) clamp(20px, 2.6vw, 32px) clamp(20px, 2.6vw, 32px);
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(8, 8, 6, 0.94) 0%,
    rgba(8, 8, 6, 0.88) 35%,
    rgba(8, 8, 6, 0.55) 68%,
    rgba(8, 8, 6, 0) 100%); }
.pcard__title { font-size: clamp(19px, 1.8vw, 25px); color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); will-change: transform, opacity; }
.pcard__desc { margin-top: 6px; font-size: 13.5px; line-height: 1.4;
  color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  will-change: transform, opacity;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.laptop { position: relative; width: min(100%, 780px); aspect-ratio: 3 / 2; }
.laptop__screen { position: absolute; top: 14.94%; left: 16.4%; width: 67.06%; height: 54.98%;
  overflow: hidden; background: #000; }
.laptop__preview { width: 100%; height: 100%; object-fit: cover; }
.laptop__frame { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; pointer-events: none; }

.laptop.has-video .laptop__preview--still { position: absolute; inset: 0; }
.laptop__preview--video { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 1; transition: opacity .35s var(--ease);
  will-change: opacity; transform: translateZ(0); backface-visibility: hidden; }
.laptop.is-entering .laptop__preview--video { opacity: 0; }

.scene { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; }
.scene__image, .scene__video { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 18px; }
.scene__video { position: absolute; inset: 0; margin: auto; }
.scene__empty { padding: 60px; border: 1.5px dashed var(--line); border-radius: 14px; }

.viewer__close { position: fixed; top: 22px; right: max(22px, var(--pad)); z-index: 200;
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 17px;
  display: grid; place-items: center; transition: border-color .3s var(--ease), color .3s var(--ease); }
.viewer__close:hover { border-color: var(--accent); color: var(--accent); }

.viewer__detail { position: fixed; inset: 0; z-index: 150;
  background: var(--paper); display: flex; align-items: center;
  padding: clamp(20px, 4vh, 40px) var(--pad); overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.viewer__detail[hidden] { display: none; }
.viewer__detail .project-split { width: 100%; margin: auto 0; }

.viewer__detail {
  --diag-fill: color-mix(in srgb, var(--paper) 82%, black 18%);
}
.viewer__seam { position: absolute; inset: 0; z-index: 1; pointer-events: none; isolation: isolate; }
.viewer__seam i {
  position: absolute; inset: 0; font-style: normal; opacity: 0;
  will-change: clip-path, opacity; transform: translateZ(0);
}
.viewer__seam-fill {
  background: var(--diag-fill);
  clip-path: polygon(46% 0%, 100% 0%, 100% 100%, 40% 100%);
}
.viewer__seam i:nth-child(2) {
  background: var(--accent);
  clip-path: polygon(42.4% 0%, 43.6% 0%, 37.6% 100%, 36.4% 100%);
}
.viewer__seam i:nth-child(3) {
  background: var(--diag-fill);
  clip-path: polygon(43.6% 0%, 44.8% 0%, 38.8% 100%, 37.6% 100%);
}
.viewer__seam i:nth-child(4) {
  background: var(--ink);
  clip-path: polygon(44.8% 0%, 46% 0%, 40% 100%, 38.8% 100%);
}

.project-info { position: relative; z-index: 2;
  will-change: filter, opacity, transform;
  transition: filter .7s var(--ease), opacity .7s var(--ease), transform .7s var(--ease); }
.project-stage { position: relative; z-index: 5; will-change: transform;
  contain: layout paint; transform: translateZ(0); backface-visibility: hidden;
  isolation: isolate; }

.viewer__detail.is-focus-right .project-info {
  filter: blur(9px); opacity: 0.32; transform: translateX(-50px) scale(0.96);
}

.viewer.is-detail-open .viewer__glow { display: none; }

.services { margin-top: clamp(60px, 10vh, 140px); }
.services__list { list-style: none; }
.srow { display: grid; grid-template-columns: 44px 1fr 1.1fr 40px; gap: 24px;
  align-items: baseline; padding: 32px 0; border-bottom: 1px solid var(--line);
  transition: padding-left .4s var(--ease); }
.srow:hover { padding-left: 14px; }
.srow:last-child { border-bottom: 1.5px solid var(--ink); }
.srow__idx { color: var(--dim); }
.srow__name { font-family: var(--disp); font-weight: 600;
  font-size: clamp(26px, 3.2vw, 44px); line-height: 1.05; }
.srow__desc { max-width: 52ch; font-size: 16px; color: var(--dim); transition: color .3s; }
.srow:hover .srow__desc { color: var(--ink); }
.srow__arrow { font-size: 22px; opacity: 0; transform: translateX(-10px);
  transition: opacity .35s, transform .35s var(--ease); }
.srow:hover .srow__arrow { opacity: 1; transform: none; }

.about { margin-top: clamp(80px, 13vh, 170px); }
.about__text { font-family: var(--disp); font-weight: 500;
  font-size: clamp(28px, 3.6vw, 54px); line-height: 1.22; letter-spacing: -0.015em;
  max-width: 26ch; }
.about__text .w { color: rgba(19, 19, 17, 0.15); transition: color .25s; }
.about__text .w.is-read { color: var(--ink); }
.about__facts { list-style: none; display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: clamp(48px, 8vh, 90px); }
.about__facts li { border-top: 1.5px solid var(--ink); padding-top: 14px;
  display: flex; flex-direction: column; gap: 4px; }
.about__facts b { font-family: var(--disp); font-weight: 600;
  font-size: clamp(34px, 4vw, 58px); line-height: 1; }

.contact { margin-top: clamp(80px, 13vh, 170px); padding-bottom: clamp(40px, 6vh, 80px); }
.contact__card { border-radius: 22px; background: var(--ink); color: var(--paper);
  text-align: center; padding: clamp(64px, 11vh, 130px) var(--pad); }
.contact__line { font-size: clamp(44px, 6.6vw, 104px); line-height: 1.04;
  margin-bottom: clamp(36px, 6vh, 60px); }
.contact__mail { display: inline-block; font-family: var(--mono);
  font-size: clamp(18px, 2.4vw, 30px); color: var(--ink); background: var(--paper);
  border-radius: 999px; padding: 18px 36px; will-change: transform;
  transition: background .3s; }
.contact__mail:hover { background: #fff; }
.contact__note { margin-top: 26px; color: rgba(244, 242, 237, 0.5); }

.footer { display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap; padding: 26px var(--pad); }
.footer__logo { font-size: 18px; }
.footer__nav { display: flex; gap: 26px; font-size: 15px; }
.footer__nav a { position: relative; }
.footer__nav a::after { content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.footer__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.footer__copy { font-size: 13.5px; }

.project-split { display: grid; grid-template-columns: 1fr 1.15fr;
  gap: clamp(40px, 6vw, 100px); align-items: center; min-height: 60vh; }

.project-info__eyebrow { color: var(--dim); }
.project-info__title { font-size: clamp(36px, 4.6vw, 64px); line-height: 1.03; margin: 12px 0 16px; }
.title-flag { display: inline-block; width: 38px; height: 28px; margin-left: 14px;
  border-radius: 5px; vertical-align: middle; box-shadow: 0 0 0 1.5px var(--line), var(--shadow);
  background-size: cover; background-position: center; }
.pcard__title .title-flag { width: 30px; height: 22px; margin-left: 10px; }
.project-info__desc { max-width: 46ch; font-size: 17px; color: var(--dim);
  margin-bottom: clamp(28px, 5vh, 48px); }

.project-facts { display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; margin-bottom: clamp(30px, 5vh, 50px);
  background: var(--line); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; }
.project-facts__item { background: var(--paper); padding: 18px 20px;
  transition: background .3s var(--ease); }
.project-facts__item span { display: block; margin-bottom: 8px; color: var(--accent); }
.project-facts__item p { font-size: 16px; font-weight: 500; line-height: 1.4; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 6px 12px; }

.project-info__contact { display: inline-flex; align-items: center; gap: 10px;
  margin-top: clamp(32px, 5vh, 52px); color: var(--accent);
  border-bottom: 1.5px solid var(--accent); padding-bottom: 4px; }
.project-info__contact span:last-child { transition: transform .3s var(--ease); }
.project-info__contact:hover span:last-child { transform: translateX(4px); }

.project-stage { display: flex; justify-content: center; }

@media (max-width: 900px) {
  .hero__foot { flex-direction: column; align-items: flex-start; gap: 28px; }
  .srow { grid-template-columns: 34px 1fr; }
  .srow__desc { grid-column: 2; }
  .srow__arrow { display: none; }
  .about__facts { grid-template-columns: repeat(2, 1fr); }
  .project-split { grid-template-columns: 1fr; }
  .project-stage { order: -1; margin-bottom: 20px; }

  .viewer__detail.is-focus-right .project-info,
  .viewer__detail.is-focus-right .project-stage { transform: none; filter: none; opacity: 1; }
  .project-info { will-change: auto; }
}

@media (max-width: 820px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .about__text { max-width: none; }

  .viewer__seam { z-index: 300; }
  .viewer__seam-fill { display: none; }

  .viewer__detail { padding: clamp(16px, 3vh, 24px) var(--pad); align-items: flex-start; }
  .viewer__detail .project-split { margin: 0; padding: 64px 0 40px; }
  .project-split { gap: 28px; min-height: 0; }
  .project-info__title { font-size: clamp(30px, 8vw, 44px); margin: 8px 0 12px; }
  .project-info__desc { font-size: 15.5px; margin-bottom: 24px; }
  .project-facts { grid-template-columns: 1fr; border-radius: 14px; margin-bottom: 28px; }
  .project-facts__item { padding: 16px 18px; }
  .project-facts__item p { font-size: 15.5px; }
  .project-info__contact { margin-top: 28px; }
  .viewer__close { top: 14px; right: 14px; width: 42px; height: 42px; }

  .viewer__grid { flex-direction: column; }
  .pcard { width: 100%; height: auto; aspect-ratio: 4 / 3.4; }
  .pcard--media { width: 100%; aspect-ratio: auto; }
  .pcard__stage--media { height: auto; }
  .pcard__media { height: auto; width: 100%; }
  .pcard__caption { padding: clamp(44px, 14vw, 72px) 18px 18px; }
  .pcard__desc { font-size: 13px; -webkit-line-clamp: 2; }
  .section-head { gap: 12px; flex-wrap: wrap; }
  .section-head__note { margin-left: 0; width: 100%; }
}

html.no-scroll { overflow: hidden; height: 100%; }

.rotate-gate { display: none; }
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .rotate-gate { display: flex; position: fixed; inset: 0; z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: var(--paper); color: var(--ink); text-align: center; padding: 0 40px; }
  .rotate-gate__icon { position: relative; width: 60px; height: 60px;
    animation: rotateGateTurn 2.4s var(--ease) infinite; }
  .rotate-gate__icon svg { width: 100%; height: 100%; }
  .rotate-gate__arrow { position: absolute; top: -8px; right: -16px; font-size: 20px;
    opacity: 0; animation: rotateGateArrow 2.4s var(--ease) infinite; }
  .rotate-gate__eyebrow { color: var(--dim); margin-top: 4px; }
  .rotate-gate__line { font-family: var(--disp); font-weight: 600; letter-spacing: -0.02em;
    font-size: clamp(22px, 5vw, 30px); }
}
@keyframes rotateGateTurn {
  0%, 15% { transform: rotate(-90deg); }
  45%, 100% { transform: rotate(0deg); }
}
@keyframes rotateGateArrow {
  0%, 10% { opacity: 0; transform: translate(0, 0); }
  20%, 40% { opacity: 1; transform: translate(-3px, 3px); }
  50%, 100% { opacity: 0; transform: translate(-3px, 3px); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__line > span { transform: none; }
  .about__text .w { color: var(--ink); }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
