/*
 * craftory.css — Shared design system for all Craftory pages
 *
 * Design tokens, base styles, header/footer, and document-page components.
 * Sub-pages (privacy, terms) link this file instead of duplicating inline CSS.
 * To update the site-wide look: edit this file only.
 */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ── Design Tokens ──────────────────────────────── */
:root {
  --cyan:   #38bdf8;
  --teal:   #2dd4bf;

  --bg:          #07101c;
  --bg-card:     rgba(11, 18, 31, .62);
  --border:      rgba(206, 225, 255, .1);
  --border-hover: rgba(113, 203, 247, .18);
  --text:        #edf4ff;
  --text-muted:  rgba(223, 233, 246, .8);
  --text-subtle: rgba(173, 191, 216, .56);
  --header-bg:   rgba(7, 16, 28, .82);
  --btn-bg:      rgba(255, 255, 255, .08);
  --btn-hover:   rgba(255, 255, 255, .14);
  --grad-main:   linear-gradient(135deg, var(--cyan), var(--teal));
}

[data-theme="light"] {
  --bg:          #f9fcff;
  --bg-card:     rgba(255, 255, 255, .96);
  --border:      rgba(109, 173, 225, .18);
  --border-hover: rgba(69, 180, 244, .34);
  --text:        #102246;
  --text-muted:  rgba(35, 58, 92, .82);
  --text-subtle: rgba(84, 107, 142, .72);
  --header-bg:   rgba(252, 254, 255, .92);
  --btn-bg:      rgba(98, 190, 244, .12);
  --btn-hover:   rgba(73, 181, 239, .2);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ───────────────────────────────────────── */
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background .4s, color .4s;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% -2%, rgba(104, 196, 255, .24), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(96, 229, 205, .16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255, 200, 124, .1), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f8fcff 48%, #f2faff 100%);
}

/* ── Header ─────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background .4s, border-color .4s;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.045em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

/* ── Theme Toggle ───────────────────────────────── */
#theme-toggle {
  position: absolute;
  top: 0; bottom: 0; right: 28px;
  margin-block: auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background .3s, border-color .3s;
}

#theme-toggle:hover {
  background: var(--btn-hover);
  border-color: var(--border-hover);
}

#theme-toggle svg {
  position: absolute;
  top: 50%; left: 50%;
  width: 19px; height: 19px;
  pointer-events: none;
  transform-origin: center;
  transition: opacity .22s ease, transform .32s ease;
}

.icon-moon { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
.icon-sun  { opacity: 0; transform: translate(-50%, -50%) scale(.84) rotate(-18deg); }

[data-theme="light"] .icon-moon { opacity: 0; transform: translate(-50%, -50%) scale(.84) rotate(18deg); }
[data-theme="light"] .icon-sun  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }

/* ── Document Page Layout ───────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.doc-wrap {
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ── Document Page Typography ───────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-subtle);
  font-size: 0.9rem;
  margin-bottom: 48px;
}

h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--cyan);
}

p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

ul, ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

li {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

strong { color: var(--text); }

/* ── Content Card ───────────────────────────────── */
.content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  margin-bottom: 60px;
  transition: background .4s, border-color .4s;
}

/* ── Table (used in privacy-drive-iq) ───────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

th {
  color: var(--text);
  background: rgba(56, 189, 248, .07);
  font-weight: 600;
}

/* ── Footer ─────────────────────────────────────── */
.doc-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.doc-footer a {
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color .2s;
}

.doc-footer a:hover { color: var(--cyan); }

[data-theme="light"] .doc-footer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(245, 250, 255, .74)),
    radial-gradient(circle at 18% 0%, rgba(116, 202, 255, .08), transparent 34%);
}

[data-theme="light"] .doc-footer a {
  color: rgba(22, 43, 72, .88);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .content { padding: 24px; }
  h1 { font-size: 1.6rem; }
  table { font-size: 0.82rem; }
  th, td { padding: 8px 10px; }
}
