:root {
  --ink: #171715;
  --paper: #fffaf0;
  --yellow: #ffd94f;
  --yellow-bright: #ffe77d;
  --blue: #2f68ff;
  --blue-dark: #0a1f55;
  --orange: #ff6b35;
  --purple: #6c48ff;
  --line: rgba(23, 23, 21, 0.18);
  --shadow: 0 20px 60px rgba(23, 23, 21, 0.14);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.75;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image: linear-gradient(rgba(23, 23, 21, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 21, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  min-height: 48px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(23, 23, 21, 0.12);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(calc(100% - 40px), var(--max));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 148px;
}

.brand img {
  width: 100%;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

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

.site-nav a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.button:hover,
.button:focus-visible {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.button--dark {
  color: #fff;
  background: var(--ink);
}

.button--small {
  min-height: 38px;
  padding: 7px 14px;
  box-shadow: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--yellow);
  border-bottom: 2px solid var(--ink);
}

.hero::after {
  position: absolute;
  right: -120px;
  bottom: -190px;
  width: 520px;
  height: 520px;
  border: 90px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  content: "";
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), var(--max));
  min-height: 680px;
  margin: 0 auto;
  padding: 88px 0 70px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 72px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-logo {
  width: min(100%, 630px);
  margin-bottom: 22px;
}

.hero h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 620px;
  margin: 22px 0 30px;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.release-note {
  margin-top: 22px;
  font-size: 0.82rem;
  font-weight: 700;
}

.board-demo {
  position: relative;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--blue-dark);
  box-shadow: 14px 14px 0 rgba(23, 23, 21, 0.85);
}

.board-label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 5px;
  aspect-ratio: 6 / 9;
}

.cell {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(2, 13, 44, 0.75);
}

.token {
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 2rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.28);
}

.token--f {
  background: #f04438;
}

.token--u {
  background: #3680f5;
}

.token--c {
  background: #f28b23;
}

.token--k {
  background: #7357dc;
}

.token--garbage {
  background: repeating-linear-gradient(45deg, #5a5a5a 0 8px, #777 8px 16px);
}

.token--bomb {
  border-radius: 50%;
  background: #161616;
}

.board-callout {
  position: absolute;
  right: -30px;
  bottom: 32px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  background: #fff;
  font-weight: 950;
  transform: rotate(-4deg);
}

.section {
  padding: 110px 0;
}

.section--ink {
  color: #fff;
  background: var(--ink);
}

.section--blue {
  color: #fff;
  background: var(--blue-dark);
}

.section-inner {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 50px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.section-heading p:last-child {
  max-width: 700px;
  margin-top: 20px;
  font-size: 1.08rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  position: relative;
  min-height: 310px;
  padding: 28px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.feature-card span {
  display: block;
  margin-bottom: 52px;
  font-size: 3.5rem;
  font-weight: 950;
  line-height: 1;
}

.feature-card h3 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}

.feature-card p {
  margin: 0;
  opacity: 0.78;
}

.play-loop {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: loop;
}

.loop-step {
  position: relative;
  min-height: 280px;
  padding: 30px;
  border: 2px solid var(--ink);
  border-right-width: 0;
  background: #fff;
  counter-increment: loop;
}

.loop-step:last-child {
  border-right-width: 2px;
}

.loop-step::before {
  display: block;
  margin-bottom: 55px;
  color: var(--blue);
  content: "0" counter(loop);
  font-size: 2.8rem;
  font-weight: 950;
}

.loop-step h3 {
  margin: 0 0 10px;
}

.loop-step p {
  margin: 0;
  font-size: 0.94rem;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.mode-card {
  padding: 36px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.mode-card h3 {
  margin: 0 0 14px;
  color: var(--yellow);
  font-size: 1.8rem;
}

.mode-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.mode-card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 40px;
  align-items: center;
}

.status-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.status-copy {
  padding: 48px;
}

.status-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
}

.status-copy ul {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.status-copy li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-weight: 750;
}

.status-aside {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--yellow);
  text-align: center;
}

.status-aside strong {
  display: block;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 0.95;
}

.status-aside span {
  display: block;
  margin-top: 18px;
  font-weight: 900;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 70px;
}

.contact-intro h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
}

.contact-intro p {
  margin-top: 24px;
}

.contact-meta {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.contact-form {
  padding: 38px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  box-shadow: 10px 10px 0 var(--yellow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  margin-bottom: 20px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.86rem;
  font-weight: 900;
}

.required {
  color: #b62a1c;
}

.field input,
.field select,
.field textarea,
.login-card input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  background: #fffdf7;
}

.field textarea {
  min-height: 180px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.login-card input:focus {
  outline: 4px solid rgba(47, 104, 255, 0.25);
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.check-field input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  background: #fff;
  font-weight: 800;
}

.notice--success {
  background: #dff7dd;
}

.notice--error {
  background: #ffe2dd;
}

.site-footer {
  padding: 48px 0;
  color: #fff;
  background: var(--ink);
}

.footer-inner {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.footer-logo {
  width: 180px;
  filter: invert(1);
}

.footer-copy {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 0.84rem;
  font-weight: 800;
}

.privacy-text {
  max-width: 850px;
}

.privacy-text h3 {
  margin-top: 34px;
}

.admin-body {
  min-height: 100vh;
  background: #f2f0e9;
}

.admin-header {
  padding: 20px 0;
  color: #fff;
  background: var(--ink);
}

.admin-header-inner,
.admin-main {
  width: min(calc(100% - 32px), 1080px);
  margin: 0 auto;
}

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

.admin-header h1 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-header a {
  color: #fff;
}

.admin-main {
  padding: 54px 0 80px;
}

.login-card {
  width: min(100%, 460px);
  margin: 30px auto;
  padding: 38px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 10px 10px 0 var(--yellow);
}

.unread-counter {
  margin: 0 0 28px;
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  text-align: center;
}

.unread-counter strong {
  display: block;
  font-size: 3.4rem;
  line-height: 1;
}

.login-card .field {
  margin-bottom: 18px;
}

.admin-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-summary h2 {
  margin: 0;
}

.contact-list {
  display: grid;
  gap: 14px;
}

.contact-item {
  padding: 24px;
  border: 2px solid var(--ink);
  background: #fff;
}

.contact-item--read {
  opacity: 0.64;
  border-color: #aaa;
}

.contact-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.contact-item-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.contact-item-meta {
  margin: 6px 0 0;
  color: #666;
  font-size: 0.8rem;
}

.contact-message {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid currentColor;
  font-size: 0.73rem;
  font-weight: 900;
}

.status-badge--unread {
  color: #9b240f;
  background: #ffe2dd;
}

.admin-actions {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  margin-top: 20px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.96);
  text-align: right;
  backdrop-filter: blur(8px);
}

.empty-state {
  padding: 60px 30px;
  border: 2px dashed #aaa;
  background: #fff;
  text-align: center;
}

@media (max-width: 900px) {
  .hero-inner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .board-demo {
    width: min(85vw, 430px);
  }

  .feature-grid,
  .play-loop {
    grid-template-columns: 1fr 1fr;
  }

  .loop-step:nth-child(2) {
    border-right-width: 2px;
  }

  .loop-step:nth-child(n + 3) {
    border-top-width: 0;
  }

  .status-card,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    padding: 22px 20px;
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
  }

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

  .site-nav .button {
    width: 100%;
  }

  .hero-inner {
    padding-top: 62px;
  }

  .section {
    padding: 80px 0;
  }

  .feature-grid,
  .play-loop,
  .modes,
  .form-row {
    grid-template-columns: 1fr;
  }

  .loop-step,
  .loop-step:nth-child(2) {
    border-right-width: 2px;
    border-top-width: 0;
  }

  .loop-step:first-child {
    border-top-width: 2px;
  }

  .mode-card--wide {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .contact-form,
  .status-copy,
  .login-card {
    padding: 26px;
  }

  .footer-inner,
  .admin-summary,
  .contact-item-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
