:root {
  --font-title: "iSangsang", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "omyu pretty", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

@font-face {
  font-family: "iSangsang";
  src: url("/fonts/iSangsang.ttf?v=20260918") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "omyu pretty";
  src: url("/fonts/omyu-pretty.ttf?v=20260918-2257") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #17324d;
  --muted: #6b8094;
  --sky: #7fcaf4;
  --sky-deep: #4aaee8;
  --mint: #88e1ce;
  --mint-deep: #52cbb3;
  --coral: #ff9f9c;
  --coral-soft: #fff0ef;
  --paper: rgba(255, 255, 255, 0.92);
  --line: #d9eaf2;
  --soft-blue: #edf8ff;
  --soft-mint: #eefcf8;
  --shadow: 0 20px 60px rgba(63, 123, 153, 0.13);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #f6fcff;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 15% 10%, rgba(126, 204, 246, 0.28), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(136, 225, 206, 0.25), transparent 30%),
    linear-gradient(180deg, #f8fdff 0%, #eefaff 48%, #f8fffd 100%);
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(74, 174, 232, 0.22);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.sea-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.bubble {
  position: absolute;
  border-radius: 999px;
  border: 2px solid rgba(110, 196, 236, 0.18);
  background: rgba(255, 255, 255, 0.32);
  animation: float 8s ease-in-out infinite;
}

.bubble-a { width: 110px; height: 110px; top: 18%; left: 5%; }
.bubble-b { width: 64px; height: 64px; top: 62%; right: 9%; animation-delay: -2s; }
.bubble-c { width: 36px; height: 36px; top: 34%; right: 16%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

.topbar {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  cursor: pointer;
}

.brand-symbol {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 17px;
  box-shadow: 0 7px 18px rgba(44, 137, 196, 0.18);
  transition: transform .18s ease, box-shadow .18s ease;
}

.brand:hover .brand-symbol {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(44, 137, 196, 0.2);
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}

.brand-title,
.brand-kids {
  font-family: var(--font-title);
  font-weight: 400;
}

.brand-title {
  color: #159ee9;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.brand-for {
  display: inline-grid;
  place-items: center;
  min-width: 33px;
  height: 27px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(145deg, #22aaf2, #65d7ee);
  color: #fff;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 400;
  transform: rotate(-2deg);
  box-shadow: 0 3px 9px rgba(27, 163, 230, .2);
}

.brand-kids {
  font-size: 24px;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #ff7f96 0 27%, #ffbb3d 30% 51%, #53d6a1 55% 74%, #9774ed 78% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(183, 219, 233, 0.8);
  color: #527187;
  font-size: 13px;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint-deep);
  box-shadow: 0 0 0 4px rgba(82, 203, 179, 0.13);
}

.shell {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 72px;
}

.screen {
  display: none;
  animation: screen-in 0.28s ease both;
}

.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bookmark-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid #d9ebf5;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(10px);
}

.bookmark-banner strong { font-size: 14px; }
.bookmark-banner p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

kbd {
  flex: none;
  border: 1px solid #cfdee7;
  border-bottom-width: 3px;
  border-radius: 10px;
  padding: 6px 10px 5px;
  background: #fff;
  color: #557083;
  font-weight: 800;
  font-size: 12px;
}

.hero {
  text-align: center;
  padding: 58px 20px 34px;
}

.hero-brand {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 42px 20px 34px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  text-align: left;
}

.hero-mascot {
  display: block;
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 42px;
  box-shadow:
    0 18px 44px rgba(64, 158, 210, 0.18),
    0 5px 14px rgba(75, 202, 180, 0.12);
  transform: rotate(-2deg);
}

.hero-copy {
  min-width: 0;
}

.hero-copy .eyebrow {
  margin-bottom: 10px;
}

.hero-copy p {
  margin-left: 0;
  margin-right: 0;
}

.hero-copy p strong {
  color: #3d809f;
  font-weight: 900;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #4399c6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h1,
.card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-family: var(--font-title);
  font-weight: 400;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 400;
}

.hero p,
.lede {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.mode-switch {
  width: min(420px, 100%);
  margin: 0 auto 16px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 999px;
  background: #e9f4f9;
}

.mode-btn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6f8799;
  font-weight: 850;
  cursor: pointer;
  transition: 0.18s ease;
}

.mode-btn.is-active {
  color: #285c77;
  background: #fff;
  box-shadow: 0 4px 14px rgba(61, 105, 128, 0.1);
}

.card {
  position: relative;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(206, 229, 240, 0.9);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.send-card { max-width: 650px; margin: 0 auto; }

.dropzone {
  width: 100%;
  min-height: 230px;
  border: 2px dashed #addbee;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 10%, rgba(137, 225, 207, 0.18), transparent 40%),
    #f8fdff;
  cursor: pointer;
  transition: 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: var(--sky-deep);
  background-color: #f1fbff;
  box-shadow: 0 10px 28px rgba(77, 171, 220, 0.12);
}

.dropzone strong { font-size: 17px; }
.dropzone span:last-child { color: var(--muted); font-size: 13px; }

.drop-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 6px;
  border-radius: 24px 24px 30px 24px;
  background: linear-gradient(145deg, #dff5ff, #dcfbf2);
  color: #4caedb;
  font-size: 34px;
  font-weight: 700;
  transform: rotate(-4deg);
}

.file-chip,
.file-summary,
.transfer-file {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-chip {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--soft-mint);
  border: 1px solid #d4efe8;
}

.file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #429cbc;
  background: #fff;
  box-shadow: 0 5px 15px rgba(79, 134, 155, 0.08);
  font-size: 25px;
  font-weight: 900;
}

.file-meta,
.file-summary > div:last-child,
.transfer-file > div:last-child {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-meta strong,
.file-summary strong,
.transfer-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.file-meta span,
.file-summary span,
.transfer-file span {
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  color: #788e9e;
  font-size: 22px;
  cursor: pointer;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.back-btn {
  min-height: 50px;
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.back-btn:active {
  transform: translateY(1px) scale(0.99);
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  padding: 0 22px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #174057;
  background: linear-gradient(120deg, #8bd5f6, #8ee6cf);
  box-shadow: 0 10px 25px rgba(77, 177, 181, 0.18);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.secondary-btn {
  padding: 0 20px;
  border: 1px solid #cce2ec;
  color: #416b80;
  background: #f9fdff;
}

.ghost-btn {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  background: transparent;
  color: #6e8493;
}

.danger {
  color: #b75f61;
  border-color: #ffd8d6;
  background: #fff7f6;
}

.trust-row {
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #6e8494;
  font-size: 12px;
  font-weight: 750;
}

.trust-row span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}

.feedback {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  line-height: 1.55;
  font-size: 14px;
}

.feedback-coral {
  color: #945354;
  background: var(--coral-soft);
  border: 1px solid #ffd4d1;
}

.wait-card,
.receive-card,
.transfer-card,
.complete-card {
  max-width: 700px;
  margin: 38px auto 0;
}

.wait-card,
.receive-card,
.complete-card { text-align: center; }

.wait-card h1,
.receive-card h1,
.complete-card h1 { font-size: clamp(27px, 5vw, 38px); }

.file-summary {
  width: min(500px, 100%);
  margin: 28px auto 0;
  padding: 13px 16px;
  text-align: left;
  border-radius: var(--radius-lg);
  background: #f4fbfe;
}

.pairing-code {
  margin: 28px 0 18px;
  color: #23526b;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(42px, 11vw, 70px);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-indent: .12em;
}

.copy-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.timer-wrap { margin: 30px 0 18px; }

.timer-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.timer-line strong {
  color: #3c7591;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 14px;
}

.timer-track {
  height: 9px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f1f5;
}

.timer-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--mint));
  transition: width .6s linear;
}

.waiting-state,
.connecting {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--soft-blue);
}

.waiting-state > div:last-child,
.connecting > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.waiting-state strong,
.connecting strong { font-size: 14px; }

.waiting-state span,
.connecting span { color: var(--muted); font-size: 12px; }

.droplet-pulse {
  flex: none;
  width: 28px;
  height: 34px;
  border-radius: 50% 50% 55% 45% / 58% 58% 42% 42%;
  background: linear-gradient(145deg, var(--sky), var(--mint));
  transform: rotate(15deg);
  animation: pulse-drop 1.3s ease-in-out infinite;
}

@keyframes pulse-drop {
  0%, 100% { transform: rotate(15deg) scale(.9); opacity: .65; }
  50% { transform: rotate(15deg) scale(1.08); opacity: 1; box-shadow: 0 0 0 10px rgba(127,202,244,.08); }
}

.wait-card .ghost-btn { margin-top: 12px; }

.back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.receive-card { padding-top: 74px; }
.receive-card .lede { margin-bottom: 28px; }

.code-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.code-boxes {
  width: min(520px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  cursor: text;
}

.code-boxes span {
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
  border: 2px solid #d3e6ee;
  border-radius: 15px;
  color: #275770;
  background: #fbfeff;
  font-family: ui-monospace, Menlo, monospace;
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 900;
  transition: .16s ease;
}

.code-boxes span.is-filled {
  border-color: #8ed3ee;
  background: #f0fbff;
  transform: translateY(-2px);
}

.code-boxes.is-focused span { box-shadow: 0 0 0 4px rgba(74,174,232,.08); }

.input-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.connecting { margin-top: 18px; }
.receive-card .secondary-btn { width: 100%; margin-top: 10px; }

.transfer-card { text-align: left; }

.transfer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.transfer-head h1 { font-size: clamp(26px, 5vw, 38px); }

.connection-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  color: #38826e;
  background: var(--soft-mint);
  font-size: 12px;
  font-weight: 850;
}

.connection-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-deep);
}

.connection-pill.is-error { color: #995d5d; background: var(--coral-soft); }
.connection-pill.is-error i { background: var(--coral); }

.transfer-file {
  margin-top: 30px;
  padding: 14px;
  border-radius: 18px;
  background: #f7fbfd;
}

.progress-number {
  margin-top: 34px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  color: #2b6079;
}

.progress-number strong {
  font-size: clamp(54px, 12vw, 82px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.progress-number span { font-size: 25px; font-weight: 900; }

.progress-track {
  position: relative;
  height: 18px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6f1f5;
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--mint));
  transition: width .18s ease;
}

.progress-track > i {
  position: absolute;
  inset: 0;
  opacity: .35;
  background: repeating-linear-gradient(115deg, transparent 0 14px, rgba(255,255,255,.8) 14px 22px);
  animation: wave-move 1.5s linear infinite;
}

@keyframes wave-move { to { transform: translateX(36px); } }

.metric-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric { padding: 15px 16px; border-radius: 17px; background: #f8fcfe; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 18px; }

.transfer-caption {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.transfer-card .feedback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.transfer-card .feedback .secondary-btn { margin-top: 7px; }
.transfer-card > .ghost-btn { width: 100%; margin-top: 14px; }

.celebrate {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  color: #226f5f;
  background: linear-gradient(145deg, #dff7ff, #d9faee);
  font-size: 37px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(82,203,179,.14);
  transform: rotate(-4deg);
}

.complete-summary { margin-top: 28px; }

.manual-link {
  display: inline-block;
  margin-top: 14px;
  color: #4883a2;
  font-size: 13px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.privacy-note {
  margin-top: 26px;
  padding: 16px;
  border-radius: 17px;
  text-align: left;
  background: #f1faf7;
  color: #55776d;
}

.privacy-note strong,
.privacy-note span { display: block; }
.privacy-note strong { font-size: 13px; }
.privacy-note span { margin-top: 4px; font-size: 12px; line-height: 1.6; }
.complete-card > .secondary-btn { width: 100%; margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(28, 62, 80, 0.92);
  box-shadow: 0 10px 30px rgba(17, 51, 68, .2);
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 680px) {
  .topbar, .shell { width: min(100% - 28px, 860px); }
  .topbar { padding-top: 15px; }
  .brand {
    gap: 7px;
  }
  .brand-symbol {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
  .brand-title {
    font-size: 25px;
  }
  .brand-for {
    min-width: 29px;
    height: 23px;
    padding: 0 6px;
    font-size: 15px;
  }
  .brand-kids {
    font-size: 20px;
  }
  .security-badge {
    max-width: 155px;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 10px;
    line-height: 1.25;
  }
  .shell {
    padding-top: 14px;
    padding-bottom: calc(36px + env(safe-area-inset-bottom));
  }
  .bookmark-banner { align-items: flex-start; }
  .bookmark-banner p { display: none; }
  .hero { padding: 42px 8px 26px; }
  .hero-brand {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 34px;
    text-align: center;
  }
  .hero-mascot {
    width: 132px;
    height: 132px;
    margin: 0 auto;
    border-radius: 32px;
  }
  .hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }
  .hero p { font-size: 14px; }
  .card { padding: 24px 19px; border-radius: 24px; }
  .receive-card { padding-top: 68px; }
  .back-btn { top: 17px; left: 15px; }
  .dropzone { min-height: 205px; }
  .pairing-code {
    font-size: clamp(38px, 14vw, 58px);
    letter-spacing: 0.07em;
    text-indent: .07em;
  }
  .code-boxes { gap: 6px; }
  .code-boxes span { border-radius: 12px; }
  .transfer-head { display: block; }
  .connection-pill { margin-top: 12px; }
  .metric-grid { grid-template-columns: 1fr; }
  .primary-btn, .secondary-btn, .ghost-btn { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
