/* =========================================
   Reset & base
   ========================================= */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

:root {
  --bg: #f7f5ef;
  --text: #0e0e0e;
  --muted: #6f6a64;
  --line: rgba(14, 14, 14, 0.10);
  --accent: #ff4a1c;
  /* Inter for Latin, Hiragino (Mac/iOS) → Yu Gothic (Win) for 日本語.
     Same approach as tashi.design and other high-end JP designer sites. */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont,
          'Hiragino Kaku Gothic ProN', 'Hiragino Sans',
          'Yu Gothic Medium', 'Yu Gothic', 'Meiryo', sans-serif;
  /* Serif kept ONLY for tiny Latin italic accents (e.g. "and more →") */
  --serif: 'Instrument Serif', Georgia, serif;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;            /* generous for Hiragino body text */
  font-feature-settings: 'palt'; /* proportional kana spacing — much cleaner JP */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Hide native cursor on devices with a precise pointer */
@media (hover: hover) and (pointer: fine) {
  body, a, button, .project { cursor: none; }
}

/* =========================================
   Custom cursor
   ========================================= */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 12px; height: 12px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, background .25s ease;
}
.cursor.is-hover {
  width: 56px; height: 56px;
  background: var(--accent);
}
@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* =========================================
   Nav
   ========================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
}
.nav__logo {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
}
.nav__logo span { opacity: .6; font-style: italic; }

.nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
}
.nav__links a {
  position: relative;
  padding: 4px 0;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s cubic-bezier(.6,.05,.05,1);
}
.nav__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta {
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background .35s ease, color .35s ease;
}
.nav__cta:hover {
  background: #fff;
  color: #000;
}

/* =========================================
   Section helpers
   ========================================= */
section { padding: 0 40px; }

.section__head {
  display: block;
  padding: 160px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 56px;
}
.section__index {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 28px;
}
.section__title {
  font-family: var(--sans);
  font-size: clamp(36px, 5.2vw, 84px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.section__title em {
  /* Used only on Latin segments — JP titles avoid italic */
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* =========================================
   Hero
   ========================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 140px 40px 60px;
  position: relative;

}

.hero__top {
  margin-bottom: auto;          /* push title + below to bottom area */
}
.hero__availability {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero__title {
  font-family: var(--sans);
  font-size: clamp(40px, 7.5vw, 124px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-top: 60px;
}
.hero__title .line {
  display: block;
  padding-bottom: 0.04em;
}
.hero__title .accent {
  font-weight: 300;             /* lighter weight gives the accent rhythm */
  color: var(--text);
}
.hero__title .char {
  display: inline-block;
  will-change: transform, opacity;
}

.hero__below {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero__intro {
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.85;
  color: var(--text);
  max-width: 540px;
}
.hero__services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 8px;
  align-content: flex-start;
}
.hero__services li {
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(14, 14, 14, 0.05);
}

.hero__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 56px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero__meta a {
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
  transition: opacity .3s;
}
.hero__meta a:hover { opacity: .55; }



/* (Marquee removed — services now live inline in the hero) */

/* =========================================
   Work
   ========================================= */
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 80px 40px;
  padding-bottom: 120px;
}
@media (min-width: 1280px) {
  .work__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 80px 32px;
  }
  /* Stagger every other column for visual rhythm — use margin so it
     doesn't fight the GSAP transform reveal */
  .work__grid .project:nth-child(3n + 2) { margin-top: 80px; }
}
.project__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #ddd;
}
.project__placeholder {
  width: 100%;
  height: 120%;       /* extra height for parallax */
  margin-top: -10%;
  transition: transform 1.4s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
.project:hover .project__placeholder { transform: scale(1.06); }
.project__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
.project:hover .project__img { transform: scale(1.06); }

/* "screenshot pending" label — visible until you swap in real images */
.project__pending {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}

/* "and more →" placeholder card */
.project--more .project__placeholder.more {
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  border: 1px dashed rgba(14, 14, 14, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.project--more .project__placeholder.more span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--muted);
}
.project--more:hover .project__placeholder.more {
  border-color: var(--text);
  transform: none;
}

.project__placeholder.a { background: linear-gradient(135deg, #ff5a1f, #ffb38a); }
.project__placeholder.b { background: linear-gradient(135deg, #2a2a2a, #6e6e6e); }
.project__placeholder.c { background: linear-gradient(135deg, #f3e6c4, #c9a35a); }
.project__placeholder.d { background: linear-gradient(135deg, #1d3b2a, #6cb28e); }
.project__placeholder.e { background: linear-gradient(135deg, #d8e9f0, #6f9fb8); }
.project__placeholder.f { background: linear-gradient(135deg, #ede4d3, #2e2c28); }
.project__placeholder.g { background: linear-gradient(135deg, #4a2bb8, #d3c7ff); }
.project__placeholder.h { background: linear-gradient(135deg, #0f1b2d, #cc5277); }

.project__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 14px;
}
.project__meta h3 { font-weight: 500; }
.project__meta p { color: var(--muted); }

/* =========================================
   Story
   ========================================= */
.story__body {
  max-width: 920px;
  font-family: var(--sans);
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.7;             /* JP needs more line-height */
  font-weight: 400;
  letter-spacing: 0.005em;
  padding-bottom: 160px;
}
.story__body p { margin-bottom: 36px; }

/* =========================================
   Process / Philosophy
   ========================================= */
.process__grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 80px;
  padding-bottom: 160px;
}
.process__lead {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 320px;
  position: sticky;
  top: 120px;
  align-self: start;
}
.process__list {
  list-style: none;
}
.process__list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: baseline;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.process__list li:last-child { border-bottom: 1px solid var(--line); }
.process__list .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--muted);
}
.process__list p {
  font-family: var(--sans);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.7;
  letter-spacing: 0.005em;
  max-width: 580px;
}

/* =========================================
   CTA
   ========================================= */
.cta {
  text-align: center;
  padding: 200px 40px;
  border-top: 1px solid var(--line);
}
.cta__eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 32px;
}
.cta__title {
  font-family: var(--sans);
  font-size: clamp(40px, 7vw, 116px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 60px;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}
.cta__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.cta__btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  padding: 18px 36px;
  border: 1px solid var(--text);
  border-radius: 999px;
  transition: background .4s ease, color .4s ease;
}
.cta__btn:hover {
  background: var(--text);
  color: var(--bg);
}
.cta__sub {
  margin-top: 32px;
  font-size: 13px;
  color: var(--muted);
}

/* =========================================
   Footer
   ========================================= */
.footer {
  padding: 80px 40px 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.footer__logo {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.footer__logo span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  opacity: .55;
}
.footer__links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.footer__links a {
  color: var(--text);
  font-size: 14px;
  transition: opacity .3s;
}
.footer__links a:hover { opacity: .55; }
.footer__bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


/* =========================================
   FOUC guard — these initial hidden states only apply
   when JS is available. If JS fails to load, content stays
   visible instead of being permanently hidden.
   ========================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}
.js .hero__title .char {
  opacity: 0;
  transform: translateY(40px);
}
.js .hero__top,
.js .hero__below,
.js .hero__meta {
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}

/* =========================================
   Project Modal
   ========================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .55s cubic-bezier(.6,.05,.05,1),
              visibility 0s linear .55s;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .55s cubic-bezier(.6,.05,.05,1);
}

.modal__close {
  position: fixed;
  top: 28px;
  right: 40px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid var(--text);
  background: var(--bg);
  cursor: pointer;
  z-index: 1010;
  display: grid;
  place-items: center;
  transition: background .35s ease, transform .35s ease;
}
.modal__close:hover {
  background: var(--text);
}
.modal__close span {
  position: absolute;
  width: 22px;
  height: 1px;
  background: var(--text);
  transition: background .35s ease;
}
.modal__close span:nth-child(1) { transform: rotate(45deg); }
.modal__close span:nth-child(2) { transform: rotate(-45deg); }
.modal__close:hover span { background: var(--bg); }

.modal__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 40px 100px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* --- Header --- */
.modal__header {
  max-width: 720px;
}
.modal__index {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 24px;
}
.modal__title {
  font-family: var(--sans);
  font-size: clamp(40px, 5.5vw, 80px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
}
.modal__meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal__meta li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal__meta li strong {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}
.modal__meta li span {
  color: var(--text);
}

/* --- Images --- */
.modal__img {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.modal__img--hero {
  aspect-ratio: 16 / 9;
}
.modal__img--full {
  aspect-ratio: 16 / 9;
}
.modal__img--half {
  aspect-ratio: 16 / 10;
}
.modal__img .modal__placeholder {
  width: 100%;
  height: 100%;
}
.modal__real-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal__pending {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 999px;
}

/* 2-up grid */
.modal__img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 5-up app screenshots */
.modal__app-shots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.modal__app-shots img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* --- Body text --- */
.modal__body {
}
.modal__description {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}
.modal__description p { margin-bottom: 20px; }
.modal__description p:last-child { margin-bottom: 0; }

/* --- Footer / services --- */
.modal__footer {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.modal__services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal__services li {
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 14, 14, 0.02);
}

/* When the modal is open, lock the body scroll */
body.modal-open { overflow: hidden; }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 900px) {
  .nav { padding: 20px; }
  .nav__links { display: none; }
  section { padding: 0 20px; }
  .hero { padding: 120px 20px 40px; }
  .hero__title { margin-top: 40px; }
  .hero__below {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 40px;
  }
  .hero__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-top: 40px;
  }
  .work__grid { grid-template-columns: 1fr; gap: 60px; }
  .process__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .process__lead { position: static; max-width: none; }
  .process__list li {
    grid-template-columns: 50px 1fr;
    gap: 24px;
    padding: 28px 0;
  }
  .footer { padding: 60px 20px 24px; }
  .footer__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    padding-bottom: 40px;
  }
  .footer__links {
    flex-direction: column;
    gap: 12px;
  }
  .footer__bot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .section__head {
    padding: 100px 0 32px;
    margin-bottom: 40px;
  }
  .cta { padding: 140px 20px; }

  /* Modal responsive */
  .modal__close { top: 20px; right: 20px; width: 48px; height: 48px; }
  .modal__inner {
    padding: 100px 20px 60px;
    gap: 36px;
  }
  .modal__img-pair {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .modal__app-shots {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .modal__app-shots img {
    border-radius: 6px;
  }
  .modal__body { max-width: none; }
}
