/* buddhaKun website — one stylesheet for every page. Warm paper, ink, and the moktak's lacquer red. */
:root {
  --paper: #f6f0e4;
  --card: #fffaf0;
  --ink: #2a211b;
  --muted: #6e6056;
  --line: #e4d8c4;
  --lacquer: #8a3a22;
  --lacquer-hover: #74301c;
  --on-lacquer: #fff8ee;
  --gold: #a87a2a;
  --focus: #c0832a;
  --split: rgba(255, 248, 238, 0.32);   /* line between the download button and its menu arrow */
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17120f;
    --card: #211a16;
    --ink: #f2e9dc;
    --muted: #b4a595;
    --line: #3a2f28;
    --lacquer: #c46a43;
    --lacquer-hover: #d77b53;
    --on-lacquer: #1a120d;
    --gold: #d6a75a;
    --split: rgba(26, 18, 13, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--lacquer); text-underline-offset: 3px; }
a:hover { color: var(--lacquer-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }

.wrap { width: min(1040px, 100% - 32px); margin-inline: auto; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand b { font-size: 22px; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-size: 15px; }
.lang { font-size: 14px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }
.lang:hover { color: var(--ink); border-color: var(--muted); }

/* home: the moktak and the download button, nothing else */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  min-height: calc(100svh - 240px);
  padding: 16px 0 48px;
}
.moktak {
  width: min(400px, 76vw);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: url("/assets/mallet-cursor.png") 17 14, pointer;
  transform-origin: 50% 80%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;   /* quick taps knock instead of zooming */
}
.moktak img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.moktak.knock { animation: knock 0.5s linear; }
/* the same press-and-wobble as the app: 7·e^(−6t)·sin(6πt) degrees, press for the first 0.12 s */
@keyframes knock {
  0%    { transform: rotate(0) scale(1); }
  12%   { transform: rotate(-4.2deg) scale(0.94); }
  16.7% { transform: rotate(-4.25deg) scale(0.97); }
  24%   { transform: rotate(-2.4deg) scale(1); }
  33.3% { transform: rotate(0) scale(1); }
  50%   { transform: rotate(1.56deg) scale(1); }
  66.7% { transform: rotate(0) scale(1); }
  83.3% { transform: rotate(-0.57deg) scale(1); }
  100%  { transform: rotate(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .moktak.knock { animation: none; } }

.downloads { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
  min-width: 168px;      /* both buttons the same width */
  padding: 14px 24px;
  border-radius: var(--radius);
  background: var(--lacquer);
  color: var(--on-lacquer);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.dl:hover { background: var(--lacquer-hover); color: var(--on-lacquer); }
.dl .os, .dl-menu .os { width: 18px; height: 18px; flex: none; fill: currentColor; }

/* One button for this computer. The script in the page head sets <html data-platform="windows|macos|mobile">;
   the arrow next to the button opens a menu (site.js) to switch. Without JavaScript both buttons stay. */
[data-platform="windows"] .dl[data-download="macos"],
[data-platform="macos"] .dl[data-download="windows"],
[data-platform="mobile"] .downloads { display: none; }
[data-platform] .downloads { position: relative; flex-direction: row; flex-wrap: nowrap; gap: 0; width: auto; }
[data-platform] .dl { border-radius: var(--radius) 0 0 var(--radius); }
.dl-more { display: none; }
[data-platform] .dl-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--split);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--lacquer);
  color: var(--on-lacquer);
  cursor: pointer;
  transition: background 0.15s;
}
.dl-more:hover { background: var(--lacquer-hover); }
.dl-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.dl-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.dl-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 10;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(42, 33, 27, 0.16);
}
.dl-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.dl-menu button:hover { background: var(--paper); }
.dl-menu button[aria-checked="true"] { font-weight: 600; }
.dl-menu button[aria-checked="true"]::after {   /* check mark */
  content: ""; margin-left: auto;
  width: 6px; height: 11px;
  border: solid var(--lacquer); border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}

h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: 26px; letter-spacing: -0.01em; margin: 0 0 20px; }

/* long text (privacy) */
.doc { max-width: 760px; padding: 24px 0 48px; }
.doc h1 { font-size: clamp(30px, 5vw, 40px); }
.doc h2 { font-size: 21px; margin: 36px 0 12px; }
.doc p, .doc li { color: var(--ink); }
.doc .meta { color: var(--muted); font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { width: 28%; color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .moktak { width: min(300px, 72vw); }
  [data-platform="mobile"] .moktak { width: min(360px, 84vw); }
  .downloads { flex-direction: column; width: min(360px, 100%); }
  .dl { padding-inline: 20px; }
}
