/* ecchan home: the same look as upload.ecchan.org (filehost/static/app.css). */

:root {
  color-scheme: light dark;
  --bg: #f4f4f2;
  --ink: #18181b;
  --muted: #6b6b70;
  --faint: #a1a1a6;
  --line: #e4e4e0;
  --line-strong: #d2d2cd;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --hover: #f0f0ee;
  --tint: #eef1f5;
  --accent: #46658f;
  --ring: 0 0 0 3px rgb(70 101 143 / 25%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 20px;
  --radius-sm: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --ink: #ededee;
    --muted: #9c9ca3;
    --faint: #66666d;
    --line: #26262a;
    --line-strong: #34343a;
    --surface: #18181b;
    --surface-2: #202024;
    --hover: #222226;
    --tint: #1c2027;
    --accent: #8ea7c9;
    --ring: 0 0 0 3px rgb(142 167 201 / 30%);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
::selection { background: rgb(70 101 143 / 22%); }
:focus-visible { outline: none; box-shadow: var(--ring); }
a:focus-visible { border-radius: 6px; }

.shell {
  width: min(100% - 48px, 640px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 4vh 0 10vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px 6px; }
.topbar nav { display: flex; align-items: center; gap: 6px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mark { display: block; width: 22px; height: 22px; border-radius: 7px; transition: transform .3s var(--spring); }
.wordmark:hover .mark { transform: rotate(-8deg) scale(1.08); }

.card { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; animation: rise .4s var(--ease) both; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 260px;
  padding: 32px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--tint);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transition: border-color .25s, transform .35s var(--spring);
}
.drop:hover { border-color: var(--accent); }
.drop:hover .tile-icon { transform: translateY(-4px) scale(1.04); }
.tile-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 18px;
  transition: transform .35s var(--spring);
}
.drop-title { font-size: 16px; font-weight: 500; }
.drop-hint { font-size: 13px; color: var(--muted); }
.drop-limit { margin-top: 6px; font-size: 12px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; }
.empty h1 { font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.empty p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}
.button:hover { border-color: var(--line-strong); }

/* ---------------------------------------------------------------- apps menu (same on every ecchan site) */

.apps { position: relative; }
.apps > summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color .15s, color .15s;
}
.apps > summary::-webkit-details-marker { display: none; }
.apps > summary:hover, .apps[open] > summary { color: var(--ink); background: var(--hover); }
.apps-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 4px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: pop-in .3s var(--spring);
}
.topbar .apps-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s;
}
.topbar .apps-menu a:hover { background: var(--hover); }
.topbar .apps-menu a[aria-current] { background: var(--tint); }
.app-icon { display: block; width: 40px; height: 40px; border-radius: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }

@media (max-width: 520px) {
  .shell { width: min(100% - 28px, 640px); }
  .tiles { grid-template-columns: 1fr; }
  .drop { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
