/* ============================================================
   HTTP Compression Testseite – styles.css
   ============================================================ */

/* --- Variables & Reset --- */
:root {
  --bg:         #0d0d0d;
  --surface:    #161616;
  --surface2:   #1f1f1f;
  --border:     #2a2a2a;
  --text:       #e8e8e0;
  --text-muted: #7a7a72;
  --accent:     #e8ff47;
  --accent2:    #47c8ff;
  --accent3:    #ff6b47;
  --accent4:    #b47fff;
  --radius:     6px;
  --font-head:  'Syne', sans-serif;
  --font-mono:  'Space Mono', monospace;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg:         #f4f4ee;
  --surface:    #ffffff;
  --surface2:   #ebebeb;
  --border:     #d0d0c8;
  --text:       #1a1a1a;
  --text-muted: #7a7a72;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo .accent { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav a:hover { color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* --- Hero --- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

.hero-badge {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  display: block;
}

.hero-sub {
  max-width: 600px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  min-width: 140px;
  background: var(--surface);
}

.stat-val {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-hint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 680px;
}

/* --- Section --- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
}

/* --- Cards --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--transition), border-color var(--transition);
}

.card:hover { transform: translateY(-3px); }

.card--gzip:hover  { border-color: var(--accent); }
.card--br:hover    { border-color: var(--accent2); }
.card--deflate:hover { border-color: var(--accent3); }
.card--zstd:hover  { border-color: var(--accent4); }

.card-tag {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.card h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-bar {
  background: var(--surface2);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.card--gzip  .card-bar span { background: var(--accent); }
.card--br    .card-bar span { background: var(--accent2); }
.card--deflate .card-bar span { background: var(--accent3); }
.card--zstd  .card-bar span { background: var(--accent4); }

.card-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card small { font-size: 0.72rem; color: var(--text-muted); }

/* --- Table --- */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody tr:hover { background: var(--surface); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge--yes  { background: rgba(232, 255, 71, 0.15); color: var(--accent); }
.badge--warn { background: rgba(255, 107, 71, 0.15); color: var(--accent3); }
.badge--info { background: rgba(71, 200, 255, 0.15); color: var(--accent2); }
.badge--no   { background: rgba(255, 80, 80, 0.12); color: #ff6060; }

/* --- Accordion --- */
.accordion { display: flex; flex-direction: column; gap: 0.5rem; }

.acc-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.acc-trigger {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 1rem 1.2rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--transition);
}

.acc-trigger:hover { background: var(--surface2); }

.acc-trigger[aria-expanded="true"] { color: var(--accent); }

.acc-icon {
  font-size: 1.2rem;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.acc-trigger[aria-expanded="true"] .acc-icon { transform: rotate(45deg); }

.acc-body {
  display: none;
  padding: 0 1.2rem 1.2rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.acc-body.open { display: block; }

.acc-body p { margin-bottom: 0.6rem; }
.acc-body ul { padding-left: 1.2rem; margin-bottom: 0.6rem; }
.acc-body li { margin-bottom: 0.2rem; }

/* --- Code blocks --- */
code {
  font-family: var(--font-mono);
  background: var(--surface2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.82em;
  color: var(--accent2);
}

pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-top: 0.6rem;
}

pre code {
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.82rem;
}

/* --- Interactive Grid --- */
.interactive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 700px) {
  .interactive-grid { grid-template-columns: 1fr; }
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.widget h3 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.widget p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.calc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.byte-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  transition: border-color var(--transition);
  max-width: 160px;
}

.byte-input:focus {
  outline: none;
  border-color: var(--accent);
}

.calc-unit { color: var(--text-muted); font-size: 0.85rem; }

.calc-result {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
  min-height: 2.2rem;
}

.headers-box {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  line-height: 1.8;
}

.hdr-line { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hdr-key  { color: var(--text-muted); }
.hdr-val  { color: var(--text); }
.hdr-highlight { color: var(--accent); font-weight: 700; }

.enc-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.enc-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.enc-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.enc-btn--clear:hover { border-color: var(--accent3); color: var(--accent3); }

/* --- Filler Section --- */
.filler-section { opacity: 0.5; }

.filler-grid {
  columns: 2;
  column-gap: 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.filler-grid p { margin-bottom: 1rem; break-inside: avoid; }

@media (max-width: 600px) {
  .filler-grid { columns: 1; }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-hint code { color: var(--accent2); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav { display: none; }
  .hero-title { font-size: clamp(2.5rem, 12vw, 5rem); }
  .hero-stats { flex-direction: column; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero, .section {
  animation: fadeIn 0.5s ease both;
}

.section:nth-of-type(2) { animation-delay: 0.05s; }
.section:nth-of-type(3) { animation-delay: 0.10s; }
.section:nth-of-type(4) { animation-delay: 0.15s; }
.section:nth-of-type(5) { animation-delay: 0.20s; }
.section:nth-of-type(6) { animation-delay: 0.25s; }

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
