:root {
  color-scheme: dark;
  --soot: #12110f;
  --graphite: #1c1b18;
  --ash: #a09c95;
  --line: rgba(216, 211, 202, 0.2);
  --line-strong: rgba(216, 211, 202, 0.52);
  --chalk: #d8d3ca;
}

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

html {
  min-height: 100%;
  background: #35332f;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--graphite);
  color: var(--ash);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body::before {
  background: url("/assets/concrete-shadow.png") 38% center / cover no-repeat;
  transform: scale(1.01);
}

body::after {
  background: rgba(18, 17, 15, 0.09);
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

.landing,
.workspace,
.app-shell,
.message {
  position: relative;
  z-index: 1;
}

.landing {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(3rem, 12vh, 7.5rem) 1.5rem 2.5rem;
  place-items: start center;
}

.login {
  width: clamp(16.5rem, 29vw, 23rem);
  animation: settle 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand,
.topbar__brand {
  color: var(--soot);
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  line-height: 1;
  text-align: center;
}

.login__fields {
  margin-top: clamp(2.75rem, 7.5vh, 5rem);
}

.field {
  display: block;
  border-bottom: 1px solid var(--line);
  transition: border-color 180ms ease;
}

.field + .field {
  margin-top: 1rem;
}

.field__label {
  display: block;
  color: var(--ash);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  min-height: 2rem;
  padding: 0.15rem 0 0.45rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--chalk);
  caret-color: var(--chalk);
  font-size: 0.82rem;
}

.field:focus-within {
  border-color: rgba(216, 211, 202, 0.65);
}

.login__error {
  min-height: 1rem;
  margin: 0.85rem 0 -0.4rem;
  color: #c4a69d;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.login__action {
  display: block;
  width: 3rem;
  min-height: 2.75rem;
  margin: 0.65rem auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ash);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  transition: color 180ms ease, transform 180ms ease;
}

.login__action:hover,
.login__action:focus-visible {
  color: var(--chalk);
  transform: translateX(0.18rem);
}

.login__action:focus-visible,
.text-action:focus-visible,
.topbar__brand:focus-visible,
.tile:focus-visible,
.back-link:focus-visible,
.message a:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 0.28rem;
}

.workspace {
  width: min(72rem, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__brand {
  font-size: 1rem;
}

.topbar form {
  margin: 0;
}

.text-action {
  padding: 0.5rem 0;
  border: 0;
  background: transparent;
  color: var(--ash);
  cursor: pointer;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.text-action:hover {
  color: var(--chalk);
}

.dashboard {
  margin-top: clamp(5rem, 17vh, 10rem);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dashboard h1,
.app-shell h1 {
  margin: 0;
  color: var(--soot);
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dashboard h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2.25rem, 6vh, 4.5rem);
}

.tile {
  position: relative;
  display: grid;
  min-height: clamp(10rem, 17vw, 12rem);
  padding: 1.4rem 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(216, 211, 202, 0.2);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, rgba(216, 211, 202, 0.1), rgba(28, 27, 24, 0.28));
  box-shadow: 0 0.7rem 2.2rem rgba(18, 17, 15, 0.09), inset 0 1px rgba(255, 255, 255, 0.035);
  color: var(--ash);
  text-decoration: none;
  backdrop-filter: blur(5px);
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
  -webkit-backdrop-filter: blur(5px);
}

.tile:hover,
.tile:focus-visible {
  border-color: rgba(216, 211, 202, 0.38);
  box-shadow: 0 1rem 2.8rem rgba(18, 17, 15, 0.14), inset 0 1px rgba(255, 255, 255, 0.05);
  color: var(--chalk);
  transform: translateY(-0.18rem);
}

.tile__number {
  align-self: start;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.tile__title {
  align-self: end;
  color: var(--soot);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tile__arrow {
  position: absolute;
  right: 1.4rem;
  bottom: 1.25rem;
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(216, 211, 202, 0.2);
  border-radius: 50%;
  background: rgba(18, 17, 15, 0.07);
  font-size: 1rem;
  place-items: center;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.tile:hover .tile__arrow,
.tile:focus-visible .tile__arrow {
  border-color: rgba(216, 211, 202, 0.4);
  background: rgba(216, 211, 202, 0.08);
  transform: translateX(0.12rem);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem clamp(1.25rem, 5vw, 4rem);
}

.back-link {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.app-shell h1 {
  margin-top: clamp(5rem, 20vh, 12rem);
  text-align: center;
}

.message {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  place-content: center;
  text-align: center;
}

.message p {
  margin: 0;
}

.message a {
  margin-top: 1rem;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  body::before {
    background-position: 32% center;
  }

  .landing {
    padding-top: clamp(3.5rem, 13vh, 6.5rem);
  }

  .login {
    width: min(74vw, 20rem);
  }

  .workspace {
    padding-top: 1.4rem;
  }

  .dashboard {
    margin-top: 5rem;
  }

  .tiles {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .tile {
    min-height: 8.75rem;
    border-radius: 0.95rem;
  }
}

@media (max-height: 460px) {
  .landing {
    padding: 1.75rem 1rem 0;
  }

  .login__fields {
    margin-top: 2rem;
  }

  .field + .field {
    margin-top: 0.5rem;
  }

  .field input {
    min-height: 1.75rem;
    padding-bottom: 0.3rem;
  }

  .login__action {
    min-height: 2.25rem;
    margin-top: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Demo-Share: Kachel-Aktion, Verwaltung und Code-Abfrage */
.tile-wrap {
  display: grid;
  gap: 0.45rem;
}

.tile-share {
  justify-self: start;
  padding: 0.15rem 0;
  color: var(--ash);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.tile-share:hover,
.tile-share:focus-visible {
  color: var(--chalk);
}

.share-admin {
  max-width: 34rem;
  margin-top: clamp(3rem, 10vh, 6rem);
}

.share-admin .back-link {
  display: inline-block;
  margin-bottom: 1.6rem;
}

.share-admin h1 {
  margin-top: 0.6rem;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

.share-admin__hint {
  margin: 0.9rem 0 1.6rem;
  font-size: 0.72rem;
  line-height: 1.6;
}

.share-create {
  margin-bottom: 2.2rem;
}

.share-create__submit {
  margin-top: 0.7rem;
  padding: 0.4rem 0;
}

.share-list {
  display: grid;
  gap: 1rem;
}

.share-list__empty {
  margin: 0;
  font-size: 0.7rem;
}

.share-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(18, 17, 15, 0.16);
}

.share-item__url {
  color: var(--chalk);
  font-size: 0.74rem;
  word-break: break-all;
}

.share-item__meta {
  margin-top: 0.35rem;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.share-item__meta strong {
  color: var(--chalk);
  letter-spacing: 0.12em;
}

.share-item form {
  margin: 0.4rem 0 0;
}

.share-item__delete {
  padding: 0.2rem 0;
  font-size: 0.62rem;
}

.share-entry__eyebrow {
  margin-bottom: 0.8rem;
  text-align: center;
}

.share-entry__hint {
  margin: 1.1rem 0 0;
  font-size: 0.68rem;
  line-height: 1.6;
  text-align: center;
}

.share-entry input {
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}
