:root {
  --bg: #f4efe5;
  --ink: #1f1f1a;
  --muted: #635f56;
  --panel: rgba(255, 251, 245, 0.88);
  --line: rgba(31, 31, 26, 0.08);
  --accent: #b14d20;
  --accent-deep: #762d0f;
  --shadow: 0 22px 80px rgba(54, 39, 25, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(229, 143, 82, 0.3), transparent 34%),
    radial-gradient(circle at bottom right, rgba(78, 123, 145, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f2e9 0%, #ede4d6 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 31, 26, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 31, 26, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 75%);
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-a {
  width: 22rem;
  height: 22rem;
  background: rgba(227, 131, 72, 0.22);
  top: 5rem;
  right: -4rem;
}

.orb-b {
  width: 18rem;
  height: 18rem;
  background: rgba(58, 111, 148, 0.18);
  bottom: 2rem;
  left: -2rem;
  animation-delay: -5s;
}

.shell {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  display: grid;
  gap: 1.25rem;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise 0.65s ease both;
}

.hero {
  padding: 2rem;
  overflow: hidden;
}

.hero h1,
.card h2,
.session-panel h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: 9ch;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
}

.lede {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent-deep);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.hero-metrics div,
.session-banner {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(31, 31, 26, 0.08);
}

.metric-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card,
.session-panel {
  padding: 1.5rem;
}

.card-head,
.session-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.card h2,
.session-panel h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.stack {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.field {
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(31, 31, 26, 0.12);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid rgba(177, 77, 32, 0.22);
  border-color: rgba(177, 77, 32, 0.45);
}

.button,
.delete-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 3.5rem;
  padding: 0 1.15rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.button {
  background: linear-gradient(135deg, var(--accent) 0%, #da8d60 100%);
  color: #fffaf4;
}

.button-ghost,
.delete-button {
  background: #fffaf2;
  color: var(--accent-deep);
  border: 1px solid rgba(177, 77, 32, 0.18);
}

.button:hover,
.button-ghost:hover,
.delete-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.button-ghost:disabled,
.delete-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--muted);
}

.status[data-tone="success"] {
  color: #2c6a3e;
}

.status[data-tone="error"] {
  color: #8d2b2b;
}

.session-head {
  margin-bottom: 1.25rem;
}

.session-state {
  display: grid;
  gap: 1rem;
}

.session-banner p,
.session-banner strong,
.passkey-item p,
.passkey-item strong {
  margin: 0;
}

.passkey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.95rem;
}

.passkey-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.passkey-item p {
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.4;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.session-empty {
  margin: 0;
  padding: 1rem 0;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(1.4rem, -1.6rem, 0) scale(1.06);
  }
}

@media (max-width: 900px) {
  .grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .passkey-item {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 1rem;
  }

  .hero,
  .card,
  .session-panel {
    padding: 1.2rem;
  }

  .hero h1 {
    font-size: 3.2rem;
  }
}
