:root {
  --bg: #000;
  --ink: #f4f4f2;
  --muted: #8a8a8a;
  --yellow: #f5c518;
  --panel: #141416;
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { height: 100%; }

body {
  background: #000;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow-x: hidden;
}

/* studio vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 42% 38%, rgba(60, 60, 62, 0.55), rgba(0, 0, 0, 0) 55%),
    radial-gradient(140% 120% at 50% 60%, #101011 0%, #000 70%);
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 8vw 3vh;
}

.card-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
  width: 100%;
}

/* 3D card */
.scene {
  perspective: 1300px;
  perspective-origin: 58% 42%;
  padding: clamp(14px, 4vw, 30px) 0;
}

.card {
  position: relative;
  width: min(232px, 54vw);
  transform: rotateY(-27deg) rotateX(5deg) rotate(-1.5deg);
  transform-style: preserve-3d;
  border-radius: 14px;
  filter: drop-shadow(-26px 34px 36px rgba(0, 0, 0, 0.8));
}

.card img {
  display: block;
  width: 100%;
  border-radius: 14px;
  backface-visibility: hidden;
  filter: brightness(1.12) contrast(1.03);
}

.card .sheen {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(108deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(0, 0, 0, 0) 42%,
    rgba(0, 0, 0, 0.30) 78%,
    rgba(0, 0, 0, 0.5) 100%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.card .rim {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow:
    inset 2px 2px 1px rgba(255, 255, 255, 0.45),
    inset 1px 0 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7%;
  width: 104%;
  height: 16%;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 50%;
  filter: blur(26px);
  transform: translateX(-55%) translateZ(-70px) scaleX(1.25);
  z-index: -1;
}

.reflection {
  height: clamp(44px, 12vw, 64px);
  overflow: hidden;
  margin-top: -4px;
}
.reflection img {
  display: block;
  width: min(232px, 54vw);
  border-radius: 14px;
  transform: rotateY(-27deg) rotateX(5deg) rotate(-1.5deg) scaleY(-1);
  transform-origin: top center;
  opacity: 0.14;
  filter: blur(4px);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 75%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 75%);
}

.note {
  margin-top: clamp(22px, 5vw, 40px);
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.5;
  max-width: 20em;
}

.note-fine {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  line-height: 1.6;
  max-width: 22em;
}

/* ---------------- Experiences ---------------- */
:root { --ticker-h: clamp(150px, 24vw, 200px); }

.experiences {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) 6vw clamp(20px, 4vw, 36px);
  text-align: center;
}

.exp-head {
  display: flex;
  justify-content: center;
  margin-top: clamp(18px, 3vw, 26px);
}

.btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--yellow);
  background: var(--yellow);
  color: #1a1a1a;
  padding: 10px 18px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--ink); }
.btn:focus-visible,
.heart-btn:focus-visible,
.star:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* vertical ticker: messages scroll bottom -> top */
.ticker {
  height: var(--ticker-h);
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.ticker-track {
  list-style: none;
  margin: 0;
  padding: 0;
  will-change: transform;
  transition: transform 2s cubic-bezier(0.45, 0, 0.15, 1);
}

.ticker-item {
  height: var(--ticker-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 6px;
}

.ticker-item blockquote {
  font-size: clamp(1.05rem, 2.7vw, 1.4rem);
  line-height: 1.5;
  font-weight: 600;
  max-width: 32ch;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticker-item .who {
  color: var(--yellow);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.exp-state {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 8px 2px;
}

/* ---------------- Modal ---------------- */
.modal {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  width: min(460px, 92vw);
  max-height: min(88vh, 720px);
  padding: 0;
  margin: auto;          /* restore centring killed by the global reset */
  overflow: auto;
}
.modal:not([open]) { display: none; }
.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.modal form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal h3 {
  font-size: 1.2rem;
  font-weight: 800;
}
.modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.modal input[type="text"],
.modal input[type="email"],
.modal textarea {
  font: inherit;
  color: var(--ink);
  background: #0c0c0d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  resize: vertical;
}
.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: var(--yellow);
}
.char-count {
  align-self: flex-end;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}
.char-count.near-limit { color: var(--yellow); }
.char-count.at-limit { color: #ff6b6b; }
.modal .check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}
.modal .check input { width: auto; }
.modal .opt { font-weight: 400; }

.rating-row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.stars-input {
  display: inline-flex;
  gap: 4px;
}
.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.25);
  padding: 2px;
}
.star.on { color: var(--yellow); }

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.form-msg {
  font-size: 0.85rem;
  min-height: 1em;
}
.form-msg.ok { color: #7dd66e; }
.form-msg.err { color: #ff6b6b; }

/* ---------------- Footer ---------------- */
footer {
  position: relative;
  z-index: 1;
  padding: 10px 8vw 40px;
  display: flex;
  justify-content: flex-end;
}

.heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  padding: 8px;
  line-height: 0;
}
.heart-btn svg { width: clamp(32px, 8vw, 42px); height: clamp(32px, 8vw, 42px); overflow: visible; }
.heart-btn svg path {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2;
  transition: fill 0.25s ease, transform 0.2s ease;
  transform-origin: center;
}
.heart-btn.liked svg path { fill: var(--yellow); }
.heart-btn:active svg path { transform: scale(0.82); }

@media (max-width: 600px) {
  .stage { padding: 6vh 8vw 3vh; }
  .card { transform: rotateY(-20deg) rotateX(3deg) rotate(-1deg); }
  .reflection img { transform: rotateY(-20deg) rotateX(3deg) rotate(-1deg) scaleY(-1); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { transition: none !important; }
  * { transition: none !important; }
}

/* ---------------- Admin ---------------- */
body.admin { display: block; background: #0b0b0c; }
body.admin::before { display: none; }

.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px;
}
.admin-wrap h1 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 20px;
}
.admin-lead { color: var(--muted); margin-bottom: 14px; }

#loginForm,
#codeForm,
#codeVerifyForm {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#loginForm input,
#codeForm input,
#codeVerifyForm input {
  flex: 1 1 200px;
  font: inherit;
  color: var(--ink);
  background: #0c0c0d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
#loginForm input:focus,
#codeForm input:focus,
#codeVerifyForm input:focus { outline: none; border-color: var(--yellow); }
#codeVerifyForm #loginCode { letter-spacing: 0.4em; font-size: 1.1rem; text-align: center; }

.admin-alt { margin: 12px 0 0; }
.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.linkish:hover { color: var(--ink); }

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-who { color: var(--muted); font-size: 0.9rem; }

.table-scroll { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.th-sort {
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.th-sort:hover { color: var(--ink); }
.th-sort #sortArrow { font-size: 0.6rem; }
.th-filter {
  display: block;
  margin-top: 4px;
  font: inherit;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  background: #0c0c0d;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 4px;
}
.admin-table td { white-space: nowrap; }
.admin-table .col-exp {
  white-space: pre-wrap;
  min-width: 320px;
  max-width: 640px;
  line-height: 1.45;
}
.admin-table .col-act { white-space: nowrap; }
.admin-table .col-check { width: 1px; }

.abtn {
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 4px 0 0;
}
.abtn:hover:not(:disabled) { border-color: var(--ink); }
.abtn:disabled { opacity: 0.35; cursor: default; }

.admin-empty-row td {
  text-align: center;
  color: var(--muted);
  white-space: normal;
  padding: 18px 9px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
