/* XO Links — brand system derived from xordinary.vision
   Near-black stage, white type, spectrum-of-light accent. */

:root {
  --ink: #07070c;
  --ink-2: #0d0d15;
  --ink-3: #14141f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.55);
  --text-faint: rgba(245, 245, 247, 0.32);
  --sp-1: #2dd4bf;
  --sp-2: #7c6cff;
  --sp-3: #e14ecf;
  --sp-4: #f5a524;
  --spectrum: linear-gradient(90deg, var(--sp-1), var(--sp-2), var(--sp-3), var(--sp-4));
  --radius: 14px;
}

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

html, body {
  background: var(--ink);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }

h1, h2, h3 {
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
h1 { font-size: 32px; }
.eyebrow {
  font-family: "Archivo";
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.spectrum-text {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.faint { color: var(--text-faint); }
.right { text-align: right; }

/* ---------- app chrome ---------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 0 28px 96px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 20px; margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 14px; }
.topbar .brand img { height: 30px; display: block; }
.topbar .brand .app-name {
  font-family: "Archivo"; font-weight: 600; font-size: 14px;
  letter-spacing: 0.06em; color: var(--text-dim);
  border-left: 1px solid var(--line); padding-left: 14px;
}
.topbar nav { display: flex; gap: 8px; align-items: center; }
.user-chip {
  font-size: 12.5px; color: var(--text-faint);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; white-space: nowrap;
}
@media (max-width: 720px) { .user-chip { display: none; } }

.spectrum-line {
  height: 2px; width: 100%; background: var(--spectrum);
  opacity: 0.85; border-radius: 2px; margin: 24px 0 28px;
}

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; flex-wrap: wrap;
}
.page-sub { color: var(--text-dim); margin-top: 6px; }
.search-form { min-width: 280px; }
.search-form input, .search-field input {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px;
}
.search-field { max-width: 420px; margin-bottom: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink-3);
  color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.25); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--text); color: var(--ink); border-color: transparent; }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn.danger:hover { color: var(--sp-3); }
.btn:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--sp-2); outline-offset: 2px;
}

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 7px;
}
.field input, .field textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px;
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus, .search-form input:focus, .search-field input:focus {
  border-color: var(--sp-2); outline: none;
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check {
  display: flex; gap: 10px; align-items: center; margin-bottom: 22px;
  font-size: 13.5px; color: var(--text-dim); cursor: pointer;
}

/* ---------- cards / lists ---------- */
.card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.card-title { font-size: 18px; margin-bottom: 8px; }
.empty-state { text-align: center; padding: 56px; }
.empty-state h2 { font-size: 20px; margin-bottom: 10px; }
.empty-state p { color: var(--text-dim); margin-bottom: 22px; }
.error-card { border-color: var(--sp-3); margin-bottom: 20px; }
.success-card { border-color: rgba(45, 212, 191, 0.4); margin-bottom: 24px; }

.share-list { display: grid; gap: 12px; }
.share-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px;
  align-items: center; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--ink-2); transition: border-color 0.15s ease;
}
.share-row:hover { border-color: rgba(255, 255, 255, 0.2); }
.share-row .thumb {
  width: 96px; aspect-ratio: 16 / 9; border-radius: 8px;
  object-fit: cover; background: var(--ink-3);
}
.row-title { font-weight: 600; font-size: 15px; }
.row-sub { color: var(--text-dim); font-size: 13.5px; }
.row-url { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }
.row-last { color: var(--text-faint); font-size: 12px; margin-top: 6px; }
.share-row .actions { text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim);
}
.badge.viewed { border-color: rgba(45, 212, 191, 0.4); color: var(--sp-1); }
.badge.unviewed { color: var(--text-faint); }

/* video picker */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.video-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--ink-2); overflow: hidden; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.video-card:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }
.video-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.video-card .thumb-blank { aspect-ratio: 16 / 9; background: var(--ink-3); }
.video-card .meta { padding: 12px 14px; }
.video-card .meta .name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.video-card .meta .sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.video-card .preview-btn { margin-top: 8px; padding: 4px 0; font-size: 12.5px; }

.create-layout { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: start; }
.sel-thumb { width: 100%; border-radius: 12px; }
.sel-name { margin-top: 12px; font-weight: 600; }

/* share detail */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; align-items: center; }
.url-box {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; color: var(--text-dim); font-size: 13.5px; min-width: 300px;
}
.visit-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.visit-row:last-child { border-bottom: none; }
.fine-note { color: var(--text-faint); font-size: 13px; margin-top: 16px; }
.danger-zone { margin-top: 32px; }

/* modal */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.75);
  display: grid; place-items: center; padding: 24px;
}
.modal-body { width: min(860px, 100%); }
.modal-actions { text-align: right; margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- landing ---------- */
.landing { min-height: 100svh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax;
  border-radius: 50%; filter: blur(90px); opacity: 0.22;
}
.aurora::before {
  background: radial-gradient(circle at 30% 30%, var(--sp-2), transparent 60%),
    radial-gradient(circle at 70% 60%, var(--sp-1), transparent 55%);
  top: -25vmax; left: -15vmax;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora::after {
  background: radial-gradient(circle at 60% 40%, var(--sp-3), transparent 55%),
    radial-gradient(circle at 30% 70%, var(--sp-4), transparent 60%);
  bottom: -30vmax; right: -18vmax;
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after { animation: none; }
}

.landing-inner {
  position: relative; z-index: 1; width: 100%; max-width: 1020px;
  margin: 0 auto; padding: 0 28px;
  display: flex; flex-direction: column; flex: 1;
}
.landing-header {
  display: flex; align-items: center; justify-content: space-between; padding: 30px 0;
}
.landing-header img { height: 60px; }
.landing-header .contact { font-size: 13px; color: var(--text-dim); }
.landing-header .contact:hover { color: var(--text); }

.landing-hero { padding: 3vh 0 34px; }
.landing-hero .eyebrow { margin-bottom: 16px; }
.landing-hero h1 { font-size: clamp(34px, 5.4vw, 62px); font-weight: 800; max-width: 18ch; }
.landing-hero .intro { margin-top: 18px; max-width: 56ch; font-size: 16px; color: var(--text-dim); }

.player-frame {
  position: relative; border-radius: 18px; padding: 1px;
  background: var(--spectrum);
  box-shadow: 0 30px 120px -30px rgba(124, 108, 255, 0.35);
}
.player-frame .player-inner {
  border-radius: 17px; overflow: hidden; background: #000; aspect-ratio: 16 / 9;
}
.player-inner iframe { width: 100%; height: 100%; border: 0; display: block; }

.landing-footer {
  margin-top: auto; padding: 56px 0 40px;
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
.landing-footer .tagline { font-family: "Archivo"; font-weight: 700; font-size: 15px; }
.tagline-sub { margin-top: 4px; }
.fine { font-size: 12.5px; color: var(--text-faint); }
.fine a { color: var(--text-dim); }
.fine a:hover { color: var(--text); }

/* sign in */
.signin-stage {
  min-height: 100svh; display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.signin-card {
  position: relative; z-index: 1; text-align: center;
  padding: 48px 44px; background: rgba(13, 13, 21, 0.8);
  border: 1px solid var(--line); border-radius: 20px;
  backdrop-filter: blur(14px); max-width: 380px;
}
.signin-card img { height: 40px; margin-bottom: 26px; }
.signin-card h1 { font-size: 22px; margin-bottom: 8px; }
.signin-card p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 26px; }
.error-note { color: var(--sp-3) !important; }

@media (max-width: 720px) {
  .shell { padding: 0 18px 72px; }
  .share-row { grid-template-columns: 72px 1fr; }
  .share-row .actions { grid-column: 1 / -1; text-align: left; }
  .create-layout { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .url-box { min-width: 0; width: 100%; }
}
