/* Ilion IFISS — brand aligned with ilionit.com */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/fraunces-500.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 650;
  font-display: swap;
  src: url("/static/fonts/fraunces-650.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Bodoni";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/libre-bodoni-700.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/source-sans-3-400.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/source-sans-3-500.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/source-sans-3-600.woff2") format("woff2");
}

:root {
  --ink: #2a332f;
  --ink-soft: #3d4a44;
  --paper: #f4f1ea;
  --paper-deep: #e4ddd0;
  --line: rgba(42, 51, 47, 0.14);
  --accent: #5c6b52;
  --accent-hot: #b85c38;
  --sky: #6f8f9a;
  --muted: #3d4a44;
  --warn: #b85c38;
  --error: #8b1e1e;
  --surface: rgba(255, 255, 255, 0.72);
  --drop: #e4ddd0;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-brand: "Libre Bodoni", "Times New Roman", Times, serif;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --ink: #e8ebe6;
  --ink-soft: #c5cbc4;
  --paper: #1a1f1c;
  --paper-deep: #242b27;
  --line: rgba(232, 235, 230, 0.14);
  --accent: #8fa388;
  --accent-hot: #d4896a;
  --sky: #8fb0ba;
  --muted: #9aa89f;
  --warn: #d4896a;
  --error: #e07070;
  --surface: rgba(36, 43, 39, 0.85);
  --drop: #2c3430;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 0% 20%, rgba(184, 92, 56, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 40%, rgba(111, 143, 154, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(92, 107, 82, 0.16), transparent 55%),
    linear-gradient(165deg, #efe8da 0%, var(--paper) 40%, #dde6e4 100%);
  background-attachment: fixed;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 70% 45% at 10% 0%, rgba(184, 92, 56, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(92, 107, 82, 0.12), transparent 55%),
    var(--paper);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hot); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 68rem;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.cloud-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.cloud-logo img {
  height: 2.5rem;
  width: auto;
  display: block;
  border-radius: 0.2rem;
}
.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.05rem;
  font-feature-settings: "liga" 0;
}
.brand:hover { color: var(--accent-hot); }

.site-header nav {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-header nav a {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.site-header nav a:hover {
  color: var(--accent-hot);
  border-bottom-color: var(--accent-hot);
}
.theme-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 0.2rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--accent-hot); color: var(--accent-hot); }

main {
  flex: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.hero { text-align: left; }
.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--ink);
  line-height: 1.05;
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
  color: var(--muted);
}
.lede { margin: 0 0 1.75rem; color: var(--muted); max-width: 38ch; }
.banner {
  margin: -1rem 0 1.5rem;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  font-size: 0.95rem;
}
.nav-user { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { display: inline; margin: 0; }
.nav-logout .linkish,
button.linkish {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.nav-logout .linkish:hover,
button.linkish:hover { color: var(--accent-hot); }
.ent-list { list-style: none; padding: 0; }
.ent-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.ent-kind {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.ent-code { font-size: 0.85rem; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 0;
}
.inline-form input[type="text"] {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 0.2rem;
  min-width: 10rem;
}

.mode-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  margin-bottom: 1rem;
  overflow: hidden;
}
.mode {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.mode.active {
  background: var(--ink);
  color: var(--paper);
}

.dropzone {
  border: 2px dashed var(--line);
  background: color-mix(in srgb, var(--paper-deep) 55%, transparent);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  min-height: 9rem;
  transition: border-color 0.15s, background 0.15s;
  border-radius: 0.25rem;
}
.dropzone:focus, .dropzone.dragover {
  border-color: var(--accent-hot);
  outline: none;
}
.drop-label { margin: 0; color: var(--muted); }
.file-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  text-align: left;
  font-size: 0.9rem;
}
.file-list li { padding: 0.2rem 0; }

.paste-pane textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  border-radius: 0.2rem;
}
.hidden { display: none !important; }

.opts {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
@media (min-width: 560px) {
  .opts {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .opts .check { grid-column: 1 / -1; }
}
.opts label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.opts select, .opts input[type="password"], .pw-form input {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 0.2rem;
}
.check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.status { min-height: 1.5em; color: var(--muted); font-size: 0.9rem; }
.status.error, .error { color: var(--error); }
.result {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0.25rem;
}
.result a { word-break: break-all; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent-hot); }
.muted { color: var(--muted); font-size: 0.85rem; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.view-head h1 { margin: 0 0 0.35rem; font-size: 1.35rem; word-break: break-word; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.warn { color: var(--warn); }
.preview { margin: 0 0 1.5rem; }
.preview img {
  max-width: 100%;
  height: auto;
  display: block;
  background: var(--drop);
}
.paste-view {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.raw-links, .unlock-cta { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.unlock-cta { border-top: 1px solid var(--line); padding-top: 1rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--drop);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: 85vh; }
.lightbox p { color: #ddd; margin: 0.5rem 0 0; }
.lb-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.content-page h1 { margin-top: 0; }
.prose h2 { font-size: 1.15rem; margin-top: 1.5rem; }
.donate { list-style: none; padding: 0; }
.donate li { margin: 0.75rem 0; word-break: break-all; }
.donate code { font-family: var(--mono); font-size: 0.8rem; }
.pw-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 20rem;
  margin-top: 1rem;
}
.download-cta { margin: 2rem 0; }

.admin-page { max-width: 40rem; }
.admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.admin-head h1 { margin: 0; }
.admin-login, .admin-lookup, .admin-kill {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.admin-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-row input[type="text"],
.admin-login input[type="password"] {
  flex: 1;
  min-width: 12rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 0.2rem;
  font: inherit;
}
.admin-card {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
.admin-meta {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
.admin-meta dt { color: var(--muted); margin: 0; }
.admin-meta dd { margin: 0; word-break: break-word; }
.admin-preview {
  margin: 1rem 0;
  background: var(--drop);
}
.admin-preview img {
  max-width: 100%;
  max-height: 280px;
  display: block;
  margin: 0 auto;
}
.admin-gallery { margin: 1rem 0; }
.admin-flash {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 0.75rem 1rem;
}
.error {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--error) 30%, transparent);
  padding: 0.75rem 1rem;
}
.btn.danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn.danger:hover { filter: brightness(1.08); }
.linkish {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}
.linkish:hover { color: var(--accent-hot); }
