/* big - dressed to match simplicated.cc:
   pure black, white, Times New Roman, hairline boxes, hand-drawn wobble.

   Sized phone-first. Everything is deliberately larger than a desktop app would
   be, because this is used one-handed on a phone; the min-width block at the
   bottom pulls it back for real desktop widths. */

:root {
  --ink: #ffffff;
  --dim: #aaaaaa;
  --dimmer: #6a6a6a;
  --hover: #1f1f1f;
  --press: #111111;
  --bad: #ff8f8f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

.hidden { display: none !important; }

.deadSvgJustSittingThere {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
}

.offscreen {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --- the wobble -----------------------------------------------------------
   A .frame is an empty absolutely-positioned box with only a border. The
   roughening filter is applied to it alone, so the border wobbles while the
   text sitting above it stays perfectly crisp. */

.frame {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--ink);
  pointer-events: none;
}

.rough {
  filter: url(#rough1);
  animation: boil 0.75s steps(1) infinite;
}

@keyframes boil {
  0%   { filter: url(#rough1); }
  34%  { filter: url(#rough2); }
  67%  { filter: url(#rough3); }
}

/* Respect people who do not want a border quietly vibrating at them. */
@media (prefers-reduced-motion: reduce) {
  .rough { animation: none; }
}

/* Film grain, straight out of an feTurbulence, sitting over everything. */
.grainOverlayThingy {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'>\
<filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter>\
<rect width='160' height='160' filter='url(%23g)'/></svg>");
}

/* --- login ---------------------------------------------------------------- */

#login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.panel {
  position: relative;
  width: 100%;
  max-width: min(440px, 94vw);
}

.panelGuts { position: relative; padding: 34px 28px 28px; }

.panel h1 {
  margin: 0;
  font-size: clamp(46px, 15vw, 64px);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0.01em;
}

.sub {
  margin: 12px 0 26px;
  color: var(--dim);
  font-size: 17px;
}

.fieldWrap { display: block; }

input[type="password"] {
  width: 100%;
  padding: 15px 13px;
  font-family: inherit;
  font-size: 19px; /* never below 16px, or mobile browsers zoom on focus */
  color: var(--ink);
  background: #000;
  border: 1px solid var(--dim);
  border-radius: 0;
  outline: none;
}

input[type="password"]:focus { background: #111; border-color: var(--ink); }
input[type="password"]::placeholder { color: var(--dimmer); }

#loginBtn {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-family: inherit;
  font-size: 22px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

#loginBtn:hover { background: var(--hover); }
#loginBtn:active { background: var(--press); }
#loginBtn:disabled { color: var(--dimmer); }

.msg {
  min-height: 22px;
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--bad);
}

/* --- browser -------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: calc(env(safe-area-inset-top) + 11px) 13px 11px;
  background: #000;
  border-bottom: 1px solid var(--dim);
}

.chip {
  flex: none;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 22px;
  color: var(--ink);
  background: #000;
  border: 1px solid var(--dim);
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
}

.chip:hover { background: var(--hover); }
.chip:active { background: var(--press); }

.ico {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crumbs {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  font-size: 18px;
  color: var(--dimmer);
}

.crumbs::-webkit-scrollbar { display: none; }
.crumbs b { color: var(--ink); font-weight: normal; }
.crumbs span { cursor: pointer; }
.crumbs span:hover { color: var(--ink); }
.crumbs .sep { margin: 0 7px; color: var(--dimmer); cursor: default; }

.dot {
  flex: none;
  width: 10px; height: 10px;
  border: 1px solid var(--dim);
  border-radius: 50%;
}
.dot.on { background: var(--ink); border-color: var(--ink); }
.dot.off { background: #000; border-color: var(--bad); }

.notice {
  margin: 16px 13px;
  padding: 14px 15px;
  border: 1px solid var(--bad);
  color: var(--bad);
  font-size: 17px;
}

.list { list-style: none; margin: 0; padding: 0 0 24px; }

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  min-height: 70px; /* generous one-handed thumb target */
  border-bottom: 1px solid #222;
  cursor: pointer;
}

.row:hover { background: var(--hover); }
.row:active { background: var(--press); }

.row .glyph {
  flex: none;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.row .glyph .ico { width: 27px; height: 27px; }
.row:not(.isDir) .glyph { color: var(--dim); }

.row .body { flex: 1; min-width: 0; }

.row .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.row .meta {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: var(--dimmer);
}

.row .dl {
  flex: none;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--dim);
  text-decoration: none;
}

.row .dl:hover { background: var(--hover); }
.row .dl:active { background: var(--press); }

.empty { padding: 48px; text-align: center; font-size: 18px; color: var(--dimmer); }

.footSig {
  position: relative;
  width: 104px;
  margin: 10px auto 34px;
  padding: 6px 0;
  text-align: center;
  font-size: 17px;
  color: var(--dim);
}

/* --- viewer --------------------------------------------------------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #000;
}

.viewerBar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(env(safe-area-inset-top) + 9px) 11px 9px;
  border-bottom: 1px solid var(--dim);
}

.viewerBar span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.viewerBody {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 12px;
}

.viewerStage {
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
}

.viewerStage video,
.viewerStage img {
  max-width: 100%;
  max-height: 100%;
}

/* Their site pixelates everything; photos get the same treatment, but video is
   left smooth because scaling artefacts on real footage read as a broken player
   rather than as a style. */
.viewerStage img { image-rendering: pixelated; }

.viewerStage .fallback {
  padding: 26px;
  text-align: center;
  font-size: 17px;
  color: var(--dim);
}

/* --- real desktop ---------------------------------------------------------
   Only kicks in well above any phone width, including the ~980px a browser
   uses in "desktop site" mode, so a phone never accidentally gets these. */

@media (min-width: 1100px) {
  html, body { font-size: 17px; }

  .bar, .list, .notice, .empty {
    max-width: 900px;
    margin-inline: auto;
  }

  .bar { border-inline: 1px solid #222; }
  .row { min-height: 60px; }
  .row .name { font-size: 18px; }
  .chip, .row .dl { width: 42px; height: 42px; }
}
