@font-face {
  font-family: Geist;
  src: url("./assets/geist.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: Geist, "Segoe UI", system-ui, sans-serif;
  color: #1c1d1a;
  background: #f3f2ed;
  font-synthesis: none;
  --ink: #1c1d1a;
  --muted: #5f605a;
  --rule: #d7d6d0;
  --accent: #ac143a;
  --accent-hover: #941131;
  --panel: #1c1e1c;
  --panel-ink: #f4f3ed;
  --panel-muted: #bac0b9;
  --panel-rule: #3f4440;
  --easing: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { opacity: .5; cursor: default; }
h1, h2, h3, p { margin: 0; }

.shell {
  width: min(73rem, calc(100% - 4.5rem));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4.6vh, 3.75rem) 2rem;
}
.brand {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: clamp(14.5rem, 37vh, 25rem);
  padding: 1.5rem 0 2.35rem;
  overflow: hidden;
  text-align: center;
  border-block: 1px solid var(--rule);
}
.brand::before, .brand::after, .brand-grid {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.brand::before {
  background:
    radial-gradient(ellipse at 20% 0%, #e7c6c7 0%, transparent 57%),
    radial-gradient(ellipse at 88% 94%, #dfe0d1 0%, transparent 51%);
  opacity: .7;
  animation: field-in .9s var(--easing) both;
}
.brand::after {
  inset: 0 1px;
  background:
    repeating-linear-gradient(90deg, #33392d48 0 1px, transparent 1px 8px) left 10px top 11px / 73px 5px no-repeat,
    repeating-linear-gradient(90deg, #33392d48 0 1px, transparent 1px 8px) right 10px bottom 11px / 73px 5px no-repeat,
    linear-gradient(90deg, transparent calc(50% - .5px), #58594b33 calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)) top center / 100% 12px no-repeat;
}
.brand-grid {
  background-image:
    radial-gradient(circle, #44463843 1px, transparent 1.4px),
    linear-gradient(90deg, #44463813 1px, transparent 1px),
    linear-gradient(#44463813 1px, transparent 1px);
  background-size: 16px 16px, 112px 112px, 112px 112px;
  background-position: center;
  mask-image: linear-gradient(90deg, #000b, transparent 37% 63%, #000b);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: clamp(4.25rem, 8.5vw, 6.15rem);
  height: clamp(4.6rem, 8.7vw, 6.45rem);
  margin-bottom: clamp(.5rem, 1.8vh, .9rem);
  animation: logo-in .79s var(--easing) both;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.title-mask { max-width: 100%; overflow: hidden; padding: .19em .1em .24em; }
h1 {
  color: var(--ink);
  font-size: clamp(2.55rem, 8.2vw, 6.65rem);
  font-weight: 680;
  line-height: .99;
  letter-spacing: -.069em;
  word-spacing: .045em;
  overflow-wrap: normal;
  text-wrap: balance;
  animation: title-in .82s .055s var(--easing) both;
}

.workspace {
  position: relative;
  overflow: hidden;
  color: var(--panel-ink);
  background: var(--panel);
  box-shadow: 0 16px 35px #24261f1f;
  border: 1px solid #343934;
  border-radius: .8rem;
  margin-top: clamp(1rem, 3.4vh, 2rem);
  animation: workspace-in .74s .13s var(--easing) both;
}
.workspace::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(#d7546e, #d7546e00 50%);
  pointer-events: none;
}
.toolbar {
  padding: .83rem 1rem;
  min-height: 4.7rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--panel-rule);
}
.search {
  display: flex;
  flex: 1 1 18rem;
  align-items: center;
  gap: .84rem;
  min-width: 0;
  padding-inline: .88rem .35rem;
  border-radius: .42rem;
  border: 1px solid #4d534e;
  background: #272b28;
  color: var(--panel-muted);
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.search:focus-within {
  background: #303431;
  border-color: #ca8d96;
  box-shadow: 0 0 0 2px #ca8d962b;
}
.search input {
  width: 100%;
  min-width: 0;
  min-height: 2.88rem;
  border: 0;
  padding: 0 .24rem 0 0;
  outline: none;
  color: var(--panel-ink);
  background: transparent;
  font-size: .96rem;
}
.search input::placeholder { color: #c1c3bc; opacity: 1; }
.search input:disabled { opacity: 1; }
.search input::-webkit-search-cancel-button { appearance: none; }
.icon-search {
  position: relative;
  flex: none;
  width: .8rem;
  height: .8rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.icon-search::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: calc(100% - 1px);
  width: .36rem;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}
.clear-search {
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  background: transparent;
  border: 0;
  border-radius: .42rem;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--panel-muted);
}
.clear-search:hover { background: #444944; color: white; }
.folder-pill {
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: min(40%, 16rem);
  min-width: 0;
  padding: .59rem .72rem;
  border: 1px solid #4d534e;
  border-radius: .42rem;
  color: var(--panel-muted);
  font-size: .82rem;
}
.folder-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-mini, .folder-shape {
  position: relative;
  display: block;
  flex: none;
  width: 1.08rem;
  height: .76rem;
  border: 1.45px solid currentColor;
  border-radius: .15rem;
}
.folder-mini::before, .folder-shape::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: -1.45px;
  width: .45rem;
  height: .24rem;
  border: 1.45px solid currentColor;
  border-bottom: 0;
  border-radius: .12rem .12rem 0 0;
}

.stage { min-height: 9.75rem; }
.stage[aria-busy="true"]::before {
  content: "";
  display: block;
  position: absolute;
  width: 23%;
  height: 2px;
  background: #e996a7;
  animation: scan 1.35s cubic-bezier(.4, 0, .58, 1) infinite alternate;
  pointer-events: none;
}
.empty {
  min-height: 10.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.85rem, 3vw, 1.55rem);
  padding: clamp(1.1rem, 3.1vw, 2rem);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: .45rem;
  background: #303332;
  border: 1px solid #55524f;
  color: #f1a8b5;
}
.folder-shape { width: 1.5rem; height: 1.04rem; transform: translateY(.13rem); }
.folder-shape::before { width: .61rem; height: .32rem; }
h2 {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 620;
  line-height: 1.11;
  letter-spacing: -.049em;
}
.empty p { color: var(--panel-muted); font-size: .93rem; line-height: 1.52; margin-top: .45rem; }
.state-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .48rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .62rem;
  min-height: 2.75rem;
  border-radius: .42rem;
  border: 1px solid transparent;
  padding: .6rem .86rem;
  font-size: .88rem;
  font-weight: 620;
  line-height: 1.25;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .2s var(--easing);
}
.button:active:not(:disabled), .icon-button:active { transform: scale(.97); }
.primary { color: #fff; background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary::after {
  content: "";
  width: .43rem;
  height: .43rem;
  border-top: 1.3px solid currentColor;
  border-right: 1.3px solid currentColor;
  transform: rotate(45deg);
  flex: none;
}
.secondary { color: #272824; border-color: #cac9c2; background: #f9f8f3; }
.secondary:hover:not(:disabled) { background: #eeede7; border-color: #aead9f; }
.subtle { background: transparent; color: #555650; }
.subtle:hover:not(:disabled) { background: #e9e8e1; color: var(--ink); }
.workspace .subtle { color: var(--panel-muted); border-color: var(--panel-rule); }
.workspace .subtle:hover:not(:disabled) { color: white; background: #333733; }
.workspace button:focus-visible { outline-color: #e996a7; }

.library {
  list-style: none;
  margin: 0;
  padding: .15rem 1.1rem;
  max-height: min(51vh, 39rem);
  overflow: auto;
  animation: workspace-in .35s var(--easing) both;
}
.library li {
  display: flex;
  align-items: center;
  min-height: 3.95rem;
  padding: .68rem .56rem;
  border-bottom: 1px solid var(--panel-rule);
  box-shadow: inset 0 0 transparent;
  font-weight: 540;
  line-height: 1.42;
  overflow-wrap: anywhere;
  transition: background .2s, padding .23s var(--easing), box-shadow .23s var(--easing);
}
.library li:last-child { border-bottom: 0; }
@media (hover: hover) {
  .library li:hover { padding-left: .8rem; background: #2b302c; box-shadow: inset 2px 0 #c36e7f; }
}
.feedback {
  padding: .75rem 1rem;
  color: var(--panel-muted);
  border-top: 1px solid var(--panel-rule);
  background: #242724;
  font-size: .82rem;
  line-height: 1.48;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: .85rem;
  color: var(--muted);
  animation: workspace-in .62s .22s var(--easing) both;
}
.local-note { display: flex; align-items: center; gap: .45rem; font-size: .79rem; }
.icon-lock {
  position: relative;
  width: .64rem;
  height: .48rem;
  border: 1.25px solid currentColor;
  border-radius: .1rem;
  margin-top: .26rem;
}
.icon-lock::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 1px;
  right: 1px;
  height: .23rem;
  border: 1.25px solid currentColor;
  border-bottom: 0;
  border-radius: .2rem .2rem 0 0;
}
.icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  flex: none;
  width: 2.65rem;
  height: 2.65rem;
  color: #3d403a;
  background: transparent;
  border: 1px solid #bebeb6;
  border-radius: .42rem;
  cursor: pointer;
  transition: background .18s, color .18s, transform .2s var(--easing);
}
.icon-button:hover { color: #fff; background: #292c27; }
.settings-button span { font: 1.25rem/1 "Segoe UI Symbol", system-ui, sans-serif; }
.settings-dialog {
  width: min(30rem, calc(100% - 1.8rem));
  padding: 0;
  color: var(--ink);
  background: #f5f4ed;
  border: 1px solid #cac9c0;
  border-radius: .82rem;
  box-shadow: 0 1.2rem 4rem #181a1640;
}
.settings-dialog[open] { animation: dialog-in .3s var(--easing) both; }
.settings-dialog[open]::backdrop { animation: fade-in .25s both; background: #191c195e; }
.settings-dialog.closing { animation: dialog-in .15s ease-in reverse both; }
.settings-dialog.closing::backdrop { animation: fade-in .15s ease-in reverse both; }
.dialog-inner { padding: 1.35rem; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.17rem; }
.close-button { width: 2.12rem; height: 2.12rem; font-size: 1.22rem; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.setting-copy { min-width: 0; }
.setting-copy h3 { font-size: .94rem; font-weight: 630; }
.setting-copy p { margin-top: .24rem; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.setting-row .button { flex-shrink: 0; }
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .44rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--rule);
}
.settings-note { margin-top: .65rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.no-script { margin-top: 1rem; color: var(--muted); }

@keyframes field-in { from { opacity: .28; transform: scale(1.045); } to { opacity: .7; transform: none; } }
@keyframes logo-in { from { opacity: 0; transform: translateY(.5rem) scale(.91); } to { opacity: 1; transform: none; } }
@keyframes title-in { from { opacity: 0; transform: translateY(75%); } to { opacity: 1; transform: none; } }
@keyframes workspace-in { from { opacity: 0; transform: translateY(.66rem); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(.6rem) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan { from { left: 2px; } to { left: 77%; } }

@media (max-width: 46rem) {
  .shell { width: calc(100% - 2rem); }
  .empty { grid-template-columns: auto minmax(0, 1fr); align-content: center; }
  .state-actions { grid-column: 2; }
}
@media (max-width: 31rem) {
  .shell { width: calc(100% - 1.55rem); padding-top: 1rem; }
  .brand { padding-block: 1.5rem 1rem; min-height: 13.1rem; }
  .toolbar { min-height: 4.35rem; flex-wrap: wrap; gap: .55rem; padding: .68rem; }
  .folder-pill { max-width: 100%; }
  .empty { gap: .72rem; padding: 1.05rem .93rem 1.2rem; }
  .empty-icon { width: 2.56rem; height: 2.56rem; }
  .folder-shape { width: 1.19rem; height: .85rem; }
  .empty p { font-size: .87rem; }
  .library { padding-inline: .65rem; }
  .library li { min-height: 3.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
