/* ==========================================================================
   sendwich·giveaway — design system
   warm editorial light theme · Pretendard
   ========================================================================== */

:root {
  --paper: #f5f2ec;
  --paper-2: #efeae1;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1b1a17;
  --ink-2: #3d3a34;
  --muted: #7a756b;
  --faint: #a8a29a;
  --line: #e6e0d6;
  --line-2: #d9d2c6;

  --brand: #ff5533;
  --brand-2: #ff7a4d;
  --brand-ink: #ffffff;
  --brand-soft: #fff0eb;
  --teal: #0d7a6a;
  --teal-soft: #e6f4f1;
  --amber: #b7791f;
  --amber-soft: #fdf3e3;
  --danger: #d92d20;
  --danger-soft: #fdeceb;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(27, 26, 23, 0.05);
  --shadow-sm: 0 2px 8px rgba(27, 26, 23, 0.06), 0 1px 2px rgba(27, 26, 23, 0.04);
  --shadow: 0 8px 30px rgba(27, 26, 23, 0.08), 0 2px 8px rgba(27, 26, 23, 0.04);
  --shadow-lg: 0 24px 60px rgba(27, 26, 23, 0.14), 0 6px 16px rgba(27, 26, 23, 0.06);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 85, 51, 0.07), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(13, 122, 106, 0.06), transparent 55%);
  background-attachment: fixed;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { letter-spacing: -0.035em; line-height: 1.25; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 620px; }
.container.wide { max-width: 1240px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 242, 236, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -0.04em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 15px; box-shadow: var(--shadow-xs);
}
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-header nav a {
  color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: var(--r-pill);
  transition: background 0.15s ease, color 0.15s ease;
}
.site-header nav a:hover { background: var(--paper-2); text-decoration: none; }
.site-header .who { color: var(--muted); font-size: 13px; font-weight: 500; padding: 0 6px; }

/* ---------- typography helpers ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.lead { color: var(--ink-2); font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }

/* ---------- layout ---------- */
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.hidden { display: none !important; }

/* ---------- card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card.flat { box-shadow: none; }
.card.pad-lg { padding: 30px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 15px; font-weight: 700; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--btn-bg); color: #fff; font: inherit; font-weight: 700; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  box-shadow: var(--shadow-xs);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary { --btn-bg: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn.teal { --btn-bg: linear-gradient(135deg, #12907e, #0d7a6a); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { --btn-bg: linear-gradient(135deg, #e5484d, var(--danger)); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: var(--r-pill); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.icon { padding: 8px; width: 34px; height: 34px; border-radius: 10px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 85, 51, 0.12);
}
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
input[type=file] { font-size: 14px; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; background: var(--paper-2); color: var(--muted);
  border: 1px solid transparent;
}
.pill.ok { background: var(--teal-soft); color: var(--teal); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.plain { background: var(--surface-2); border-color: var(--line); }

/* ---------- code / copy box ---------- */
.copy-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; margin-top: 8px;
}
.copy-box .val { font-size: 20px; font-weight: 800; letter-spacing: 0.04em; }
.copy-box .val.num { font-size: 19px; letter-spacing: 0.08em; }

/* ---------- steps ---------- */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { position: relative; padding-left: 42px; color: var(--ink-2); }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.table th { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); position: sticky; top: 0; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: var(--surface-2); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(24px);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.9); opacity: 0; } 60% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.rise { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.rise-1 { animation-delay: 0.06s; } .rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.18s; } .rise-4 { animation-delay: 0.24s; }
.pop { animation: pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
.skeleton { position: relative; overflow: hidden; background: var(--paper-2); border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent); animation: shimmer 1.3s infinite; }

/* ---------- stat ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.stat .k { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.stat.accent { background: linear-gradient(160deg, #fff, var(--brand-soft)); border-color: #ffd9cc; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  appearance: none; background: none; border: none; font: inherit; font-weight: 700; font-size: 14px;
  color: var(--muted); padding: 11px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- ticket (result) ---------- */
.ticket {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.ticket::before, .ticket::after {
  content: ''; position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); transform: translateY(-50%);
}
.ticket::before { left: -14px; }
.ticket::after { right: -14px; }
.ticket .top { padding: 28px 26px 20px; text-align: center; }
.ticket .bottom { padding: 20px 26px 26px; border-top: 1.5px dashed var(--line-2); }

/* ---------- event item tiles ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.item-tile { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); position: relative; transition: transform 0.12s ease, box-shadow 0.18s ease; }
.item-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.item-tile .thumb { height: 104px; display: grid; place-items: center; background: var(--surface-2); font-size: 30px; }
.item-tile img { width: 100%; height: 104px; object-fit: cover; }
.item-tile .meta { padding: 9px 11px; font-size: 12px; word-break: break-all; color: var(--ink-2); }
.item-tile .badge { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255,255,255,0.9); border: 1px solid var(--line); }
.item-tile .badge.granted { color: var(--teal); border-color: #bfe3dc; }
.item-tile .del { position: absolute; top: 7px; left: 7px; }

/* ---------- hero ---------- */
.hero { padding: 74px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); font-weight: 800; }
.hero .lead { max-width: 640px; margin: 16px auto 30px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .tag { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.hero .tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }

/* feature */
.feature { padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.feature .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--brand-soft); margin-bottom: 14px; }
.feature h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- footer ---------- */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px 60px; }
.site-footer .links { display: flex; gap: 14px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(27,26,23,0.4); backdrop-filter: blur(3px); z-index: 120; display: grid; place-items: center; padding: 20px; animation: rise 0.2s ease both; }
.modal { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 24px; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .site-header .inner { padding: 12px 16px; }
  .hero { padding: 46px 0 26px; }
  .card { padding: 18px; }
  .stat .v { font-size: 25px; }
}
