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

:root,
[data-theme="latte"] {
  --bg-base: #eff1f5;
  --bg-header: #e6e9ef;
  --bg-footer: #dce0e8;
  --bg-surface: #fff;
  --bg-soft: #ccd0da;
  --text-main: #4c4f69;
  --text-muted: #6c6f85;
  --text-subtle: #9ca0b0;
  --border: #ccd0da;
  --accent: #dd7878;
  --accent-2: #8839ef;
  --success: #40a02b;
  --copy-bg: rgb(221 120 120 / 12%);
  --copy-border: rgb(221 120 120 / 30%);
}

[data-theme="frappe"] {
  --bg-base: #303446;
  --bg-header: #414559;
  --bg-footer: #292c3c;
  --bg-surface: #3f4358;
  --bg-soft: #51576d;
  --text-main: #c6d0f5;
  --text-muted: #b5bfe2;
  --text-subtle: #a5adce;
  --border: #626880;
  --accent: #e78284;
  --accent-2: #ca9ee6;
  --success: #a6d189;
  --copy-bg: rgb(231 130 132 / 16%);
  --copy-border: rgb(231 130 132 / 38%);
}

[data-theme="macchiato"] {
  --bg-base: #24273a;
  --bg-header: #363a4f;
  --bg-footer: #1e2030;
  --bg-surface: #363a4f;
  --bg-soft: #494d64;
  --text-main: #cad3f5;
  --text-muted: #b8c0e0;
  --text-subtle: #a5adcb;
  --border: #5b6078;
  --accent: #ed8796;
  --accent-2: #c6a0f6;
  --success: #a6da95;
  --copy-bg: rgb(237 135 150 / 16%);
  --copy-border: rgb(237 135 150 / 36%);
}

[data-theme="mocha"] {
  --bg-base: #1e1e2e;
  --bg-header: #313244;
  --bg-footer: #181825;
  --bg-surface: #313244;
  --bg-soft: #45475a;
  --text-main: #cdd6f4;
  --text-muted: #bac2de;
  --text-subtle: #a6adc8;
  --border: #585b70;
  --accent: #f38ba8;
  --accent-2: #cba6f7;
  --success: #a6e3a1;
  --copy-bg: rgb(243 139 168 / 16%);
  --copy-border: rgb(243 139 168 / 38%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Nunito, sans-serif;
  background: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgb(220 138 120 / 20%) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgb(136 57 239 / 12%) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgb(234 118 203 / 8%) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.hero-header {
  text-align: center;
  margin-bottom: 2.5rem;
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 1rem 1.2rem;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.hero-logo {
  width: 64px;
  height: auto;
  border-radius: 12px;
}

.hero-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #dd7878, #ea76cb, #8839ef, #7287fd);
  background-size: 300% 300%;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.utility-bar {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.theme-select {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0.38rem 0.55rem;
}

.theme-select:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.6rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 12px rgb(0 0 0 / 5%);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:nth-child(1)::before {
  background: linear-gradient(90deg, #dd7878, #ea76cb);
}

.card:nth-child(2)::before {
  background: linear-gradient(90deg, #fe640b, #df8e1d);
}

.card:nth-child(3)::before {
  background: linear-gradient(90deg, #1e66f5, #209fb5);
}

.card:nth-child(4)::before {
  background: linear-gradient(90deg, #8839ef, #7287fd);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgb(0 0 0 / 9%);
}

.card:hover::before {
  opacity: 1;
}

.icon-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.card:nth-child(1) .icon-ring {
  background: rgb(221 120 120 / 12%);
  color: #dd7878;
}

.card:nth-child(2) .icon-ring {
  background: rgb(254 100 11 / 12%);
  color: #fe640b;
}

.card:nth-child(3) .icon-ring {
  background: rgb(30 102 245 / 12%);
  color: #1e66f5;
}

.card:nth-child(4) .icon-ring {
  background: rgb(136 57 239 / 12%);
  color: #8839ef;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.card-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-link:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(420px, calc(100vw - 2rem));
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgb(0 0 0 / 20%);
  z-index: 30;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease;
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner.hidden {
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
}

.consent-toggle {
  width: 100%;
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-header), var(--bg-surface));
  color: var(--text-main);
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title icon"
    "subtitle icon";
  column-gap: 0.7rem;
  align-items: center;
  text-align: left;
}

.consent-toggle-title {
  grid-area: title;
  font-size: 0.88rem;
  font-weight: 700;
}

.consent-toggle-subtitle {
  grid-area: subtitle;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.consent-toggle-icon {
  grid-area: icon;
  font-size: 1rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.cookie-banner.open .consent-toggle-icon {
  transform: rotate(180deg);
}

.consent-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 0.9rem;
  transition:
    max-height 0.28s ease,
    opacity 0.2s ease,
    padding 0.2s ease;
}

.cookie-banner.open .consent-panel {
  max-height: 18rem;
  opacity: 1;
  padding: 0.8rem 0.9rem 0.9rem;
}

.cookie-banner h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.cookie-banner p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

.cookie-banner a {
  color: var(--accent);
}

.consent-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.consent-btn {
  appearance: none;
  border-radius: 9px;
  border: 1px solid var(--border);
  padding: 0.38rem 0.62rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.consent-accept {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.consent-reject {
  background: var(--bg-base);
  color: var(--text-main);
}

footer {
  padding: 0.9rem 0.8rem;
  padding-top: 1rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-footer);
  border-radius: 14px;
}

.footer-table {
  width: 100%;
  border-collapse: collapse;
}

.footer-cell {
  padding: 0.15rem 0;
  vertical-align: middle;
  border: none;
  font-size: 0.62rem;
  color: var(--text-subtle);
}

.footer-timestamp {
  text-align: center;
  font-size: 0.52rem;
  color: var(--text-muted);
  padding-bottom: 0.2rem;
}

.footer-source {
  text-align: left;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
  padding-right: 0.6rem;
}

.footer-credit {
  text-align: right;
}

.footer-credit a {
  display: inline-flex;
  align-items: baseline;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-privacy a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.footer-privacy {
  text-align: center;
  padding-top: 0.35rem;
}

.footer-privacy a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.privacy-page {
  padding-top: 1.2rem;
}

.privacy-page .card {
  margin-bottom: 0.9rem;
}

.privacy-page .card h2 {
  margin-bottom: 0;
}

.privacy-page table {
  width: 100%;
  border-collapse: collapse;
}

.privacy-page table td {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--bg-soft);
  vertical-align: top;
  line-height: 1.5;
}

.privacy-page table td:first-child {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  white-space: nowrap;
  width: 1px;
  padding-right: 1.2rem;
}

.privacy-page table td:last-child {
  font-size: 0.87rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.privacy-page table tr:last-child td {
  border-bottom: none;
}

.toast {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.48rem 0.7rem;
  box-shadow: 0 8px 28px rgb(0 0 0 / 20%);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (width <= 640px) {
  .container {
    padding: 1rem 0.9rem 2rem;
  }

  .hero-header h1 {
    font-size: 2.1rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.3rem 1.1rem;
  }

  .consent-btn {
    min-height: 36px;
  }

  .cookie-banner {
    right: 0.7rem;
    bottom: 0.7rem;
    width: calc(100vw - 1.4rem);
  }

  .cookie-banner.open .consent-panel {
    max-height: 20rem;
  }

  footer {
    padding: 0.9rem 0.65rem;
  }
}
