:root {
  color-scheme: light;
  --bg: #f6efe4;
  --bg-strong: #f0e2c7;
  --surface: rgba(255, 248, 237, 0.9);
  --surface-strong: #fffaf2;
  --stroke: rgba(45, 37, 23, 0.12);
  --text: #20180e;
  --muted: #6d5b45;
  --accent: #c45a28;
  --accent-dark: #8a3510;
  --accent-soft: rgba(196, 90, 40, 0.14);
  --success: #176b45;
  --danger: #9e2a1f;
  --shadow: 0 28px 60px rgba(68, 45, 19, 0.18);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    radial-gradient(circle at right, rgba(225, 163, 86, 0.22), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, #f2dcc1 45%, #ecd3af 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(32, 24, 14, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 24, 14, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
  pointer-events: none;
}

a {
  color: inherit;
}

.backdrop {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.5;
  pointer-events: none;
}

.backdrop-left {
  top: -8rem;
  left: -6rem;
  background: rgba(235, 108, 52, 0.25);
}

.backdrop-right {
  right: -8rem;
  bottom: 8rem;
  background: rgba(94, 145, 109, 0.22);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand-mark,
.chip-link,
.site-nav a {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 37, 23, 0.1);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav a {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: var(--muted);
}

.chip-link {
  background: rgba(32, 24, 14, 0.92);
  color: #fffdf8;
}

.card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -22% auto;
  width: min(26rem, 46vw);
  aspect-ratio: 1;
  border-radius: 32% 68% 52% 48% / 36% 40% 60% 64%;
  background: linear-gradient(135deg, rgba(196, 90, 40, 0.18), rgba(255, 255, 255, 0.2));
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 0.95;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.lead,
.hint,
.message,
.algorithm-list,
.field span,
.hero-stats span,
.breakdown-row dt,
.info-grid dt,
.meta-line,
.security-points span {
  color: var(--muted);
}

.lead {
  max-width: 62ch;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.lead.compact {
  margin-top: 0;
}

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

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

.hero-stats article,
.panel,
.secure-layout section {
  position: relative;
  overflow: hidden;
}

.hero-stats article {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(45, 37, 23, 0.08);
}

.hero-stats span,
.hero-stats strong {
  display: block;
}

.hero-stats strong {
  margin-top: 0.35rem;
  font-size: 1rem;
}

.workspace {
  margin-top: 1.25rem;
}

.workspace-auth {
  align-items: stretch;
}

.panel,
.secure-layout section {
  padding: 1.5rem;
}

.panel-header,
.panel-topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

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

.field {
  display: grid;
  gap: 0.55rem;
}

.field span {
  font-size: 0.95rem;
  font-weight: 500;
}

input {
  width: 100%;
  border: 1px solid rgba(45, 37, 23, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1rem;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(255, 252, 246, 0.95);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(196, 90, 40, 0.7);
  box-shadow: 0 0 0 4px rgba(196, 90, 40, 0.12);
  transform: translateY(-1px);
}

.action-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fffaf4;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 14px 24px rgba(138, 53, 16, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.action-button.secondary,
.action-button.alt {
  background: linear-gradient(135deg, #2f6f61, #1c4d43);
  box-shadow: 0 14px 24px rgba(28, 77, 67, 0.2);
}

.action-button.ghost {
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(45, 37, 23, 0.1);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.action-button:hover,
.action-button:focus-visible,
.brand-mark:hover,
.chip-link:hover,
.site-nav a:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.message {
  min-height: 1.3rem;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.result,
.detail-card {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid rgba(45, 37, 23, 0.08);
}

.result-label,
.detail-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.result-value,
.detail-value {
  margin: 0.55rem 0 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.breakdown,
.info-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.breakdown-row,
.info-grid div {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(45, 37, 23, 0.08);
}

.breakdown-row dt,
.info-grid dt {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.breakdown-row dd,
.info-grid dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  word-break: break-word;
}

.algorithm-list {
  display: grid;
  gap: 0.95rem;
  margin: 0;
  padding-left: 1.35rem;
  line-height: 1.6;
}

.security-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.security-points span {
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(45, 37, 23, 0.08);
  font-size: 0.92rem;
}

.auth-card-actions {
  margin-top: 1.25rem;
}

.link-button {
  width: fit-content;
}

.secure-layout {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.secure-layout-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.25rem;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.muted-card {
  background: rgba(255, 255, 255, 0.46);
}

.meta-line {
  margin: 0.35rem 0 0;
  font-size: 0.94rem;
}

.dataset-summary .detail-value.small {
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(45, 37, 23, 0.16);
  background: rgba(255, 255, 255, 0.36);
  color: var(--muted);
  text-align: center;
}

.summary-bar {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 42rem;
}

.results-table th,
.results-table td {
  padding: 0.95rem 0.9rem;
  border-bottom: 1px solid rgba(45, 37, 23, 0.08);
  text-align: left;
}

.results-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.results-table td {
  background: rgba(255, 255, 255, 0.28);
}

.mono-cell {
  font-family: "Space Grotesk", monospace;
  letter-spacing: 0.03em;
}

mark {
  padding: 0.05rem 0.2rem;
  border-radius: 0.35rem;
  color: var(--text);
  background: rgba(196, 90, 40, 0.2);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-up 700ms ease forwards;
}

.delay-1 {
  animation-delay: 120ms;
}

.delay-2 {
  animation-delay: 220ms;
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero-stats,
  .workspace,
  .secure-layout-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header,
  .panel-header,
  .panel-topbar,
  .site-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    gap: 0.5rem;
  }

  .button-row {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .layout {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .hero,
  .panel,
  .secure-layout section {
    padding: 1.2rem;
  }

  h1 {
    font-size: clamp(2.3rem, 15vw, 4rem);
  }

  .result-value,
  .detail-value {
    font-size: 1.3rem;
  }

  .link-button,
  .action-button {
    width: 100%;
  }
}

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