:root {
  --background: #f7f7f7;
  --text: #241f1b;
  --muted: rgba(36, 31, 27, 0.62);
  --subtle: rgba(36, 31, 27, 0.38);
  --line: rgba(36, 31, 27, 0.1);
  --line-strong: rgba(36, 31, 27, 0.16);
  --surface: rgba(255, 255, 255, 0.42);
  --radius: 14px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Roboto Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 20;
  height: 46px;
  pointer-events: none;
  content: "";
  opacity: 0;
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  backdrop-filter: blur(18px) saturate(1.05);
  transition: opacity 180ms ease;
}

body::before {
  top: 0;
  background: rgba(247, 247, 247, 0.38);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.72) 46%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.72) 46%, transparent 100%);
}

body::after {
  bottom: 0;
  background: rgba(247, 247, 247, 0.34);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.68) 46%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.68) 46%, transparent 100%);
}

body.has-scroll-before::before,
body.has-scroll-after::after {
  opacity: 1;
}

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

p,
h1,
h2,
h3 {
  margin: 0;
}

.page-shell {
  width: min(calc(100vw - 48px), 520px);
  margin: 0 auto;
  padding: 82px 0 118px;
}

.intro {
  display: grid;
  gap: 34px;
  position: relative;
}

.hero-sticker {
  position: absolute;
  top: -42px;
  left: 286px;
  z-index: 2;
  display: block;
  width: 118px;
  height: 118px;
  pointer-events: none;
  opacity: 0;
  filter: blur(10px);
  transform: translate(18px, -12px) rotate(13deg) scale(0.82);
  transform-origin: 54% 60%;
  animation: sticker-reveal 820ms cubic-bezier(0.16, 1, 0.3, 1) 360ms both;
  user-select: none;
}

.hero-sticker::before {
  position: absolute;
  inset: -10px;
  z-index: 0;
  background: url("assets/onigiri-sticker-3d.png") center / contain no-repeat;
  content: "";
  filter:
    brightness(0)
    invert(1)
    drop-shadow(0 0 1px rgba(36, 31, 27, 0.12))
    drop-shadow(0 15px 22px rgba(36, 31, 27, 0.16));
  opacity: 1;
  transform: scale(1.13);
  transform-origin: 50% 56%;
}

.hero-sticker img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.96))
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.96))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.96))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.96))
    drop-shadow(0 10px 12px rgba(36, 31, 27, 0.08));
}

.intro h1 {
  position: relative;
  z-index: 1;
  font-family: var(--sans);
  font-size: 68px;
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    1px 0 0 rgba(36, 31, 27, 0.06),
    0 1px 0 rgba(36, 31, 27, 0.08);
  text-transform: uppercase;
}

.intro h1 span {
  display: block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(14px);
  animation: pixel-title-in 720ms steps(7, end) both;
}

.intro h1 span:nth-child(2) {
  animation-delay: 90ms;
}

@keyframes pixel-title-in {
  0% {
    opacity: 0;
    filter: blur(8px);
    clip-path: inset(0 100% 0 0);
    text-shadow:
      8px 0 0 rgba(36, 31, 27, 0.16),
      0 4px 0 rgba(36, 31, 27, 0.08);
    transform: translateY(14px);
  }

  36% {
    opacity: 1;
    filter: blur(2px);
    clip-path: inset(0 38% 0 0);
  }

  72% {
    filter: blur(0);
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    clip-path: inset(0 0 0 0);
    text-shadow:
      1px 0 0 rgba(36, 31, 27, 0.06),
      0 1px 0 rgba(36, 31, 27, 0.08);
    transform: translateY(0);
  }
}

@keyframes sticker-reveal {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translate(18px, -12px) rotate(13deg) scale(0.82);
  }

  48% {
    opacity: 1;
    filter: blur(1px);
    transform: translate(-2px, 2px) rotate(4deg) scale(1.06);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(0, 0) rotate(7deg) scale(1);
  }
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: var(--muted);
}

.quick-links a,
.footer-legal a,
.footer span,
.entry time,
.entry-block h2 {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}

.quick-links a,
.section-link {
  position: relative;
  transition: color 180ms ease;
}

.quick-links a::after,
.section-link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  width: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transition: width 220ms ease, left 220ms ease;
}

.quick-links a:hover,
.section-link:hover {
  color: var(--text);
}

.quick-links a:hover::after,
.section-link:hover::after {
  right: auto;
  left: 0;
  width: 100%;
}

.separator {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 72px 0;
}

.separator span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--subtle);
}

.note,
.plain-copy {
  display: grid;
  gap: 18px;
  color: var(--muted);
}

.entry-block {
  display: grid;
  gap: 34px;
}

.entry-block h2 {
  color: var(--subtle);
  font-weight: 400;
}

.section-link {
  width: max-content;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}

.entry-list {
  display: grid;
  gap: 28px;
}

.entry {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
}

.entry time {
  color: var(--subtle);
}

.entry h3 {
  color: rgba(36, 31, 27, 0.9);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.entry p {
  max-width: 410px;
  margin-top: 4px;
  color: var(--muted);
}

.compact {
  gap: 22px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 72px);
  justify-content: space-between;
  row-gap: 34px;
  width: 100%;
  margin: 0;
  padding: 3px 0;
  overflow: visible;
}

.tool-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(36, 31, 27, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 6px 14px rgba(36, 31, 27, 0.025);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.tool-link:hover {
  border-color: rgba(36, 31, 27, 0.13);
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(36, 31, 27, 0.04);
  transform: translateY(-2px);
}

.tool-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 2;
  display: grid;
  width: max-content;
  min-width: 168px;
  max-width: min(190px, calc(100vw - 32px));
  gap: 4px;
  padding: 12px 14px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(48, 45, 42, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 20px 34px rgba(36, 31, 27, 0.18);
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  filter: blur(6px);
  transform: translate(-50%, 9px) scale(0.92);
  transform-origin: 50% 100%;
  transition:
    opacity 260ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 260ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-tooltip strong {
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.2;
  letter-spacing: 0;
}

.tool-tooltip em {
  color: rgba(255, 255, 255, 0.66);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-link:hover .tool-tooltip,
.tool-link:focus .tool-tooltip,
.tool-link:focus-visible .tool-tooltip {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, 0) scale(1);
}

.tool-link img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(36, 31, 27, 0.08));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer {
  display: grid;
  gap: 40px;
  padding-top: 120px;
  color: var(--subtle);
}

.footer-main {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.footer-pixel-onigiri {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  image-rendering: pixelated;
  object-fit: contain;
  filter: none;
  transform: rotate(0deg);
  transform-origin: 50% 72%;
  animation: pixel-onigiri-look 1.55s steps(1, end) infinite;
}

@keyframes pixel-onigiri-look {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  22% {
    transform: translateX(-1px) rotate(-9deg);
  }

  44% {
    transform: translateX(0) rotate(0deg);
  }

  72% {
    transform: translateX(1px) rotate(9deg);
  }
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: center;
  color: rgba(36, 31, 27, 0.32);
  text-align: center;
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  transition: color 160ms ease;
}

.footer-legal a:hover {
  color: var(--muted);
}

.police-badge {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  object-fit: contain;
}

.link-dock {
  --dock-width: min(calc(100vw - 44px), 432px);
  --dock-padding-x: 40px;
  --dock-padding-y: 8px;

  position: fixed;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  min-height: 56px;
  padding: var(--dock-padding-y) 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(45, 43, 41, 0.93);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 34px rgba(36, 31, 27, 0.22);
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  backdrop-filter: blur(18px) saturate(1.05);
  filter: blur(10px);
  transform: translate(-50%, calc(100% + 48px)) scale(0.82);
  transition:
    width 260ms cubic-bezier(0.4, 0, 0.2, 1),
    padding 260ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms ease,
    filter 180ms ease,
    transform 260ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 260ms;
  will-change: width, opacity, filter, transform;
}

body.show-link-dock .link-dock {
  width: var(--dock-width);
  padding: var(--dock-padding-y) var(--dock-padding-x);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  filter: blur(0);
  transform: translate(-50%, 0) scale(1);
  animation: dock-enter 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition-delay: 0s;
}

body.is-link-dock-leaving .link-dock {
  pointer-events: none;
  animation: dock-exit 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes dock-enter {
  0% {
    width: 56px;
    padding-right: 12px;
    padding-left: 12px;
    opacity: 0;
    filter: blur(10px);
    transform: translate(-50%, calc(100% + 48px)) scale(0.82);
  }

  34% {
    width: 56px;
    padding-right: 12px;
    padding-left: 12px;
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, 0) scale(1);
  }

  54% {
    width: 56px;
    padding-right: 12px;
    padding-left: 12px;
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    width: var(--dock-width);
    padding-right: var(--dock-padding-x);
    padding-left: var(--dock-padding-x);
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes dock-exit {
  0% {
    width: var(--dock-width);
    padding-right: var(--dock-padding-x);
    padding-left: var(--dock-padding-x);
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    width: 56px;
    padding-right: 12px;
    padding-left: 12px;
    opacity: 0;
    filter: blur(10px);
    transform: translate(-50%, calc(100% + 48px)) scale(0.82);
  }
}

.link-dock a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  color: inherit;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 450;
  line-height: 1;
  letter-spacing: 0;
  transition:
    color 160ms ease,
    opacity 340ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.link-dock a:hover {
  color: #fff;
}

.link-dock a,
.link-dock span {
  opacity: 0;
  transform: translateY(7px);
}

body.show-link-dock .link-dock a,
body.show-link-dock .link-dock span {
  opacity: 1;
  transform: translateY(0);
}

body.is-link-dock-leaving .link-dock a,
body.is-link-dock-leaving .link-dock span {
  opacity: 0;
  transform: translateY(5px);
  transition-delay: 0s;
}

body.is-link-dock-entering .link-dock > :nth-child(1) {
  transition-delay: 520ms;
}

body.is-link-dock-entering .link-dock > :nth-child(2) {
  transition-delay: 540ms;
}

body.is-link-dock-entering .link-dock > :nth-child(3) {
  transition-delay: 560ms;
}

body.is-link-dock-entering .link-dock > :nth-child(4) {
  transition-delay: 580ms;
}

body.is-link-dock-entering .link-dock > :nth-child(5) {
  transition-delay: 600ms;
}

body.is-link-dock-entering .link-dock > :nth-child(6) {
  transition-delay: 620ms;
}

body.is-link-dock-entering .link-dock > :nth-child(7) {
  transition-delay: 640ms;
}

.link-dock span {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
  transition:
    opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 560px) {
  body::before,
  body::after {
    height: 40px;
  }

  .page-shell {
    width: min(calc(100vw - 32px), 520px);
    padding-top: 58px;
  }

  .intro h1 {
    font-size: 46px;
    line-height: 0.94;
  }

  .hero-sticker {
    top: -38px;
    left: min(206px, calc(100% - 82px));
    width: 88px;
    height: 88px;
  }

  .quick-links {
    gap: 18px 24px;
  }

  .separator {
    margin: 56px 0;
  }

  .entry {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
  }

  .tool-grid {
    grid-template-columns: repeat(4, 68px);
    row-gap: 30px;
  }

  .tool-link {
    width: 68px;
    height: 68px;
    border-radius: 15px;
  }

  .tool-link img {
    width: 46px;
    height: 46px;
  }

  .tool-tooltip {
    min-width: 150px;
    padding: 10px 12px;
  }

  .footer {
    gap: 40px;
  }

  .footer-main {
    flex-direction: row;
    gap: 6px;
  }

  .footer-legal {
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .link-dock {
    --dock-width: min(calc(100vw - 28px), 432px);
    --dock-padding-x: 28px;
    --dock-padding-y: 7px;

    min-height: 52px;
  }

  .link-dock a {
    font-size: 12px;
  }

}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .hero-sticker,
  .intro h1 span,
  .link-dock,
  .link-dock a,
  .footer-pixel-onigiri,
  .tool-link,
  .tool-tooltip {
    animation: none;
    transition: none;
  }

  .hero-sticker,
  .intro h1 span {
    opacity: 1;
    filter: none;
    transform: none;
    clip-path: none;
  }

  .hero-sticker {
    transform: rotate(7deg);
  }
}
