:root {
  color-scheme: dark;
  --bg: #080706;
  --bg-soft: #0f0d0b;
  --text: #f0eadc;
  --muted: #a79d8b;
  --dim: #6f675b;
  --line: rgba(240, 234, 220, 0.12);
  --line-strong: rgba(240, 234, 220, 0.22);
  --accent: #b88955;
  --accent-soft: rgba(184, 137, 85, 0.14);
  --green: #9aa66d;
  --blue: #8799a8;
  --red: #aa7667;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --serif: "Shippori Mincho", "Noto Serif JP", serif;
  --sans: "IBM Plex Sans JP", "Noto Sans JP", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  background:
    radial-gradient(circle at 18% -10%, rgba(184, 137, 85, 0.12), transparent 34rem),
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.045), transparent 26rem),
    linear-gradient(135deg, #070605 0%, #0d0b09 42%, #060504 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 72%);
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 460px;
  height: 460px;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(184, 137, 85, 0.22) 0%, rgba(184, 137, 85, 0.11) 28%, transparent 66%);
  border-radius: 999px;
  filter: blur(10px);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(-999px, -999px, 0) translate(-50%, -50%);
  transition: opacity 220ms ease;
  will-change: transform, opacity;
}

.cursor-glow.is-active {
  opacity: 0.82;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.88em;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(240, 234, 220, 0.055);
  background: transparent;
  isolation: isolate;
  transition: border-color 220ms ease;
}

.site-header::before {
  position: absolute;
  top: 0;
  right: 50%;
  bottom: -24px;
  left: 50%;
  z-index: 0;
  width: 100vw;
  margin-inline: -50vw;
  pointer-events: none;
  content: "";
  opacity: 0.72;
  background:
    linear-gradient(
      180deg,
      rgb(8, 7, 6) 0%,
      rgb(8, 7, 6) 72%,
      rgba(8, 7, 6, 0) 100%
    ),
    radial-gradient(circle at 12% 0%, rgba(184, 137, 85, 0.09), transparent 24rem);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  backdrop-filter: blur(18px) saturate(118%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  transition: opacity 220ms ease, box-shadow 220ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: rgba(240, 234, 220, 0.13);
}

.site-header.is-scrolled::before {
  opacity: 1;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.brand,
.top-nav {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  filter: drop-shadow(0 7px 18px rgba(184, 137, 85, 0.12));
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.brand-copy {
  display: block;
}

.brand-name,
.brand-kanji {
  display: block;
}

.brand-name {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-shadow: 0 1px 18px rgba(8, 7, 6, 0.86);
  text-transform: uppercase;
}

.brand-kanji {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 18px rgba(8, 7, 6, 0.86);
}

.top-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 16px rgba(8, 7, 6, 0.78);
}

.top-nav a {
  transition: color 180ms ease;
}

.top-nav a:hover {
  color: var(--text);
}

.language-switch {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.language-button {
  min-width: 30px;
  padding: 4px 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease;
}

.language-button:hover,
.language-button[aria-pressed="true"] {
  color: var(--text);
}

.hero {
  display: grid;
  align-items: center;
  min-height: clamp(420px, 56vh, 560px);
  padding: 48px 0 54px;
}

.hero-copy {
  display: grid;
  justify-items: center;
  margin-top: 0;
  text-align: center;
}

.eyebrow,
.section-index,
.project-number,
.project-meta,
.contact-label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(var(--hero-title-min, 4.4rem), var(--hero-title-fluid, 9vw), var(--hero-title-max, 8.2rem));
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.07em;
  white-space: pre-line;
}

.hero-lede {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 300;
  white-space: pre-line;
}

.projects-section,
.contact-section {
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  gap: 22px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.projects-heading p {
  max-width: 440px;
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
  text-align: right;
}

.contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 38px;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.contact-action:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 44px;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.project-row:hover {
  border-color: rgba(184, 137, 85, 0.56);
}

.project-number {
  color: var(--dim);
}

.project-body,
.project-topline {
  display: grid;
  min-width: 0;
}

.project-topline {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.project-name {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.project-description {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.project-meta {
  margin-top: 16px;
  color: var(--dim);
  font-size: 0.68rem;
}

.project-arrow {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.9rem;
  transition: transform 180ms ease, color 180ms ease;
}

.project-row:hover .project-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-live {
  color: var(--green);
}

.status-building {
  color: var(--accent);
}

.status-private {
  color: var(--blue);
}

.status-archive {
  color: var(--dim);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 44px;
  border-top: 1px solid var(--line);
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 94px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.contact-main {
  display: grid;
  align-content: start;
}

.contact-label {
  color: var(--dim);
  font-size: 0.66rem;
}

.contact-value {
  margin-top: 16px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  word-break: break-word;
}

.contact-detail {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 0 44px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100% - 36px, 760px);
  }

  .site-header {
    min-height: 58px;
  }

  .brand-mark {
    width: 46px;
    height: 27px;
  }

  .top-nav {
    gap: 14px;
  }

  .language-switch {
    padding-left: 2px;
  }

  .hero {
    min-height: clamp(360px, 48vh, 460px);
    padding: 42px 0 48px;
  }

  .hero-copy {
    margin-top: 0;
  }

  .hero h1 {
    font-size: clamp(
      var(--hero-title-mobile-min, 3.7rem),
      var(--hero-title-mobile-fluid, 15vw),
      var(--hero-title-mobile-max, 6rem)
    );
  }

  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .projects-heading {
    display: grid;
    gap: 18px;
  }

  .projects-heading p {
    max-width: none;
    text-align: left;
  }

  .contact-row {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 28px, 560px);
  }

  .brand-name {
    letter-spacing: 0.12em;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 42px;
    height: 25px;
  }

  .brand-kanji {
    display: none;
  }

  .top-nav a:nth-child(2) {
    display: none;
  }

  .top-nav a:nth-child(3) {
    display: none;
  }

  .language-button {
    min-width: 26px;
    padding: 4px;
  }

  .project-row,
  .contact-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-row {
    min-height: auto;
  }

  .project-topline {
    grid-template-columns: 1fr;
  }

  .project-name {
    white-space: normal;
  }

  .project-arrow {
    display: none;
  }

  .site-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-glow {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (pointer: coarse) {
  .cursor-glow {
    display: none;
  }
}

@media (hover: none) {
  .cursor-glow {
    display: none;
  }
}

@media (max-width: 760px) {
  .cursor-glow {
    display: none;
  }
}
