@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@400;500;700;800&display=swap');

:root {
  --ink-950: #041427;
  --ink-900: #08203a;
  --ink-700: #224564;
  --ink-500: #3d6386;

  --sea-700: #0f6d7b;
  --sea-500: #18a8b9;
  --sea-300: #82dbe5;

  --sun-500: #ffb23f;
  --sun-300: #ffd794;

  --bg-0: #eef7fb;
  --bg-1: #e2f0f8;
  --surface-0: #ffffff;
  --surface-1: #f7fbfe;
  --line-0: #d7e8f4;
  --line-1: #b8d5e8;

  --text-main: #092239;
  --text-sub: #4b647d;
  --text-soft: #6f869d;
  --danger: #c64141;
  --success: #0f8f63;

  --shadow-sm: 0 10px 26px rgba(10, 36, 62, 0.08);
  --shadow-md: 0 18px 42px rgba(10, 36, 62, 0.12);

  /* Backward-compatible aliases for existing page styles */
  --brand-900: var(--ink-950);
  --brand-700: var(--ink-700);
  --brand-500: var(--sea-700);
  --brand-300: var(--sea-300);
  --accent-mint: var(--sea-500);
  --accent-sand: var(--sun-500);
  --shadow-soft: var(--shadow-sm);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.5;
  color: var(--text-main);
  background:
    radial-gradient(980px 420px at 95% -18%, rgba(24, 168, 185, 0.22), transparent 70%),
    radial-gradient(880px 460px at -10% -12%, rgba(255, 178, 63, 0.18), transparent 72%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 48%, #f8fcff 100%);
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(rgba(14, 82, 110, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 82, 110, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 88%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(24, 168, 185, 0.35);
  outline-offset: 2px;
}

.app-shell {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 2px;
  font-family: 'Sora', 'Noto Sans KR', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink-700);
  text-decoration: none;
}

.app-brand::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 6px;
  background: center / contain no-repeat url('/assets/brand/seacast-logo-mark.png');
  flex: 0 0 22px;
}

.app-top-links {
  display: grid;
  gap: 6px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line-0);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  z-index: 1100;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.2s ease, visibility 0.2s step-end;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line-1);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-700);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.app-chip:hover {
  transform: translateY(-1px);
  border-color: #8ec4e1;
  background: #fff;
}

.app-menu {
  position: relative;
}

.app-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink-700);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.app-menu.open .app-top-links {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.2s ease, visibility 0s step-start;
}

.app-menu.open .app-menu-btn {
  transform: rotate(90deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.panel {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.95));
  border: 1px solid var(--line-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
  animation: rise-in 0.45s ease both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sea-700), #167ea0);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(22, 126, 160, 0.24);
  filter: saturate(1.05);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  border: 1px solid var(--line-1);
  border-radius: 14px;
  background: #fff;
  color: var(--ink-700);
  font-weight: 700;
  cursor: pointer;
}

.sc-toast {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2000;
  min-width: 220px;
  max-width: calc(100vw - 24px);
  background: rgba(4, 20, 39, 0.94);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.sc-toast.error {
  background: rgba(172, 42, 42, 0.95);
}

.sc-toast.success {
  background: rgba(12, 138, 92, 0.95);
}

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

@media (prefers-reduced-motion: reduce) {
  .panel,
  .btn-primary,
  .app-chip {
    animation: none;
    transition: none;
  }
}
