/* vdlsm – dark, minimal, yellow accent */
:root {
  --bg: #09090a;
  --card: #111113;
  --field: #0b0b0c;
  --border: #1e1f23;
  --border-hi: #2b2d33;
  --text: #e8e9eb;
  --muted: #858a93;
  --accent: #f5b324;
  --accent-dim: rgba(245, 179, 36, .08);
  --accent-glow: rgba(245, 179, 36, .28);
  --accent-text: #1a1300;
  --danger: #ef5350;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
::selection { background: var(--accent); color: var(--accent-text); }

body {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(245, 179, 36, .05), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

a { color: var(--accent); }
.hidden { display: none !important; }
h2 { margin: 0 0 12px; font: 600 18px var(--mono); }
code { color: var(--accent); font-family: var(--mono); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
}
/* Small title sitting on the top border */
.card[data-title]::before {
  content: attr(data-title);
  position: absolute; top: -.7em; left: 16px; padding: 0 8px;
  font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .25em;
  background: linear-gradient(var(--bg) 50%, var(--card) 50%);
}

.label {
  display: block; margin-bottom: 6px;
  font: 12px var(--mono); color: var(--muted); letter-spacing: .3px;
}
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.error { color: var(--danger); margin: 12px 0 0; }

/* ---------- Inputs ---------- */
textarea, input, select {
  width: 100%; background: var(--field); color: var(--text);
  border: 1px solid var(--border-hi); border-radius: 8px;
  padding: 10px 12px; font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 240px; resize: vertical; font: 14px/1.55 var(--mono); }
textarea::placeholder, input::placeholder { color: var(--muted); }

/* ---------- Buttons ---------- */
button.primary, button.secondary, a.btn {
  font: 600 14px var(--mono); cursor: pointer; border-radius: 8px;
  padding: 10px 18px; border: 1px solid transparent; text-decoration: none; display: inline-block;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, filter .15s;
}
button.primary { background: var(--accent); color: var(--accent-text); }
button.primary:hover { filter: brightness(1.06); box-shadow: 0 0 22px var(--accent-glow); }
button.primary:disabled { opacity: .6; cursor: wait; }
button.primary.wide { width: 100%; margin-top: 16px; }
button.secondary, a.btn.secondary { background: var(--field); color: var(--text); border-color: var(--border-hi); }
button.secondary:hover, a.btn.secondary:hover { border-color: var(--accent); }

/* Toggle switches */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font: 13px var(--mono); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track {
  position: relative; width: 36px; height: 20px; border-radius: 20px;
  background: var(--border-hi); transition: background .15s; flex-shrink: 0;
}
.track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text); transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent-text); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header (tool page) ---------- */
header { text-align: center; padding: 0 0 28px; }
.logo {
  color: var(--text); text-decoration: none;
  font: 700 30px/1 var(--mono); letter-spacing: -1px;
}
.crumb { color: var(--muted); font-weight: 400; letter-spacing: 0; transition: color .15s; }
.logo:hover .crumb { color: var(--accent); }

/* ---------- sharenote layout ---------- */
/* Header height is mirrored below the card so the card itself sits in the exact middle */
.tool-page main { width: 100%; max-width: 720px; display: grid; gap: 28px; padding-bottom: 58px; }
@media (min-width: 1200px) {
  .tool-page main {
    max-width: none;
    grid-template-columns: 1fr minmax(0, 720px) 1fr;
    column-gap: 24px;
    align-items: start;
  }
  .tool-page main > .card { grid-column: 2; grid-row: 1; }
  .tool-page main > #faq {
    position: fixed; right: 16px; top: 50%; translate: 0 -50%;
    width: 320px;
  }
}

#text.small { min-height: 90px; }
#fileBox { margin-bottom: 14px; }
.meta-row { display: flex; justify-content: flex-end; margin-top: 6px; }
.counter { font: 12px var(--mono); color: var(--muted); }
.counter.over { color: var(--danger); }

.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 14px; }
.controls .switch { justify-self: start; }
.controls .primary { grid-column: 2; min-width: 200px; }

.options { margin-top: 18px; padding: 16px; border: 1px dashed var(--border-hi); border-radius: var(--radius); }
.options-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; }
#views { width: 110px; }
.inline { display: flex; gap: 6px; }
.inline input { width: 100px; }
.inline select { width: auto; }
.seg { display: flex; gap: 2px; background: var(--field); border: 1px solid var(--border-hi); border-radius: 9px; padding: 2px; }
.seg-btn {
  background: transparent; color: var(--muted); border: none; border-radius: 7px;
  padding: 7px 14px; cursor: pointer; font: 13px var(--mono);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--card); color: var(--accent); box-shadow: 0 0 0 1px var(--border-hi); }
.pw-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pw-row input { flex: 1; min-width: 180px; }

/* Drop zone */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px dashed var(--border-hi); border-radius: var(--radius);
  padding: 40px 16px; text-align: center; cursor: pointer; transition: .15s;
}
.drop span { color: var(--muted); font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-dim); }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 12px; background: var(--field); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.file-list img, .file-icon { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.file-icon { display: grid; place-items: center; background: var(--border-hi); font: 700 10px var(--mono); color: var(--muted); }
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--muted); font-family: var(--mono); }
.remove { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 8px; }
.remove:hover { color: var(--danger); }

/* Result */
.link-row { display: flex; gap: 8px; }
.link-row input { font: 13px var(--mono); }
.link-row button { white-space: nowrap; }
#resultInfo { margin: 16px 0 14px; color: var(--muted); }

/* Read */
#readIntro .field { margin: 14px 0 0; }
.note-text {
  white-space: pre-wrap; word-break: break-word; background: var(--field);
  border: 1px solid var(--border-hi); border-radius: 8px; padding: 14px;
  font: 14px/1.55 var(--mono); margin: 0; max-height: 60vh; overflow: auto;
}
.text-actions { display: flex; gap: 8px; margin: 10px 0 16px; }
.read-files { display: grid; gap: 12px; }
.read-file { background: var(--field); border: 1px solid var(--border-hi); border-radius: 8px; overflow: hidden; }
.read-file img, .read-file video { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.read-file audio { width: 100%; padding: 8px; }
.read-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.read-file-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 14px; }
.notice {
  margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: var(--accent-dim); border: 1px solid rgba(245, 179, 36, .3);
}
#newBtn2 { margin-top: 16px; }

/* FAQ */
.faq details { border-top: 1px solid var(--border); padding: 10px 0; }
.faq details:first-of-type { border-top: none; padding-top: 0; }
.faq details:last-child { padding-bottom: 0; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); font-family: var(--mono); }
.faq details[open] summary::before { content: "−"; }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--muted); margin: 8px 0 2px; font-size: 13px; }

/* ---------- Home ---------- */
.home-main { width: 100%; max-width: 640px; display: grid; gap: 34px; }
.hero { text-align: center; padding-bottom: 8px; }
.hero h1 {
  margin: 0; font: 800 clamp(64px, 14vw, 120px)/.9 var(--mono);
  letter-spacing: -.06em;
}
.hero h1::after { content: "."; color: var(--accent); text-shadow: 0 0 30px var(--accent-glow); }
.hero-sub {
  margin: 16px 0 0; font: 12px var(--mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: .5em; padding-left: .5em;
}

.tool {
  display: block; padding: 18px;
  color: inherit; text-decoration: none;
  background: var(--field); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool h2 { margin: 0; }
.tool-go { font: 600 18px var(--mono); color: var(--muted); transition: transform .15s, color .15s; }
.tool p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.tool:hover, .tool:focus-visible { border-color: var(--accent); box-shadow: 0 0 28px rgba(245, 179, 36, .07); outline: none; }
.tool:hover .tool-go { transform: translateX(3px); color: var(--accent); }

.home .home-main { margin-block: auto; }
.foot {
  margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px;
  font-size: 13px; color: var(--muted); text-align: center;
}
.foot a { color: var(--text); font-weight: 700; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  body { padding: 32px 16px; }
  header { padding: 0 0 22px; }
  .card { padding: 24px 16px 16px; }
  .controls { grid-template-columns: 1fr; }
  .controls .primary { grid-column: 1; width: 100%; }
  .link-row { flex-direction: column; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

header { animation: fade .3s ease-out both; }
.tool-page main > .card { animation: rise .3s cubic-bezier(.2, .7, .2, 1) .05s both; }
.tool-page main > #faq { animation-delay: .1s; }
#create > * { animation: fade .25s ease-out both; }
#create > :nth-child(2) { animation-delay: .08s; }
#create > :nth-child(3) { animation-delay: .1s; }
#create > :nth-child(4) { animation-delay: .12s; }
#create > :nth-child(5) { animation-delay: .14s; }
#create > :nth-child(n+6) { animation-delay: .16s; }

.hero { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.home-main > .card { animation: rise .35s cubic-bezier(.2, .7, .2, 1) .12s both; }
.home-main > .card + .card { animation-delay: .2s; }
.foot { animation: fade .4s ease-out .3s both; }

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