:root {
  --ink: #211a1d;
  --muted: #6d6266;
  --paper: #fffdf7;
  --milk: #ffffff;
  --lemon: #ffe66d;
  --peach: #ff8a7a;
  --mint: #74d99f;
  --sky: #78c7ff;
  --lilac: #c8b6ff;
  --line: #eadfd7;
  --shadow: 0 16px 36px rgba(78, 50, 35, 0.12);
  --deep-shadow: 0 24px 70px rgba(33, 26, 29, 0.16);
  --scroll-progress: 0%;
  --page-shift: 0px;
  --cursor-x: 50%;
  --cursor-y: 18%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at var(--cursor-x) var(--cursor-y), rgba(255, 230, 109, 0.28), transparent 24rem),
    radial-gradient(circle at 12px calc(12px + var(--page-shift)), rgba(255, 138, 122, 0.14) 0 3px, transparent 4px),
    linear-gradient(180deg, #fffaf0 0%, #f3fbff 46%, #fffdf7 100%);
  background-size: auto, 32px 32px, auto;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border: 2px solid rgba(33, 26, 29, 0.08);
  border-radius: 999px;
  opacity: 0.72;
  transform: translate3d(0, calc(var(--page-shift) * -0.16), 0);
}

body::before {
  width: 280px;
  height: 280px;
  right: max(24px, 6vw);
  top: 120px;
  background: rgba(116, 217, 159, 0.22);
}

body::after {
  width: 180px;
  height: 180px;
  left: max(18px, 4vw);
  bottom: 130px;
  background: rgba(120, 199, 255, 0.2);
  transform: translate3d(0, calc(var(--page-shift) * 0.12), 0);
}

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

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

.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--scroll-progress);
  height: 4px;
  background: linear-gradient(90deg, var(--peach), var(--lemon), var(--mint), var(--sky));
  box-shadow: 0 0 18px rgba(255, 138, 122, 0.38);
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: rgba(255, 253, 247, 0.9);
  border-bottom: 1px solid rgba(234, 223, 215, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 34px rgba(33, 26, 29, 0.06);
  transition:
    padding 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.site-header.is-compact {
  padding: 8px 18px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 8px 28px rgba(33, 26, 29, 0.08);
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 30px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    font-size 220ms ease,
    min-height 220ms ease;
}

.brand::before {
  content: "";
  width: 54px;
  height: 54px;
  margin-right: 12px;
  background: url("./assets/brand/w-4900.jpg") center / cover no-repeat;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(33, 26, 29, 0.22);
  transition:
    width 220ms ease,
    height 220ms ease,
    margin-right 220ms ease;
}

.site-header.is-compact .brand {
  min-height: 36px;
  font-size: 18px;
}

.site-header.is-compact .brand::before {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.threads-link {
  justify-self: end;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: color 160ms ease;
}

.threads-link:hover,
.threads-link:focus-visible {
  color: #0d64a6;
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 42px;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(88vh - 70px);
  margin: 0 auto;
  padding: 54px 0 42px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 28px auto auto 42%;
  width: 150px;
  height: 150px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6), transparent),
    var(--lilac);
  border: 2px solid rgba(33, 26, 29, 0.18);
  border-radius: 34% 66% 58% 42% / 44% 34% 66% 56%;
  filter: blur(0.2px);
  opacity: 0.46;
  transform: translate3d(0, calc(var(--page-shift) * 0.1), 0) rotate(14deg);
}

.hero-copy {
  position: relative;
}

.hero-copy::after {
  content: "라라라";
  position: absolute;
  right: 8%;
  bottom: -34px;
  padding: 6px 10px;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  transform: rotate(-7deg);
  animation: bob 3.2s ease-in-out infinite;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 6px 10px;
  background: var(--lemon);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: 64px;
  font-weight: 950;
}

h2 {
  font-size: 42px;
  font-weight: 950;
}

.intro {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 160ms ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.55) 42%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 520ms ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  filter: saturate(1.06);
}

.button:hover::after {
  transform: translateX(120%);
}

.button.primary {
  background: var(--peach);
}

.button.secondary {
  background: var(--milk);
}

.ari-panel {
  margin: 0;
  padding: 12px;
  background: var(--milk);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform:
    perspective(900px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translateY(var(--lift, 0px))
    rotate(2deg);
  transition:
    box-shadow 220ms ease,
    transform 220ms ease;
}

.ari-panel:hover {
  box-shadow: var(--deep-shadow);
}

.ari-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  transition: transform 500ms ease, filter 500ms ease;
}

.ari-panel:hover img {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.015);
}

.ari-panel figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.ari-panel span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 64px;
}

.facts > div {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: var(--milk);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(33, 26, 29, 0.18);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
  transform:
    perspective(900px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translateY(var(--lift, 0px));
}

.facts > div::after {
  content: "";
  position: absolute;
  inset: auto -30px -42px auto;
  width: 120px;
  height: 90px;
  background: rgba(255, 230, 109, 0.45);
  border-radius: 999px;
  transform: rotate(-18deg);
}

.facts > div:hover {
  background: #fff8ce;
  box-shadow: 7px 7px 0 rgba(33, 26, 29, 0.2);
}

.fact-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.facts strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.content-section {
  position: relative;
  padding: 28px 0;
  scroll-margin-top: 92px;
}

.quote-section {
  background: rgba(255, 255, 255, 0.58);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.joke-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 253, 247, 0.5)),
    rgba(255, 255, 255, 0.18);
}

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

.section-heading h2 {
  margin: 0;
  font-size: 42px;
  font-weight: 950;
  line-height: 1.08;
}

.section-panel {
  padding: 28px 0 48px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.quote-card {
  --pose-x: 9deg;
  --pose-y: -7deg;
  --pose-z: -1deg;
  --float-y: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  padding: 18px;
  background: var(--milk);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(33, 26, 29, 0.18);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    box-shadow 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 180ms ease;
  transform:
    rotateX(var(--pose-x))
    rotateY(var(--pose-y))
    rotateZ(var(--pose-z))
    translate3d(0, calc(var(--float-y) + var(--lift, 0px)), 0);
  transform-style: preserve-3d;
  will-change: transform;
}

.quote-card::after,
.joke-card::after {
  content: "";
  position: absolute;
  inset: auto 9% -14px 9%;
  height: 18px;
  z-index: -1;
  background: rgba(33, 26, 29, 0.16);
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.72;
  transform: translateZ(-34px);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.quote-card:hover,
.quote-card:focus-within,
.quote-card:focus-visible,
.quote-card.is-front {
  z-index: 5;
  box-shadow: 10px 10px 0 rgba(33, 26, 29, 0.22);
  filter: saturate(1.05);
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    rotateZ(0deg)
    translate3d(0, -2px, 44px)
    scale(1.015);
}

.quote-card:focus-visible,
.joke-card:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 4px;
}

.quote-card:hover::after,
.quote-card:focus-within::after,
.quote-card:focus-visible::after,
.quote-card.is-front::after,
.joke-card:hover::after,
.joke-card:focus-within::after,
.joke-card:focus-visible::after,
.joke-card.is-front::after {
  opacity: 0.36;
  transform: translateY(12px) translateZ(-44px) scale(0.86);
}

.quote-card:nth-child(3n + 1) {
  background: #eafff1;
  --pose-y: -6deg;
  --pose-z: 1deg;
}

.quote-card:nth-child(3n + 2) {
  background: #fff3ba;
  --pose-y: 7deg;
  --pose-z: -1deg;
  --float-y: 5px;
}

.quote-card:nth-child(3n) {
  background: #e9f6ff;
  --pose-x: 11deg;
  --pose-y: 3deg;
  --float-y: -3px;
}

.quote-card.big {
  grid-column: span 2;
  grid-row: span 2;
  background: var(--peach);
  font-size: 36px;
  line-height: 1.18;
}

.quote-card p {
  margin: 0 0 16px;
}

.quote-card a {
  display: inline-flex;
  margin-top: auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery {
  column-count: 4;
  column-gap: 14px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.joke-card {
  --pose-x: 8deg;
  --pose-y: -6deg;
  --pose-z: 1deg;
  --float-y: 0px;
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  background: var(--milk);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(33, 26, 29, 0.18);
  cursor: pointer;
  transform:
    rotateX(var(--pose-x))
    rotateY(var(--pose-y))
    rotateZ(var(--pose-z))
    translate3d(0, calc(var(--float-y) + var(--lift, 0px)), 0);
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    box-shadow 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 180ms ease;
}

.joke-card:hover,
.joke-card:focus-within,
.joke-card:focus-visible,
.joke-card.is-front {
  z-index: 5;
  box-shadow: 11px 11px 0 rgba(33, 26, 29, 0.2);
  filter: saturate(1.05);
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    rotateZ(0deg)
    translate3d(0, -2px, 44px)
    scale(1.015);
}

.joke-card:nth-child(4n + 1) {
  --pose-y: -8deg;
  --pose-z: 1deg;
}

.joke-card:nth-child(4n + 2) {
  --pose-x: 10deg;
  --pose-y: 6deg;
  --pose-z: -1deg;
  --float-y: 6px;
}

.joke-card:nth-child(4n + 3) {
  --pose-y: -2deg;
  --pose-z: 0deg;
  --float-y: -4px;
}

.joke-card:nth-child(4n) {
  --pose-y: 8deg;
  --pose-z: 1deg;
}

.joke-card img {
  width: 100%;
  background: #f4f0ea;
  transition:
    transform 360ms ease,
    filter 360ms ease;
}

.joke-card:hover img {
  filter: contrast(1.03);
  transform: scale(1.025);
}

.joke-card figcaption {
  padding: 10px 12px 12px;
}

.joke-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.joke-card a {
  display: inline-flex;
  margin-top: 6px;
  color: #0d64a6;
  font-size: 13px;
  font-weight: 900;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 24px;
  background: var(--ink);
  color: var(--milk);
  font-weight: 900;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--lemon);
}

.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.992);
  transition:
    opacity 520ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-7deg);
  }

  50% {
    transform: translateY(-6px) rotate(-4deg);
  }
}

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

  h1 {
    font-size: 46px;
  }

  .facts,
  .quote-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery {
    column-count: 3;
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 8px;
    padding: 14px 12px;
  }

  .site-header.is-compact {
    padding: 8px 12px;
  }

  .brand {
    font-size: 28px;
  }

  .brand::before {
    width: 50px;
    height: 50px;
    margin-right: 10px;
  }

  .site-header.is-compact .brand {
    font-size: 17px;
  }

  .site-header.is-compact .brand::before {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .threads-link {
    font-size: 13px;
  }

  .hero,
  .facts,
  .section-heading,
  .quote-grid,
  .gallery {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 32px;
  }

  .section-heading h2 {
    font-size: 31px;
  }

  .intro {
    font-size: 16px;
  }

  .facts,
  .quote-grid {
    grid-template-columns: 1fr;
  }

  .quote-card.big {
    grid-column: auto;
    grid-row: auto;
    font-size: 28px;
  }

  .quote-card:nth-child(n),
  .joke-card:nth-child(n) {
    --pose-x: 2.5deg;
    --pose-y: -1.5deg;
    --pose-z: 0deg;
    --float-y: 0px;
  }

  .quote-card:nth-child(even),
  .joke-card:nth-child(even) {
    --pose-y: 1.5deg;
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    column-count: initial;
    column-gap: 0;
    transform-style: flat;
  }

  .joke-card {
    display: block;
    margin: 0;
    transform-origin: center top;
  }
}

@media (max-width: 420px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }

}
