/* ============================================================================
 * site.css — Sub-pages (/dl, /link, /s/<code>). Loaded after styles.css so the
 * pages share the front page's rain, glass panels, buttons and theme colours;
 * this adds a scrolling layout, the top bar and the page-specific pieces.
 * ========================================================================== */

:root { --panel-strong: rgba(0, 0, 0, 0.72); }

html.page, html.page body { height: auto; min-height: 100%; overflow: auto; }
html.page body { display: flex; flex-direction: column; }

/* Everything readable sits above the rain (z 2) and vignette (z 3). */
.topbar, .page-main { position: relative; z-index: 5; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  z-index: 10;
}
.topbar .logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  background: var(--title-grad, linear-gradient(90deg, var(--accent), var(--accent2)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px var(--title-glow));
}
.topbar .crumb {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.topbar .top-links { position: static; margin-left: auto; }
.dl-link.active { opacity: 1; border-color: var(--accent); }

.page-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

/* ---- Glass panels -------------------------------------------------------- */
.glass {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel-strong);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page-title {
  margin: 0 0 6px;
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--title-grad, linear-gradient(90deg, var(--accent), var(--accent2)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px var(--title-glow));
}
.page-sub { margin: 0 0 22px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; }

.placeholder { opacity: 0.55; padding: 48px 0; text-align: center; }

/* ---- Form bits ----------------------------------------------------------- */
.label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 8px;
}
.textarea, .input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--field-bg);
  color: var(--fg);
  font-size: 14px;
  outline: none;
}
.textarea {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.input { padding: 9px 12px; }
.textarea:focus, .input:focus { border-color: var(--accent); }
.textarea::placeholder, .input::placeholder { color: var(--fg); opacity: 0.4; }

/* Segmented control built from radios. */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--field-bg);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.seg label:hover { opacity: 1; }
.seg input:checked + label { background: var(--accent); color: #05070d; opacity: 1; }
.seg input:focus-visible + label { outline: 2px solid var(--accent2); outline-offset: 2px; }
body.is-light .seg input:checked + label { color: #fff; }

.hint { font-size: 12px; opacity: 0.5; margin: 8px 0 0; line-height: 1.5; }
.hint code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hint code { font-size: 11.5px; background: var(--field-bg); padding: 1px 5px; border-radius: 5px; }
.err { color: #f0a34b; font-size: 13px; min-height: 18px; margin: 12px 0 0; }
.btn.lg { padding: 12px 20px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- /link: create ------------------------------------------------------- */
.shorten { max-width: 820px; margin: 0 auto; }
.shorten .card { padding: 24px; }
.opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 22px 0 6px;
}
.opt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.opt-line .input { width: auto; }
.days-input { width: 84px !important; }
.fname-input { width: 190px !important; }
.opt-line[hidden] { display: none; }
.opt-sub { margin-top: 10px; }

.result { margin-top: 18px; padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.result[hidden] { display: none; }
.short-url {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.short-url a {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--field-bg);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 18px var(--title-glow);
}
.facts { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.8; }
.facts li { opacity: 0.8; }
.facts strong { opacity: 1; }
.cmd {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--field-bg);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre;
}
.qr {
  width: 196px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.qr-img {
  width: 196px;
  height: 196px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 26px var(--title-glow);
}
.qr-img svg { display: block; width: 100%; height: 100%; }

/* ---- /s/<code>: viewer --------------------------------------------------- */
.viewer { max-width: 900px; margin: 0 auto; }
.viewer .card { padding: 24px; }
.viewer .meta { font-size: 13px; opacity: 0.6; margin: 0 0 16px; }
.paste {
  margin: 0 0 16px;
  padding: 16px;
  max-height: 62vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--field-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.gate { text-align: center; padding: 20px 0 6px; }
.gate p { opacity: 0.75; line-height: 1.6; margin: 0 auto 18px; max-width: 520px; }

/* ---- /dl: downloads ------------------------------------------------------ */
.dl-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}
.dl-nav {
  position: sticky;
  top: 86px;
  padding: 10px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.dl-nav .item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font: inherit;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dl-nav .item:last-child { margin-bottom: 0; }
.dl-nav .item:hover { background: var(--field-bg); }
.dl-nav .item.active {
  background: var(--field-bg);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--title-glow);
}
.dl-nav .name { font-weight: 650; }
.dl-nav .meta { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; margin-top: 3px; }
.dl-nav .sum { font-size: 12.5px; opacity: 0.7; margin-top: 5px; line-height: 1.4; }

.dl-content { padding: 26px 30px 34px; min-width: 0; }
.dl-content .head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 4px; }
.dl-content .head h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
  background: var(--title-grad, linear-gradient(90deg, var(--accent), var(--accent2)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dl-content .head .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.dl-content .head .btn svg { width: 16px; height: 16px; }
.dl-content .metaline { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; margin-bottom: 18px; }

/* rendered readme */
article { line-height: 1.65; font-size: 14.5px; }
article h1, article h2, article h3 {
  margin: 1.6em 0 0.5em; line-height: 1.25;
  border-bottom: 1px solid var(--panel-border); padding-bottom: 0.3em;
}
article h1 { font-size: 1.35rem; } article h2 { font-size: 1.15rem; color: var(--accent2); }
article h3 { font-size: 1rem; border-bottom: none; }
article p { margin: 0.7em 0; opacity: 0.92; }
article a { color: var(--accent); }
article code {
  background: var(--field-bg); border: 1px solid var(--panel-border);
  border-radius: 5px; padding: 0.1em 0.35em; font-size: 0.86em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
article pre {
  background: var(--field-bg); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 0.9rem 1rem; overflow-x: auto;
}
article pre code { background: none; border: none; padding: 0; font-size: 0.85rem; }
article table { border-collapse: collapse; margin: 0.8em 0; width: 100%; display: block; overflow-x: auto; }
article th, article td { border: 1px solid var(--panel-border); padding: 0.5em 0.75em; text-align: left; }
article th { background: var(--field-bg); }
article blockquote { margin: 0.8em 0; padding: 0.1em 1em; border-left: 3px solid var(--accent); opacity: 0.75; }
article hr { border: none; border-top: 1px solid var(--panel-border); margin: 1.5em 0; }
article ul, article ol { padding-left: 1.4em; }
article li { margin: 0.25em 0; }

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .topbar .crumb { display: none; }
  .page-main { padding: 20px 16px 48px; }
  .dl-layout { grid-template-columns: 1fr; }
  .dl-nav { position: static; max-height: none; }
  .dl-content { padding: 20px 18px 26px; }
  .opts { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .qr { width: 100%; align-items: center; }
}
@media (max-width: 480px) {
  .dl-link { padding: 7px 11px; font-size: 11px; }
  .shorten .card, .viewer .card, .result { padding: 18px; }
}
