/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none !important;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

:root {
  --font: 'Gowun Dodum', sans-serif;
  --script: 'Dancing Script', cursive;
  --text: #1a1a1a;
  --muted: #555;
  --border: #e4e4e4;
  --max-w: 1180px;
  --px: clamp(20px, 5vw, 60px);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* Shared max-width wrapper */
.wrap {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--px);
  padding-right: var(--px);
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.nav-icon {
  height: 37.8px;
  width: auto;
  overflow: visible;
}

.nav-brand {
  font-family: var(--script);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  transition: opacity 0.15s;
}

.nav-links a:hover { opacity: 0.5; }

/* ── HERO ── */
.hero { overflow: visible; }

.hero-inner { padding-top: 52px; position: relative; }

.hero-text { margin-top: 80px; }

.hero-cloud {
  position: absolute;
  width: clamp(153px, 20vw, 289px);
  height: auto;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}

.hero-cloud--left  { left: calc(50% - clamp(220px, 30vw, 390px)); }
.hero-cloud--right { right: calc(50% - clamp(220px, 30vw, 390px)); transform: scaleX(-1); }

.hero-name {
  font-family: var(--script);
  font-size: clamp(48px, 5vw, 64px);
  font-weight: 600;
  line-height: 0.95;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  max-width: max-content;
  border-right: 3.5px solid transparent;
  animation:
    hero-width  8.7s linear infinite,
    hero-cursor 8.7s linear infinite;
}

/* Cycle: type 1.6s → hold 5s → delete 1.6s → pause 0.5s = 8.7s total */
@keyframes hero-width {
  0%      { width: 0;                  padding-right: 0;   animation-timing-function: steps(16, end) }
  18.39%  { width: calc(7.4em + 7px); padding-right: 7px; animation-timing-function: step-end }
  75.86%  { width: calc(7.4em + 7px); padding-right: 7px; animation-timing-function: steps(16, end) }
  94.25%  { width: 0;                  padding-right: 0;   animation-timing-function: step-end }
  100%    { width: 0;                  padding-right: 0 }
}

/* Blink half-period: 0.5s / 8.7s = 5.75% — blinks during type+hold+delete, hidden during 0.5s pause */
@keyframes hero-cursor {
  /* typing 0%–18.39% */
  0%     { border-color: #99CFBC;    animation-timing-function: step-end }
  5.75%  { border-color: transparent; animation-timing-function: step-end }
  11.49% { border-color: #99CFBC;    animation-timing-function: step-end }
  17.24% { border-color: transparent; animation-timing-function: step-end }
  18.39% { border-color: #99CFBC;    animation-timing-function: step-end }
  /* hold 18.39%–75.86% */
  24.14% { border-color: transparent; animation-timing-function: step-end }
  29.89% { border-color: #99CFBC;    animation-timing-function: step-end }
  35.63% { border-color: transparent; animation-timing-function: step-end }
  41.38% { border-color: #99CFBC;    animation-timing-function: step-end }
  47.13% { border-color: transparent; animation-timing-function: step-end }
  52.87% { border-color: #99CFBC;    animation-timing-function: step-end }
  58.62% { border-color: transparent; animation-timing-function: step-end }
  64.37% { border-color: #99CFBC;    animation-timing-function: step-end }
  70.11% { border-color: transparent; animation-timing-function: step-end }
  75.86% { border-color: #99CFBC;    animation-timing-function: step-end }
  /* delete 75.86%–94.25% */
  81.61% { border-color: transparent; animation-timing-function: step-end }
  87.36% { border-color: #99CFBC;    animation-timing-function: step-end }
  93.10% { border-color: transparent; animation-timing-function: step-end }
  /* pause 94.25%–100%: hidden */
  94.25% { border-color: transparent }
  100%   { border-color: transparent }
}

.hero-tagline {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 6px;
  white-space: nowrap;
}

.tagline-accent {
  color: #78B19D;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: 32px;
  overflow: visible;
}

/* ── Layered globe illustration ── */
.hero-globe-wrap {
  position: relative;
  width: clamp(520px, 62vw, 760px);
  height: clamp(320px, 38vw, 460px);
  overflow: visible;
}

/* clips only the globe layers, not the clouds */
.hero-globe-core {
  position: absolute;
  inset: 0;
  overflow: visible;
  clip-path: inset(-9999px 0 50% 0);
  transform: translateY(200px);
  animation: globe-rise-in 1s ease-out both;
}

.hero-glow {
  position: absolute;
  top: calc(25% + 25px);
  left: 50%;
  width: 131%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.hero-globe {
  position: absolute;
  left: 50%;
  bottom: -30%;
  width: 78%;
  height: auto;
  transform: translateX(-50%);
  z-index: 3;
}

.hero-orbit {
  position: absolute;
  left: 50%;
  bottom: -28%;
  width: 95%;
  height: auto;
  transform: translateX(-50%) rotate(3deg) scale(1);
  transform-origin: center center;
  z-index: 1;
}

.hero-cloud {
  position: absolute;
  width: clamp(135px, 16vw, 207px);
  height: auto;
  z-index: 4;
  pointer-events: none;
}

.hero-npc {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 265px);
  width: 3.57%;
  height: auto;
  transform: translateX(-50%);
  z-index: 4;
  opacity: 0;
}

.hero-npc--1  { opacity: 1; }
.hero-npc--6  { width: 4.4625%; }
.hero-npc--10 { width: 9.375%; bottom: calc(50% + 250px); }
.hero-npc--11 { width: 9.375%; bottom: calc(50% + 250px); }

.hero-cloud--left  { left: -18%; top: 3%; animation: cloud-left-in 1.1s ease-out 0.05s both, cloud-float-left 30s ease-in-out 1.15s infinite; }
.hero-cloud--right { right: calc(-20% - 20px); top: 28%; animation: cloud-right-in 1.1s ease-out 0.05s both, cloud-float-right 30s ease-in-out 1.15s infinite; }

@keyframes globe-rise-in {
  from { opacity: 0; transform: translateY(290px); }
  to   { opacity: 1; transform: translateY(200px); }
}

@keyframes cloud-left-in {
  from { opacity: 0; transform: translateX(-50vw); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes cloud-right-in {
  from { opacity: 0; transform: scaleX(-1) translateX(-50vw); }
  to   { opacity: 1; transform: scaleX(-1) translateX(0); }
}

@keyframes cloud-float-left {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(100px); }
  100% { transform: translateX(0); }
}

@keyframes cloud-float-right {
  0%   { transform: scaleX(-1) translateX(0); }
  50%  { transform: scaleX(-1) translateX(50px); }
  100% { transform: scaleX(-1) translateX(0); }
}

@keyframes pg-cloud-float {
  0%   { transform: translateX(-500px); }
  50%  { transform: translateX(0); }
  100% { transform: translateX(-500px); }
}

/* ── Layered hero tulip ── */
.hero-tulip-wrap {
  position: relative;
  width: clamp(180px, 22vw, 285px);
  height: clamp(285px, 36vw, 445px);
  flex-shrink: 0;
  z-index: 1;
  margin-left: clamp(-41px, calc(-6vw + 33px), -14px);
  margin-bottom: 2px;
}

.hero-tulip-leaves {
  position: absolute;
  bottom: 0;
  left: calc(50% - 25px);
  width: 48%;
  height: auto;
  transform: translateX(-50%);
  z-index: 4;
}

/* big flower: rests at -4deg, swings to -11deg (-4 + -7) */
.hero-tulip-big {
  position: absolute;
  top: calc(6% + 15px);
  left: calc(47% + 17px);
  width: 32%;
  height: auto;
  transform-origin: bottom center;
  z-index: 3;
  animation: tulip-sway-big 6s ease-in-out infinite;
}

/* small bud: rests at 3deg, swings to -2deg (3 + -5) */
.hero-tulip-small {
  position: absolute;
  top: calc(30% + 25px);
  left: calc(66% - 73px);
  width: 29%;
  height: auto;
  transform-origin: bottom center;
  z-index: 3;
  animation: tulip-sway-small 6s ease-in-out infinite;
}

/* translateX(-50%) keeps big flower centred on its left anchor through the rotation */
@keyframes tulip-sway-big {
  0%   { transform: translateX(-50%) rotate(-4deg)  }
  50%  { transform: translateX(-50%) rotate(-9deg) }
  100% { transform: translateX(-50%) rotate(-4deg)  }
}

@keyframes tulip-sway-small {
  0%   { transform: rotate(3deg)  }
  50%  { transform: rotate(-2deg) }
  100% { transform: rotate(3deg)  }
}

.hero-house {
  height: clamp(190px, 25vw, 300px);
  width: auto;
  flex-shrink: 0;
  margin-bottom: 12px;
}

/* ── Playground illustration ── */

.pg-plants {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  flex: 1;
  margin-bottom: 20px;
  padding-left: 128px;
}

.pg-tulip-space {
  position: relative;
  width: 180px;
  height: 100%;
  flex-shrink: 0;
}

.pg-tulip-wrap {
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(230px, 29vw, 360px);
  height: 100%;
  transform: scale(0.5);
  transform-origin: bottom left;
}

.pg-tulip-leaves {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 55.8%;
  height: auto;
  z-index: 1;
  transform: translateX(-50%);
}

.pg-tulip-big {
  position: absolute;
  left: calc(47% + 80px);
  bottom: calc(20% + 80px);
  width: 39.1%;
  height: auto;
  z-index: 3;
  transform-origin: 50% 100%;
  animation: big-tulip-sway 3.4s ease-in-out infinite alternate;
}

.pg-tulip-small {
  position: absolute;
  left: 66%;
  bottom: calc(12% + 160px);
  width: 38.64%;
  height: auto;
  z-index: 2;
  transform-origin: 50% 100%;
  animation: small-tulip-sway 2.8s ease-in-out infinite alternate;
  animation-delay: -1.2s;
}

.pg-house-space {
  flex-shrink: 0;
  transform: scale(1.547);
  transform-origin: bottom left;
  position: relative;
  z-index: 1;
}

.pg-npcs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  position: absolute;
  right: 556px;
  bottom: 20px;
  z-index: 2;
  transform: scaleX(-1);
  transition: transform 1.68s ease-in-out;
}

.pg-npcs.walking {
  transform: scaleX(-1) translateX(180px);
}

.pg-npc {
  height: auto;
}

.pg-npc--1  { width: 14px; margin-right: 40px; }
.pg-npc--10 { width: 26px; }
.pg-npc--11 { width: 26px; }

/* hop in place while .pg-npcs slides left, staggered so they don't bounce in unison */
.pg-npcs.walking .pg-npc--10 { animation: pg-npc-hop 1.68s ease-in-out; }
.pg-npcs.walking .pg-npc--11 { animation: pg-npc-hop 1.68s ease-in-out 0.084s; }
.pg-npcs.walking .pg-npc--1  { animation: pg-npc-hop 1.68s ease-in-out 0.168s; }

@keyframes pg-npc-hop {
  0%, 100%                    { transform: translateY(0); }
  12.5%, 37.5%, 62.5%, 87.5%  { transform: translateY(-7px); }
  25%, 50%, 75%                { transform: translateY(0); }
}

.pg-house {
  position: relative;
  width: clamp(105px, 13.5vw, 170px);
  height: auto;
  display: block;
  z-index: 2;
}

@keyframes big-tulip-sway {
  0%   { transform: translateX(-50%) rotate(-5deg); }
  100% { transform: translateX(-50%) rotate(5deg); }
}

@keyframes small-tulip-sway {
  0%   { transform: translateX(-50%) rotate(6deg); }
  100% { transform: translateX(-50%) rotate(-6deg); }
}

/* ── WORK ── */
.work { padding: 52px 0 0; }

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 0 64px;
}

.card {
  display: block;
  background: var(--card-bg, #f0f0f0);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}


/* ── Cursor ── */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  user-select: none;
  z-index: 9999;
  width: 20.61px;
  height: 20.61px;
  background: #78B19D;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.35s ease, height 0.35s ease, transform 0.35s ease;
}

.cursor-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.custom-cursor.is-card {
  width: 132px;
  height: 32px;
  transform: translate(0, -50%);
}

.custom-cursor.is-card .cursor-label {
  opacity: 1;
  transform: translateX(0);
}


.card-media {
  height: 296px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: 24px 28px 0;
  overflow: hidden;
}

.card-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-body {
  padding: 18px 22px 26px;
}

.card-body h2 {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tags span {
  display: inline-block;
  padding: 3px 13px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.card-body p {
  font-size: 12px;
  line-height: 1.55;
  color: #3a3a3a;
}

/* ── PLAYGROUND ── */
.pg-section { padding: 52px 64px 0; }

.pg-box {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background: linear-gradient(to bottom, #DEF0FF 70%, #BCE4DD 100%);
  overflow: hidden;
  height: 340px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.pg-fence {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  height: 38.4px;
  background-image: url('assets/fence.png');
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: auto 38.4px;
  z-index: 0;
  pointer-events: none;
}

.pg-cloud {
  position: absolute;
  width: clamp(70px, 9vw, 120px);
  height: auto;
  top: 58px;
  z-index: 1;
  opacity: 0.7;
  animation: pg-cloud-float 120s ease-in-out infinite;
  pointer-events: none;
}

.pg-cloud--1 { right: 48px; }
.pg-cloud--2 { top: 108px; right: 168px; width: clamp(54px, 7vw, 92px); }

.pg-plants {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  /* negative margin pulls plants left so they sit flush */
  margin-left: -10px;
}

.pg-plants img {
  flex-shrink: 0;
  /* space the tulips slightly apart */
  margin-right: -12px;
}

.pg-label {
  position: absolute;
  top: 28px;
  left: 52px;
  text-align: left;
  flex-shrink: 0;
}

.pg-title {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
}

.pg-sub {
  font-size: 16px;
  color: #4a5a5c;
  margin-top: 4px;
}

/* ── PLAYGROUND PAGE ── */
.pgpage-hero { padding: 80px 64px 60px; }

.pgpage-title {
  font-family: var(--script);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 600;
  color: var(--text);
}

.pgpage-tagline {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 10px;
  max-width: 520px;
}

.pgpage-empty {
  padding: 0 64px 140px;
  font-size: 14px;
  color: var(--muted);
}

/* ── FOOTER ── */
.footer { padding-bottom: 40px; }

.footer-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 30px;
}

.footer-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 16px;
  color: var(--muted);
}

.footer-flowers {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 32px;
  width: auto;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 16px;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    justify-content: flex-start;
    margin-left: calc(-1 * var(--px));
  }

  .pg-label {
    padding-right: 24px;
  }

  .footer-inner {
    flex-wrap: wrap;
    gap: 32px;
  }

  .footer-brand {
    margin-left: 0;
    width: 100%;
  }

  .nav-links { gap: 20px; }
}
