@font-face {
  font-family: "KoPub Batang";
  src: url("fonts/kopub-batang-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F1F1F1;
  --ink: #1F0D04;
  --muted: #6b6a70;
  --blue: #2640ff;
  --serif: "Times New Roman", Times, serif;
  --sub: "KoPub Batang", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-rim: rgba(255, 255, 255, 0.8);
  --glass-rim-soft: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 24px 50px -22px rgba(20, 24, 60, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- water ---------- */
#water {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---------- mark ---------- */
.stage {
  position: fixed; inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.mark {
  margin: 0;
  pointer-events: auto;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
/* With WebGL the wordmark is painted under the glass; keep this for screen readers. */
body:not(.no-webgl) .mark {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- liquid glass (from the webstore engine) ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(6px) saturate(1.7);
  backdrop-filter: blur(6px) saturate(1.7);
  box-shadow:
    inset 0 1px 1px var(--glass-rim),
    inset 0 -1px 1px var(--glass-rim-soft),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 14px rgba(255, 255, 255, 0.04),
    var(--glass-shadow);
}
.glass::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(133deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.06) 22%, transparent 42%);
}
.glass::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease;
  background: radial-gradient(130px circle at var(--mx, -200px) var(--my, -200px),
    rgba(255,255,255,0.28), rgba(255,255,255,0.06) 40%, transparent 65%);
}
.glass:hover::after { opacity: 1; }
.glass > * { position: relative; z-index: 2; }

/* ---------- contact (invisible hit target over the water-drawn word) ---------- */
.contact {
  position: fixed;
  z-index: 3;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: pointer;
  pointer-events: none;
  border-radius: 12px;
  left: -9999px; top: 0;
}
.contact.live { pointer-events: auto; }
.contact:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

/* Corner contact: tiny, pure white on the near-white page — barely there. */
.corner-contact {
  position: fixed;
  left: 16px; bottom: 14px;
  z-index: 4;
  margin: 0; padding: 4px 2px;
  border: 0; background: none;
  font: 500 11px/1 var(--sans);
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
}
.corner-contact:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

/* No WebGL: the word simply fades in beneath the wordmark. */
.no-webgl .mark { font-family: var(--serif); font-weight: 700; color: var(--ink); transform: scaleX(0.78); }
.no-webgl .mark sup { font-size: 0.09em; font-weight: 400; vertical-align: top; }
.no-webgl .contact {
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  transition: opacity 2s ease;
}
.no-webgl.flooded .contact { opacity: 1; }

/* ---------- modal: plain HTML on a pane of frosted glass ---------- */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(8, 12, 40, 0.22); animation: fade 0.35s ease both; }
.modal-card {
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: transparent;
  --glass-shadow: none;
  width: min(460px, 100%);
  max-height: calc(100svh - 32px);
  overflow: auto;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 24px 24px 20px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  animation: fade 0.25s ease both;
}
.modal-card.glass::before, .modal-card.glass::after { display: none; } /* no sheen */
.modal-card h2 {
  margin: 0 0 6px;
  font-family: var(--sub);
  font-weight: 500;
  font-size: 32px;
  line-height: 1;
}
.modal-email {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.modal-close {
  position: absolute; top: 6px; right: 12px;
  padding: 0; border: 0; background: none;
  font: 30px/1 var(--sans);
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 2px; }
.form span { font-size: 16px; }
.form input, .form textarea {
  width: 100%;
  font: 16px var(--sans);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 0;
  border-radius: 0;
  padding: 5px 7px;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}
.form input:focus, .form textarea:focus { outline: none; background: #fff; }
.send {
  margin-top: 4px;
  justify-self: start;
  font: 16px var(--sans);
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 2px 16px 4px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.send:hover { background: var(--ink); color: #fff; }
.form-note { margin: 0; min-height: 1.2em; font-size: 16px; }

@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .modal-card, .modal-scrim { animation: none; }
}
