/* ── Nudaeng — pencil / Korean-cute theme ── */

:root {
  --cream: #faf6ee;
  --paper: #f3ead8;
  --beige: #e8d5b5;
  --tan: #c9a66b;
  --sky: #7eb8da;
  --sky-deep: #5a9ec9;
  --ink: #2a2520;
  --ink-soft: #5c5348;
  --white: #fffef9;
  --shadow: rgba(42, 37, 32, 0.12);
  --radius: 18px;
  --font-display: "Gaegu", cursive;
  --font-body: "Nunito", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* paper texture overlay */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(126, 184, 218, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 166, 107, 0.12) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(42, 37, 32, 0.025) 28px,
      rgba(42, 37, 32, 0.025) 29px
    ),
    var(--cream);
}

/* hand-drawn border utility */
.sketch-border {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow:
    4px 4px 0 var(--ink),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  background: var(--white);
}

.sketch-underline {
  display: inline-block;
  position: relative;
}

.sketch-underline::after {
  content: "";
  position: absolute;
  left: -4%;
  bottom: -6px;
  width: 108%;
  height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'%3E%3Cpath d='M2 5 Q50 1 100 4 T198 5' stroke='%232a2520' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2.5px solid var(--ink);
}

.header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header__logo img {
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--sky);
}

.header__brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header__nav a {
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.header__nav a:hover {
  color: var(--sky-deep);
}

.nav-cta {
  background: var(--sky);
  color: var(--white) !important;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s !important;
}

.nav-cta:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
  color: var(--white) !important;
}

/* ── Social links ── */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.social-links[hidden] {
  display: none;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 40px;
  height: 40px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s, color 0.2s;
}

.social-link[hidden] {
  display: none;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  background: var(--sky);
  color: var(--white);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.social-links--nav {
  margin-left: 0.25rem;
}

@media (max-width: 640px) {
  .social-links--nav {
    margin-left: 0;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px dashed var(--beige);
    justify-content: center;
  }
}

.social-links--hero {
  justify-content: center;
  margin-bottom: 2rem;
}

.social-links--hero .social-link {
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
}

.social-links--hero .social-link svg {
  width: 16px;
  height: 16px;
}

.social-links--footer {
  justify-content: center;
  margin-bottom: 1rem;
}

.header__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__menu-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.header__menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.header__menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header__menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn--primary {
  background: var(--sky);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn--primary:hover {
  background: var(--sky-deep);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--outline {
  background: var(--white);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn--outline:hover {
  background: var(--paper);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--small {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  background: var(--beige);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--small:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* ── Hero ── */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero__banner {
  overflow: hidden;
  transform: rotate(-1.5deg);
}

.hero__banner-img {
  width: 100%;
  object-fit: cover;
}

.hero__content {
  text-align: center;
}

.hero__mascot {
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--sky);
  animation: float 3s ease-in-out infinite;
}

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

.hero__tag {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0.25rem 0 0.75rem;
}

.hero__title span {
  color: var(--sky-deep);
  position: relative;
}

.hero__subtitle {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.stat {
  padding: 1rem 0.5rem;
  text-align: center;
  border-right: 2px dashed var(--beige);
}

.stat:last-child {
  border-right: none;
}

.stat__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ── Sections ── */
.section {
  padding: 4rem 1.25rem;
}

.section__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}

.section__desc {
  text-align: center;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* ── About ── */
.about {
  background: var(--paper);
  border-top: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.about__card {
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: transform 0.2s;
}

.about__card:hover {
  transform: rotate(-1deg) scale(1.02);
}

.about__emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.about__card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.about__card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ── Chart ── */
.chart-wrap {
  overflow: hidden;
  min-height: 500px;
  position: relative;
  padding: 0;
}

.chart-wrap iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: none;
}

.chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 500px;
  color: var(--ink-soft);
  text-align: center;
  padding: 2rem;
}

.chart-placeholder img {
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  opacity: 0.7;
}

.chart-placeholder code {
  background: var(--paper);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ── Gallery ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery__item {
  cursor: pointer;
  overflow: hidden;
  padding: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
  list-style: none;
}

.gallery__item:hover {
  transform: rotate(1deg) translateY(-4px);
  box-shadow: 6px 6px 0 var(--ink);
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: calc(var(--radius) - 6px);
  background: var(--white);
}

.gallery__item figcaption {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

/* ── Buy ── */
.buy-section__inner {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 640px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--white) 0%, var(--paper) 100%);
}

.buy-section__logo {
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--sky);
}

.buy-section__text {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.buy-section__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.contract-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
}

.contract-box__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 700;
}

.contract-box__address {
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--paper);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  max-width: 100%;
}

/* ── Footer ── */
.footer {
  border-top: 2.5px solid var(--ink);
  background: var(--paper);
  padding: 2rem 1.25rem;
  text-align: center;
}

.footer__inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer img {
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.footer p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.footer__copy {
  margin-top: 0.5rem;
  font-size: 0.8rem !important;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(42, 37, 32, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border: 4px solid var(--white);
  border-radius: var(--radius);
  background: var(--white);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: var(--white);
  border: 2.5px solid var(--ink);
  color: var(--ink);
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: var(--sky);
  color: var(--white);
}

.lightbox__close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox__prev {
  left: 1rem;
}

.lightbox__next {
  right: 1rem;
}

.lightbox__counter {
  position: absolute;
  bottom: 1.5rem;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero__banner {
    transform: none;
    max-width: 520px;
    margin: 0 auto;
  }

  .about__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .header__nav {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 2.5px solid var(--ink);
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .header__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header__menu-btn {
    display: flex;
  }

  .hero__stats {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: none;
    border-bottom: 2px dashed var(--beige);
  }

  .stat:last-child {
    border-bottom: none;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .chart-wrap,
  .chart-wrap iframe,
  .chart-placeholder {
    min-height: 400px;
    height: 400px;
  }
}
