@font-face {
  font-family: "Fixedsys Excelsior";
  src: url("fonts/fixedsys-excelsior.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #020b06;
  --surface: rgba(69, 232, 138, 0.035);
  --surface-hover: rgba(69, 232, 138, 0.1);
  --phosphor-dim: #3d9c68;
  --phosphor: #45e88a;
  --phosphor-bright: #baffd9;
  --display: "Fixedsys Excelsior", "Courier New", monospace;
  --body: "Fixedsys Excelsior", "Courier New", monospace;
  --content: 72rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 0%, rgba(17, 86, 42, 0.22), transparent 36rem),
    linear-gradient(180deg, #041009, var(--background));
  color: var(--phosphor);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 0 0 2px currentColor, 0 0 9px rgba(69, 232, 138, 0.22);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 20;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0,
    rgba(0, 0, 0, 0.2) 1px,
    transparent 2px,
    transparent 4px
  );
}

body::after {
  z-index: 21;
  box-shadow: inset 0 0 150px 35px rgba(0, 0, 0, 0.64);
}

.site-header,
main {
  width: min(100% - 2.5rem, var(--content));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding-block: clamp(2.5rem, 8vw, 5rem) 2rem;
  text-align: center;
}

.fiec-logo {
  display: block;
  width: clamp(6.5rem, 18vw, 10rem);
  aspect-ratio: 85 / 29;
  background: url("images/fiec-logo.png") center / contain no-repeat;
  filter:
    brightness(0)
    saturate(100%)
    invert(91%)
    sepia(23%)
    saturate(758%)
    hue-rotate(83deg)
    brightness(108%)
    contrast(104%)
    drop-shadow(0 0 9px rgba(69, 232, 138, 0.78));
}

.site-header h1 {
  margin: 0;
  color: var(--phosphor-bright);
  font-family: var(--display);
  font-size: 0;
  font-weight: 400;
  line-height: 1;
}

.site-header h1 .cursor {
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 0.6;
  transform: translateY(0.08em);
}

.cursor {
  display: inline-block;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--phosphor-dim);
  font-size: 1.2rem;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--phosphor-bright);
  outline: none;
}

.breadcrumb span[aria-current="page"] {
  color: var(--phosphor-bright);
}

.terminal-line {
  margin: 0 0 1rem;
  color: var(--phosphor-dim);
  font-size: 1.2rem;
}

.terminal-line span {
  color: var(--phosphor-bright);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.folder-card {
  display: flex;
  min-height: 9rem;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem;
  border: 1px solid var(--phosphor-dim);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--phosphor);
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.folder-card:hover,
.folder-card:focus-visible {
  border-color: var(--phosphor);
  background: var(--surface-hover);
  outline: none;
  transform: translateY(-2px);
}

.folder-label {
  color: var(--phosphor-bright);
  font-size: 1rem;
  font-weight: 400;
}

.folder-card--large .folder-label {
  font-size: clamp(1.25rem, 3vw, 1.45rem);
  line-height: 1.25;
}

.folder-meta {
  color: var(--phosphor-dim);
  font-size: 0.85rem;
}

.folder-action {
  margin-top: auto;
  color: var(--phosphor-dim);
  font-size: 1.1rem;
}

.empty-state {
  padding: 1.5rem;
  border: 1px dashed var(--phosphor-dim);
  border-radius: 0.65rem;
  color: var(--phosphor-dim);
}

.auth-layout {
  width: min(100% - 2.5rem, 34rem);
}

.panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--phosphor-dim);
  border-radius: 0.65rem;
  background: var(--surface);
}

.panel h2 {
  margin: 0 0 1.25rem;
  color: var(--phosphor-bright);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: 400;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-stack--compact {
  margin-top: 0.75rem;
  gap: 0.65rem;
}

.form-stack label {
  display: grid;
  gap: 0.35rem;
  color: var(--phosphor-dim);
  font-size: 1rem;
}

.form-stack small {
  color: var(--phosphor-dim);
  font-size: 0.8rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--phosphor-dim);
  border-radius: 0.35rem;
  background: #020b06;
  color: var(--phosphor-bright);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--phosphor-bright);
  box-shadow: 0 0 0 2px rgba(69, 232, 138, 0.16);
}

.button,
.text-button {
  border: 0;
  color: var(--phosphor);
  cursor: pointer;
}

.button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--phosphor-dim);
  border-radius: 0.35rem;
  background: var(--surface-hover);
  text-align: left;
}

.button:hover,
.button:focus-visible {
  border-color: var(--phosphor-bright);
  color: var(--phosphor-bright);
  outline: none;
}

.button--small {
  min-height: 2.2rem;
  padding: 0.4rem 0.65rem;
}

.message {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--phosphor);
  background: var(--surface-hover);
  color: var(--phosphor-bright);
}

.message--error {
  border-color: #ff6b6b;
  color: #ffc7c7;
}

.admin-topbar,
.admin-topbar__actions,
.admin-card__actions {
  display: flex;
  align-items: center;
}

.admin-topbar {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--phosphor-dim);
}

.admin-topbar__actions,
.admin-card__actions {
  gap: 0.8rem;
}

.admin-topbar form,
.admin-card__actions form {
  margin: 0;
}

.text-link,
.text-button,
.admin-card__link {
  color: var(--phosphor-dim);
  text-decoration: none;
}

.text-button {
  padding: 0;
  background: transparent;
}

.text-link:hover,
.text-link:focus-visible,
.text-button:hover,
.text-button:focus-visible {
  color: var(--phosphor-bright);
  outline: none;
}

.text-button--danger {
  color: #e98d8d;
}

.admin-card {
  min-height: 13rem;
}

.admin-card__link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-card__actions {
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(61, 156, 104, 0.35);
}

.admin-card summary {
  color: var(--phosphor-dim);
  cursor: pointer;
}

.admin-card details[open] {
  width: 100%;
}

.admin-create {
  max-width: 34rem;
  margin-block: 2rem 4rem;
}

@media (max-width: 36rem) {
  .site-header,
  main {
    width: min(100% - 1.5rem, var(--content));
  }

  .site-header {
    padding-top: 2rem;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .folder-card {
    transition: none;
  }

  .folder-card:hover,
  .folder-card:focus-visible {
    transform: none;
  }
}
