/* ============ GIANTCAT — watercolor scroll site ============ */

:root {
  --paper: #ececea;
  --paper-deep: #e3e4e1;
  --ink: #26241f;
  --ink-soft: #55524a;
  --font-kr: "Gowun Batang", serif;
  --font-en: "Cormorant Garamond", "Gowun Batang", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-kr);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { font-family: var(--font-en); }

/* ---------- scroll length ---------- */
.scroll-space { height: 650vh; }

/* ---------- stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120vw 90vh at 62% 42%, #f6f6f4 0%, var(--paper) 55%, var(--paper-deep) 100%);
  z-index: 1;
}

.layer {
  position: absolute;
  left: 50%;
  top: 50%;
  mix-blend-mode: multiply;
  will-change: transform, opacity, filter;
  pointer-events: none;
}

.layer img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- essay ---------- */
.essay {
  position: fixed;
  top: 0;
  left: clamp(24px, 9vw, 180px);
  width: min(38vw, 560px);
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.essay-col { position: absolute; left: 0; width: 100%; will-change: transform; }

.essay .line {
  font-size: clamp(19px, 1.5vw + 1.3vh, 33px);
  line-height: 1.62;
  letter-spacing: 0.005em;
  color: var(--ink);
  will-change: filter, opacity;
  white-space: nowrap;
}

/* the essay is always English — keep its type regardless of html[lang] */
.essay .line { font-family: var(--font-en); font-weight: 500; }

.essay .line.gap    { margin-top: 1.35em; }
.essay .line.biggap { margin-top: 3.4em; }

/* ---------- top chrome ---------- */
.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(24px, 3.4vw, 56px);
  z-index: 6;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.chrome.hidden { opacity: 0; transform: translateY(-14px); pointer-events: none; }

.chrome-left { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); }
.chrome-right { display: flex; align-items: center; }

.chrome-right .lang-wrap { padding-right: clamp(12px, 1.4vw, 22px); border-right: 1px solid rgba(38, 36, 31, 0.22); }
.chrome-right .signin { margin: 0 clamp(12px, 1.4vw, 22px); }
.chrome-right .avatar { margin-left: clamp(4px, 0.6vw, 10px); }

.wordmark {
  font-family: var(--font-kr);
  font-size: 21px;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
}

/* nav items separated by thin vertical rules, like the reference header */
.topnav { display: flex; align-items: stretch; }

.nav-link {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.03em;
  padding: 4px clamp(14px, 1.6vw, 24px);
  border-left: 1px solid rgba(38, 36, 31, 0.22);
  transition: color 0.25s ease;
  white-space: nowrap;
  line-height: 1.35;
}

.nav-link:last-child { border-right: 1px solid rgba(38, 36, 31, 0.22); }
.nav-link:hover { color: var(--ink); }

.lang-wrap { position: relative; }

.lang-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.25s ease;
}

.lang-label:hover { color: var(--ink); }
.lang-label svg { transition: transform 0.25s ease; }
.lang-wrap.open .lang-label svg { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 130px;
  background: #fbfbfa;
  border: 1px solid rgba(38, 36, 31, 0.12);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(38, 36, 31, 0.12);
  padding: 6px;
  z-index: 7;
}

.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.lang-menu button:hover { background: rgba(38, 36, 31, 0.06); }

.signin {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.signin:hover { color: var(--ink); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(38, 36, 31, 0.1);
  color: rgba(38, 36, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  padding: 10px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9;
}

.toast.show { opacity: 0.96; transform: translate(-50%, 0); }

/* ---------- scroll hint ---------- */
.hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
  transition: opacity 0.8s ease;
  animation: hint-drift 2.6s ease-in-out infinite;
  pointer-events: none;
}

.hint.hidden { opacity: 0; animation-play-state: paused; }

@keyframes hint-drift {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}

/* ---------- sound toggle ---------- */
.sound {
  position: fixed;
  right: clamp(20px, 3vw, 48px);
  bottom: 26px;
  z-index: 5;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  opacity: 0.65;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.sound:hover { opacity: 1; }
.sound.on { color: var(--ink); opacity: 0.95; }

.sound .wave { transition: all 0.3s ease; }

.sound.on .wave { animation: wave-pulse 2.4s ease-in-out infinite; }

@keyframes wave-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ---------- bottom section: business / contact / footer ---------- */
.biz {
  position: relative;
  z-index: 4;
  background: var(--paper);
}

.biz::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(236, 236, 234, 0), var(--paper));
  pointer-events: none;
}

.biz-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 11vh clamp(24px, 5vw, 64px) 0;
}

.biz-title {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 46px;
  color: var(--ink);
}

/* the two project cards double as case studies */
.apps {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 3vw, 36px);
  margin-bottom: 12vh;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid rgba(38, 36, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
  scroll-margin-top: 24px;
}

.app-icon {
  width: 92px;
  height: 92px;
  border-radius: 22%;
  box-shadow: 0 8px 22px rgba(38, 36, 31, 0.14);
}

.app-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.case-tag { font-size: 15px; line-height: 1.6; color: var(--ink); }
.case-body { font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.case-meta { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); opacity: 0.85; }

.case-fig { margin: 2px 0 0; max-width: 320px; }

.case-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(38, 36, 31, 0.12);
}

.case-fig figcaption { font-size: 12px; color: var(--ink-soft); margin-top: 8px; }

.app-card .badges { margin-top: auto; padding-top: 6px; }

.badges { display: flex; flex-wrap: wrap; gap: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #14130f;
  color: #f4f3ef;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 7px 15px 7px 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.badge:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(38, 36, 31, 0.18); }

.badge-logo { width: 21px; height: 21px; flex: none; }

.badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.badge-text small { font-size: 9px; letter-spacing: 0.04em; opacity: 0.85; }
.badge-text strong { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }

.badge-light {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(38, 36, 31, 0.35);
  padding: 11px 22px;
}

.badge-light:hover { background: var(--ink); color: var(--paper); }

.faq-block { margin-bottom: 12vh; scroll-margin-top: 24px; }

.faq-block .biz-title { margin-bottom: 14px; }

.faq-lead {
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* ---------- caps ---------- */
.caps { margin: 0 0 12vh; scroll-margin-top: 24px; }

.caps .biz-title { margin-bottom: 16px; }

.caps-lead {
  max-width: 62ch;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 44px;
}

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 24px;
  padding: 24px 0;
  margin-bottom: 56px;
  border-top: 1px solid rgba(38, 36, 31, 0.12);
  border-bottom: 1px solid rgba(38, 36, 31, 0.12);
}

.stat-n {
  display: block;
  font-family: var(--font-en);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
}

.stat-l {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 8px;
}

.cap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  /* cards keep their own height - a short card next to a tall one would
     otherwise stretch and leave dead space under its last bullet */
  align-items: start;
}

.cap {
  padding: 22px;
  border: 1px solid rgba(38, 36, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.cap h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--ink);
}

.cap-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.cap ul { list-style: none; }

.cap li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

.cap li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--ink-soft);
}

/* the lead card runs the full grid width and sets its bullets beside a figure */
.cap-wide { grid-column: 1 / -1; }

.cap-body { display: grid; gap: 20px; }

.cap-fig { margin: 0; }

.cap-fig img {
  display: block;
  width: 207px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(38, 36, 31, 0.12);
  background: rgba(255, 255, 255, 0.6);
}

.cap-fig figcaption {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 207px;
}

.cap li + li { margin-top: 6px; }

.caps-sub {
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 700;
  margin: 9vh 0 22px;
  color: var(--ink);
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.step { display: flex; align-items: flex-start; gap: 14px; }

.step-n {
  flex: none;
  min-width: 30px;
  font-family: var(--font-en);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-soft);
}

.step b {
  display: block;
  font-size: 15.5px;
  margin-bottom: 6px;
  color: var(--ink);
}

.step p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* collapsible rows: deliverables and FAQ, no JS */
.fold { border-top: 1px solid rgba(38, 36, 31, 0.12); }
.fold-last, .faq .fold:last-child { border-bottom: 1px solid rgba(38, 36, 31, 0.12); }
.steps + .fold { margin-top: 32px; }

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-en);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
}

.fold[open] summary::after { content: "–"; }

.deliver {
  list-style: none;
  columns: 2;
  column-gap: 32px;
  padding: 0 0 18px;
}

.deliver li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  break-inside: avoid;
}

.deliver li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ink-soft);
}

.offer {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offer li {
  border: 1px solid rgba(38, 36, 31, 0.35);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.stack {
  margin-top: 26px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.stack-row { display: flex; gap: 14px; }
.stack-row + .stack-row { margin-top: 4px; }

.stack-k {
  flex: none;
  min-width: 68px;
  font-weight: 700;
  color: var(--ink);
}

.faq .fold p {
  max-width: 70ch;
  padding: 0 0 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .apps { grid-template-columns: 1fr 1fr; }
  .cap-grid { grid-template-columns: 1fr 1fr; }
  .cap-wide .cap-body { grid-template-columns: 1fr 207px; gap: 26px; }
}

@media (min-width: 1024px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  /* only this wide is the text column broad enough to split in two */
  .cap-wide .cap-body { gap: 30px; }
  .cap-wide .cap-body ul { columns: 2; column-gap: 32px; }
  .cap-wide .cap-body li { break-inside: avoid; }
  .cap-wide .cap-body li + li { margin-top: 10px; }
}

@media (max-width: 640px) {
  .deliver { columns: 1; }
  .stack-row { flex-direction: column; gap: 2px; }
  .stack-row + .stack-row { margin-top: 10px; }
}

/* ---------- footer ---------- */
.site-footer {
  padding: 26px 0 34px;
  border-top: 1px solid rgba(38, 36, 31, 0.1);
  text-align: center;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.site-footer a { color: var(--ink-soft); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .essay {
    left: 24px;
    width: calc(100vw - 48px);
  }
  .essay .line { font-size: clamp(17px, 4.6vw, 24px); white-space: normal; }
  .wordmark { font-size: 16px; }
  .topnav { display: none; }
  .signin { display: none; }
  .site-footer { font-size: 11px; }
  .apps { gap: 34px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hint { animation: none; }
  .badge { transition: none; }
  .badge:hover { transform: none; }
}
