:root {
  --bg: #FBF9F4;
  --card-bg: #FFFFFF;
  --ink: #1F2A24;
  --ink-soft: #5A6960;
  --accent: #C56A1E;
  --teal: #1C5C55;
  --line: #D8D0BE;
  --error: #B3432E;
  --shadow: rgba(31, 42, 36, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141C18;
    --card-bg: #1C2620;
    --ink: #F1EEE4;
    --ink-soft: #AAB6AD;
    --accent: #E38A3C;
    --teal: #5CAE9F;
    --line: #37443B;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}
.site-header .brand { text-decoration: none; color: var(--ink); }
.site-header .mark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.site-header nav a {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 8px;
}
.site-header nav a:hover { color: var(--teal); border-color: var(--teal); }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

h1.page-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 500;
  margin: 0 0 6px;
}
p.page-sub {
  color: var(--ink-soft);
  margin: 0 0 32px;
}

/* ---------- shop grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 8px 20px var(--shadow);
  display: block;
  transition: transform 0.12s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-card .thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--line);
  display: block;
}
.product-card .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  color: var(--ink-soft);
}
.product-card .body { padding: 14px 16px 16px; }
.product-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.product-card .price {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  font-size: 0.92rem;
  margin: 0;
}

.empty-state {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state a { color: var(--teal); }

/* ---------- ticket / product page ---------- */
.ticket {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 12px 32px var(--shadow);
  overflow: hidden;
  max-width: 440px;
  margin: 0 auto;
}
.ticket-main { padding: 30px 28px 26px; }
.ticket-stub { padding: 26px 28px 30px; }

.perforation {
  position: relative;
  height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
}
.perforation::before, .perforation::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px; height: 24px;
  background: var(--bg);
  border-radius: 50%;
  transform: translateY(-50%);
}
.perforation::before { left: -40px; }
.perforation::after { right: -40px; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--teal);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

h1.headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 6px;
}

.price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0 0 18px;
}

.desc {
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.96rem;
  margin: 0;
  white-space: pre-wrap;
}

/* media carousel */
.carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 18px;
  aspect-ratio: 4/3;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.carousel-slide img, .carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.carousel-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}
.carousel-dots .dot.active { background: #fff; }

/* forms */
label {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }

input[type="text"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 8px 2px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 56px; font-family: inherit; }

input[type="file"] {
  width: 100%;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.btn {
  appearance: none;
  border: none;
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  margin-top: 22px;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  margin-top: 10px;
}
.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid var(--error);
}

.hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 8px; }
.hint.error { color: var(--error); }
.notice {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.notice.success { border-color: var(--teal); color: var(--teal); }
.notice.error { border-color: var(--error); color: var(--error); }

/* link box */
.link-box {
  margin-top: 18px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.link-box .label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--teal);
  margin-bottom: 8px;
}
.link-box .url {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--ink);
  line-height: 1.5;
}

/* admin list */
.admin-form-card, .admin-list-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px 26px 28px;
  box-shadow: 0 8px 20px var(--shadow);
  margin-bottom: 28px;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.admin-row:last-child { border-bottom: none; }
.admin-row img.thumb-sm {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
  flex-shrink: 0;
}
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info h4 { margin: 0 0 2px; font-size: 0.95rem; font-family: 'Fraunces', serif; font-weight: 500; }
.admin-row .info .meta { font-size: 0.78rem; color: var(--ink-soft); word-break: break-all; }
.admin-row .actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-row .actions a, .admin-row .actions button {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.admin-row .actions a:hover, .admin-row .actions button:hover { color: var(--teal); border-color: var(--teal); }

.login-card {
  max-width: 360px;
  margin: 60px auto;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 8px 20px var(--shadow);
}

@media (max-width: 420px) {
  .perforation::before { left: -32px; }
  .perforation::after { right: -32px; }
  .ticket-main, .ticket-stub { padding-left: 22px; padding-right: 22px; }
}
