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

:root {
  --ocean-900: #072f4a;
  --ocean-700: #0b4d73;
  --ocean-500: #1281a8;
  --ocean-300: #5fb8d6;
  --ocean-100: #e6f6fb;
  --sand: #fef9f0;
  --ink: #10222c;
  --muted: #5b7180;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(7, 47, 74, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

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

h1, h2, h3 { font-weight: 900; margin: 0 0 12px; color: var(--ocean-900); }
p { margin: 0 0 12px; color: var(--muted); }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid rgba(7, 47, 74, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.logo { font-size: 1.15rem; font-weight: 900; color: var(--ocean-900); }
.nav { display: flex; gap: 24px; }
.nav a { font-weight: 500; color: var(--ocean-700); }
.nav a:hover { color: var(--ocean-500); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: clamp(24px, 7vw, 100px);
  text-align: center;
  color: var(--white);
  perspective: 2000px;
  isolation: isolate;
}
.hero h1 { color: var(--white); font-size: 2.4rem; line-height: 1.35; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; margin-bottom: 28px; }

/* Ocean background */
.ocean-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, #1c6d92 0%, #0b3f5c 45%, #051826 100%);
  overflow: hidden;
}
.light-rays {
  position: absolute;
  inset: -20% -20% -60% -20%;
  background: repeating-conic-gradient(from 0deg at 50% 0%, rgba(255,255,255,0.07) 0deg 6deg, transparent 6deg 22deg);
  mix-blend-mode: screen;
  transform-origin: 50% 0%;
  animation: rotateRays 50s linear infinite;
  opacity: 0.55;
}
@keyframes rotateRays {
  to { transform: rotate(360deg); }
}
.bubbles { position: absolute; inset: 0; }
.bubbles span {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.75), rgba(255,255,255,0.08) 70%);
  animation-name: bubbleRise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes bubbleRise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  12%  { opacity: 0.6; }
  100% { transform: translateY(-640px) translateX(24px); opacity: 0; }
}
.impact-flash {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
#hero-scene.enter-play .impact-flash {
  animation: flashPulse 0.9s ease-out;
  animation-delay: 1.7s;
}
@keyframes flashPulse {
  0%   { opacity: 0; transform: scale(0.4); }
  40%  { opacity: 0.85; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(2.4); }
}

/* Whale shark 3D entrance */
.shark-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  pointer-events: none;
}
.whale-shark {
  width: min(560px, 70vw);
  height: auto;
  opacity: 0;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.45));
}
.whale-shark .body { fill: url(#sharkBody); }
.whale-shark .sheen { fill: url(#sharkSheen); }
.whale-shark .fin { fill: #123a52; }
.whale-shark .spots circle { fill: rgba(255,255,255,0.55); }
.whale-shark .gills path { fill: none; stroke: rgba(6,26,42,0.35); stroke-width: 3; stroke-linecap: round; }
.whale-shark .eye { fill: #061c2c; }
.whale-shark .mouth { fill: none; stroke: rgba(6,26,42,0.5); stroke-width: 3; stroke-linecap: round; }

#hero-scene.enter-play .whale-shark {
  animation: sharkEmerge 3.4s cubic-bezier(.22,.85,.35,1) forwards;
  animation-delay: 0.2s;
}
.whale-shark.idle-swim {
  opacity: 1;
  animation: sharkIdle 6s ease-in-out infinite;
}
@keyframes sharkEmerge {
  0%   { opacity: 0; filter: blur(10px) drop-shadow(0 20px 40px rgba(0,0,0,0.45)); transform: translate3d(6%, 34%, -1100px) scale(.26) rotateY(20deg) rotateZ(34deg); }
  10%  { opacity: 1; }
  46%  { opacity: 1; filter: blur(0) drop-shadow(0 20px 40px rgba(0,0,0,0.45)); transform: translate3d(14%, 4%, -40px) scale(1.05) rotateY(-6deg) rotateZ(22deg); }
  58%  { transform: translate3d(18%, -2%, 10px) scale(1.16) rotateY(3deg) rotateZ(17deg); }
  72%  { transform: translate3d(20%, -6%, -60px) scale(0.98) rotateY(-3deg) rotateZ(21deg); }
  100% { opacity: 1; transform: translate3d(22%, -9%, -260px) scale(0.84) rotateY(-8deg) rotateZ(24deg); }
}
@keyframes sharkIdle {
  0%, 100% { transform: translate3d(22%, -9%, -260px) scale(0.84) rotateY(-8deg) rotateZ(24deg); }
  50%      { transform: translate3d(19%, -12%, -280px) scale(0.82) rotateY(-6deg) rotateZ(21deg); }
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 440px;
  text-align: left;
  padding: 36px 32px;
  background: rgba(6, 26, 42, 0.35);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
}
.hero-content .btn { display: block; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .light-rays, .bubbles span, .impact-flash,
  #hero-scene.enter-play .whale-shark, .whale-shark.idle-swim {
    animation: none !important;
  }
  .whale-shark {
    opacity: 1;
    filter: none;
    transform: translate3d(22%, -9%, -260px) scale(0.84) rotateY(-8deg) rotateZ(24deg);
  }
}

.page-hero {
  background: var(--ocean-100);
  padding: 56px 0;
  text-align: center;
}
.page-hero h1 { margin-bottom: 8px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary {
  background: var(--white);
  color: var(--ocean-700);
}
.btn-primary:hover { background: var(--ocean-100); }
.hero .btn-primary { background: var(--white); color: var(--ocean-700); }
.form-section .btn-primary,
.tours-cta .btn-primary {
  background: var(--ocean-500);
  color: var(--white);
}
.form-section .btn-primary:hover,
.tours-cta .btn-primary:hover { background: var(--ocean-700); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tours */
.tours { padding: 72px 0; text-align: center; }
.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin: 32px 0;
  text-align: left;
}
.tour-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.tour-emoji { font-size: 2.4rem; margin-bottom: 12px; }
.tour-price { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--ocean-500); }
.tours-cta { margin-top: 12px; }

/* Info */
.info { padding: 40px 0 72px; }
.info-list { color: var(--muted); padding-left: 20px; }
.info-list li { margin-bottom: 8px; }

/* Form */
.form-section { padding: 48px 0 96px; }
.reservation-form {
  max-width: 560px;
  margin: 0 auto;
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 700; font-size: 0.9rem; color: var(--ocean-900); }
.form-row input,
.form-row select,
.form-row textarea {
  padding: 12px 14px;
  border: 1px solid #d8e3e9;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--sand);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--ocean-500);
}
.form-status {
  margin-top: 14px;
  text-align: center;
  font-weight: 500;
  min-height: 1.2em;
}
.form-status.success { color: #1a7f4e; }
.form-status.error { color: #c0392b; }

/* Admin */
.admin-section { padding: 32px 0 80px; overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.admin-table th, .admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f4;
  text-align: left;
  white-space: nowrap;
}
.admin-table th { background: var(--ocean-100); color: var(--ocean-900); }
.admin-table td.loading { text-align: center; color: var(--muted); }
.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-pending { background: #fdf3d3; color: #8a6d00; }
.status-confirmed { background: #d7f2e3; color: #1a7f4e; }
.status-cancelled { background: #fbdcd7; color: #c0392b; }
.admin-table select { padding: 4px 8px; border-radius: 6px; border: 1px solid #d8e3e9; }
.admin-table button {
  border: none;
  background: none;
  color: #c0392b;
  cursor: pointer;
  font-weight: 700;
}

/* Footer */
.site-footer {
  background: var(--ocean-900);
  color: rgba(255,255,255,0.7);
  padding: 28px 0;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .hero { padding: 64px 0; }
  .hero h1 { font-size: 1.8rem; }
  .header-inner { flex-direction: column; gap: 10px; }
  .nav { gap: 16px; }
}
