@font-face {
  font-family: "Inter";
  src: url("/assets/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #F5F5F7;
  --deep: #E8E8ED;
  --card: #FFFFFF;
  --line: #D2D2D7;
  --mute: #6E6E73;
  --ink: #1D1D1F;
  --accent: #2F6BFF;
  --accent-press: #1F55E0;
  --red: #E5322D;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px -8px rgba(0,0,0,.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input { font: inherit; letter-spacing: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 56px; padding: 0 32px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 18px; letter-spacing: -0.015em;
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 24px -10px rgba(47,107,255,.7);
  transition: transform .2s var(--ease), background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: scale(.97); }
.btn-big { min-height: 64px; padding: 0 40px; font-size: 20px; }
.btn-sm { min-height: 48px; padding: 0 22px; font-size: 16px; box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- 1. The mess ---------- */
.mess {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}
.js .mess { position: fixed; inset: 0; z-index: 10; }
.js body:not(.is-mess):not(.is-leaving) .mess { display: none; }
html:not(.js) .mess { display: none; }

.pile { position: absolute; inset: 0; }

.card {
  position: absolute;
  transform: translate(-50%, -50%) translate(var(--o, 0px), var(--o, 0px)) rotate(var(--r, 0deg));
  will-change: transform, opacity;
}
.card-in {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: pop .5s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* the calm-down veil and the centred pop-up */
.veil {
  position: absolute; inset: 0; z-index: 20;
  background: radial-gradient(circle at 50% 50%, rgba(245,245,247,.85) 0, rgba(245,245,247,.35) 60%, rgba(245,245,247,.2) 100%);
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
.is-ready .veil { opacity: 1; }
.is-leaving .veil { opacity: 0; transition-duration: .3s; }

.cta {
  position: absolute; left: 50%; top: 50%; z-index: 30;
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 14px;
  padding: 26px 28px 28px;
  width: max-content; max-width: calc(100vw - 40px);
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 30px 70px -20px rgba(0,0,0,.35);
  visibility: hidden; opacity: 0;
}
.cta .eyebrow { margin: 0; color: var(--mute); font-size: 16px; font-weight: 500; }
.is-ready .cta { visibility: visible; animation: popup .6s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes popup {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.is-ready #check { animation: breathe 2.8s ease-in-out .8s infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 24px -10px rgba(47,107,255,.7), 0 0 0 0 rgba(47,107,255,0); }
  50%      { box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 24px -10px rgba(47,107,255,.7), 0 0 0 12px rgba(47,107,255,.14); }
}
.is-leaving .cta { visibility: visible; animation: none; opacity: 0; transform: translate(-50%, -50%) scale(.9); transition: opacity .25s, transform .25s; }

/* generic app alert */
.dialog { padding: 16px 16px 12px; display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; }
.dialog .warn { width: 32px; height: 29px; margin-top: 2px; }
.dialog p { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 500; }
.btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.b {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 14px;
  border-radius: 7px; background: var(--deep); font-size: 13px; font-weight: 500;
  user-select: none;
}
.b-main { background: var(--accent); color: #fff; cursor: pointer; }

/* video frame offline */
.offline {
  aspect-ratio: 16 / 9;
  background: #0B0B0C;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.offline-word { color: var(--red); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.tc { position: absolute; left: 12px; bottom: 9px; font: 500 11px/1 var(--mono); color: #8E8E93; letter-spacing: 0; }

/* file info */
.info { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.info b { display: block; font-size: 14px; font-weight: 600; }
.info span:not(.ic) { display: block; font: 600 22px/1.2 var(--font); letter-spacing: -0.02em; color: var(--red); }

/* system notification */
.notif {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 18px;
}
.notif .disk { width: 36px; height: 36px; flex: none; }
.notif b { display: block; font-size: 14px; font-weight: 600; }
.notif span { display: block; font-size: 13px; color: var(--mute); }

/* export bar */
.export { padding: 14px 16px 12px; }
.ex-top { display: flex; justify-content: space-between; font-size: 14px; }
.ex-top b { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.track { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--deep); overflow: hidden; }
.track span { display: block; width: 97%; height: 100%; border-radius: 3px; background: var(--accent); }
.export p { margin: 8px 0 0; font-size: 13px; color: var(--red); font-weight: 500; }

/* stray files lying around */
.is-file .card-in {
  background: none; box-shadow: none;
  display: grid; justify-items: center; gap: 5px;
  width: 92px; text-align: center;
}
.is-file em {
  font-style: normal; font-size: 11px; line-height: 1.25; font-weight: 500;
  padding: 2px 6px; border-radius: 5px; background: rgba(245,245,247,.85);
  overflow-wrap: anywhere;
}
.is-file small { font-size: 10px; color: var(--mute); }
.ic {
  display: grid; place-items: center;
  width: 44px; height: 54px; border-radius: 6px;
  font: 700 10px/1 var(--font); letter-spacing: .02em; color: #fff;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.35);
}
.ic.psd { background: #3D7BD9; }
.ic.ai  { background: #E58A2B; }
.ic.id  { background: #D6457B; }
.ic.mp4 { background: #7A5AD8; }
.ic.mov { background: #5A4FCF; }
.ic.jpg { background: #3E9B6B; }
.ic.dir { background: #8FB3F0; width: 54px; height: 44px; border-radius: 6px 6px 8px 8px; }

/* ---------- The Trash corner ---------- */
.trash {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 12px; max-width: min(300px, calc(100vw - 32px));
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 18px 40px -14px rgba(0,0,0,.3);
  opacity: 0; transform: translateY(16px) scale(.96);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.trash.on { opacity: 1; transform: none; }
.bin { width: 40px; height: 46px; flex: none; overflow: visible; }
.bin .lid { transform-origin: 40px 10px; transition: transform .25s var(--ease); }
.trash.gulp .lid { transform: rotate(14deg) translateY(-2px); }
.bin-fill { transition: transform .5s var(--ease); }
.trash-txt b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.trash-txt > span { display: block; font-size: 12px; line-height: 1.35; color: var(--mute); }

/* ---------- 2. The calm ---------- */
.calm {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(40px + env(safe-area-inset-top)) 22px 40px;
}
.js body.is-mess .calm { display: none; }

.wordmark { margin: 0 0 28px; font-weight: 650; font-size: 19px; letter-spacing: -0.03em; }
.calm h1 {
  margin: 0;
  font-weight: 650;
  font-size: clamp(44px, 12.5vw, 92px);
  line-height: 1.0;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.calm h1:focus { outline: none; }
.lede { margin: 14px 0 0; color: var(--mute); font-size: 19px; font-weight: 500; }

.ledger {
  list-style: none; margin: 36px 0 0; padding: 0;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.ledger li {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 16px;
  border-top: 1px solid #E8E8ED;
  font-size: 15px;
}
.ledger li:first-child { border-top: 0; }
.ledger b { font-weight: 550; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger span:last-child { color: var(--mute); text-align: right; white-space: nowrap; }
.tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 3 6-6.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
}

.join { margin-top: 56px; }
.join h2 { margin: 0 0 14px; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.field {
  display: flex; gap: 8px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,107,255,.15); }
.field input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  padding: 0 14px; font-size: 17px; outline: none;
}
.field input::placeholder { color: #8E8E93; }
.field .btn:focus-visible { outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { margin: 10px 4px 0; font-size: 14px; color: var(--mute); min-height: 1.4em; }
.note.is-error { color: #C4221D; }
.done { margin: 0; padding: 18px 20px; background: var(--card); border-radius: 16px; display: flex; gap: 12px; align-items: center; font-weight: 550; }

.social { display: flex; gap: 10px; margin-top: 40px; flex-wrap: wrap; }
.social a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 550;
  transition: background-color .2s, border-color .2s;
}
.social a:hover { background: var(--card); border-color: #B8B8BF; }
.social svg { width: 20px; height: 20px; }

.again {
  appearance: none; background: none; border: 0; padding: 12px 0; margin-top: 28px;
  color: var(--mute); font-size: 15px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line);
}
.again:hover { color: var(--ink); }
html:not(.js) .again { display: none; }

.foot {
  max-width: 600px; margin: 0 auto;
  padding: 24px 22px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between;
  color: var(--mute); font-size: 13px;
  border-top: 1px solid var(--line);
}
.js body.is-mess .foot { display: none; }

/* entrance of the calm side (JS adds .rise, then .in) */
.rise { opacity: 0; transform: translateY(10px); }
.rise.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--t, 0ms); }
.ledger li.rise { transform: none; }
.ledger li.rise.in { transition: opacity .35s ease; }

@media (min-width: 760px) {
  .calm { padding-top: 72px; }
  .ledger li { min-height: 56px; font-size: 16px; }
  .trash { right: 28px; bottom: 28px; }
  .cta { padding: 34px 40px 36px; gap: 18px; border-radius: 32px; }
  .cta .eyebrow { font-size: 19px; }
  .btn-big { min-height: 72px; padding: 0 48px; font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .is-ready #check { animation: none; }
}

@media (max-width: 374px) {
  .ledger li { font-size: 13px; gap: 8px; padding: 0 12px; }
  .tick { width: 18px; height: 18px; background-size: 18px; }
}
