:root {
  --ink: #111010;
  --ink-soft: #4a4133;
  --paper: #e8c34c;
  --paper-hi: #f0d268;
  --paper-dim: #dcb63d;
  --line: rgba(17, 16, 16, 0.18);
  --green: #52b464;
  --green-dark: #368048;
  --max-width: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-loading { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner { text-align: center; }

.loader-ascii {
  margin: 0 0 24px;
  font-family: "Space Grotesk", monospace;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: 0.18em;
  color: rgba(17, 16, 16, 0.35);
  white-space: pre;
  user-select: none;
}

.loader-count {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  font-weight: 500;
}

.loader-slash { color: rgba(17, 16, 16, 0.4); }

/* ---------- Grain + cursor ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9500;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s;
  opacity: 0;
}

.cursor.is-active { opacity: 1; }

.cursor.is-hover {
  width: 62px;
  height: 62px;
  background: rgba(17, 16, 16, 0.1);
}

@media (hover: none), (max-width: 900px) {
  .cursor { display: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  transition: background 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgba(232, 195, 76, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.brand-logo {
  width: 62px;
  height: 62px;
  transition: transform 0.5s var(--ease);
}

.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.05); }

.brand-logo.small {
  width: 54px;
  height: 54px;
  background: #fff;
  border-radius: 50%;
  padding: 5px;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.site-nav a {
  position: relative;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  overflow: hidden;
  display: block;
  height: 1.5em;
}

.site-nav a span,
.site-nav a em {
  display: block;
  font-style: normal;
  transition: transform 0.45s var(--ease);
}

.site-nav a em {
  font-family: "Noto Sans JP", sans-serif;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.site-nav a:hover span,
.site-nav a:hover em { transform: translateY(-100%); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 2;
}

.nav-toggle span {
  width: 26px;
  height: 1.5px;
  background: var(--ink);
  display: block;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  padding: 120px 32px 140px;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(17, 16, 16, 0.6) 0%, rgba(17, 16, 16, 0.32) 45%, rgba(232, 195, 76, 0.28) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  font-weight: 500;
  margin: 0 0 28px;
  color: var(--paper);
  text-transform: uppercase;
}

.tick {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.hero-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.9rem, 6.4vw, 5.2rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin: 0;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}

body.is-ready .hero-title .line > span { transform: translateY(0); }
body.is-ready .hero-title .line:nth-child(2) > span { transition-delay: 0.12s; }

.hero-sub {
  margin: 32px 0 0;
  max-width: 34em;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease) 0.45s, transform 0.9s var(--ease) 0.45s;
}

body.is-ready .hero-sub { opacity: 1; transform: none; }

.hero-scroll {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.hero-scroll-label {
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  font-weight: 500;
}

.hero-scroll-line {
  width: 1px;
  height: 54px;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  animation: scrollLine 2s var(--ease) infinite;
}

@keyframes scrollLine {
  0% { transform: translateY(-100%); }
  50%, 100% { transform: translateY(100%); }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding: 20px 0;
}

.marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee-track span {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 24px)); }
}

/* ---------- Sections ---------- */
.section { padding: 140px 0; }

.section-head { margin-bottom: 72px; }

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.section-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Work list ---------- */
.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.work-list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 30px 8px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.45s var(--ease), background 0.45s var(--ease), opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.work-list li:hover {
  padding-left: 24px;
  background: rgba(17, 16, 16, 0.05);
}

.work-num {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-weight: 500;
}

.work-name {
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(1.05rem, 2.4vw, 1.7rem);
  font-weight: 500;
  line-height: 1.5;
}

.work-en {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-weight: 500;
  text-transform: uppercase;
}

/* ---------- Company ---------- */
.company-list { margin: 0; }

.company-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 30px 8px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.company-row:first-child { border-top: 1px solid var(--line); }

.company-row dt {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-weight: 500;
  padding-top: 6px;
  margin: 0;
}

.company-row dd {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 500;
  line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact-direct { max-width: 720px; }

.contact-lead {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
  line-height: 2;
  color: rgba(17, 16, 16, 0.82);
  margin: 0 0 34px;
}

.contact-mail {
  display: inline-block;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  word-break: break-all;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.4s var(--ease), opacity 0.3s var(--ease);
}

.contact-mail:hover {
  border-bottom-color: var(--ink);
  opacity: 0.72;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 0 56px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.footer-copy {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(232, 195, 76, 0.5);
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .container { padding: 0 22px; }
  .header-inner { padding: 0 22px; height: 78px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-name { font-size: 0.98rem; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    display: none;
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    height: auto;
    overflow: visible;
    font-size: 1.6rem;
    letter-spacing: 0.06em;
    padding: 10px 0;
  }

  .site-nav a em {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
  }

  .site-nav a:hover span,
  .site-nav a:hover em { transform: none; }

  .hero { padding: 100px 22px 120px; }
  .section { padding: 90px 0; }
  .section-head { margin-bottom: 44px; }

  .work-list li {
    grid-template-columns: 44px 1fr;
    gap: 12px;
    padding: 22px 4px;
  }

  .work-en { display: none; }
  .work-list li:hover { padding-left: 4px; background: none; }

  .company-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 4px;
  }

  .site-footer { padding: 48px 0 40px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .hero-sub { opacity: 1; transform: none; }
  .grain { display: none; }
}
