/* ==========================================================================
   Aera Market — "Envato Dark" design system
   Editorial, high-contrast, neon-lime accents, oversized type, flat surfaces.
   PolySans is the intended typeface; the stack falls back to the closest
   system UI faces where it is not installed (it cannot be bundled).
   ========================================================================== */

:root {
  /* brand */
  --primary: #87e64b;
  --primary-60: #b1ed7d;
  --primary-70: #9deb61;
  --secondary: #d9d9d9;
  --tertiary: #374151;

  /* surfaces */
  --neutral: #191919;
  --neutral-90: #232323;
  --neutral-80: #2b2b2b;
  --neutral-70: #374151;
  --surface: #ffffff;
  --on-surface: #191919;

  --error: #d94a4a;

  /* radii */
  --rounded-none: 0px;
  --rounded-sm: 4px;
  --rounded-md: 8px;
  --rounded-lg: 16px;
  --rounded-xl: 48px;
  --rounded-full: 9999px;

  /* spacing */
  --space-xs: 8px;
  --space-sm: 20px;
  --space-md: 32px;
  --space-lg: 48px;
  --space-xl: 68px;
  --gutter: 32px;
  --margin: 48px;

  --font: "PolySans", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--neutral);
  color: var(--secondary);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ------------------------------- typography ------------------------------ */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--secondary);
  letter-spacing: 0;
  font-weight: 600;
}

/* display / headline-lg / headline-md / headline-sm */
h1 { font-size: clamp(40px, 6vw, 83px); line-height: 1.05; font-weight: 600; }
h2 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; font-weight: 600; }
h3 { font-size: 20px; line-height: 28px; font-weight: 600; }

p { margin: 0; }

.muted { color: #9a9a9a; }
.small { font-size: 14px; line-height: 20px; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; }
.hidden, [hidden] { display: none !important; }

/* -------------------------------- layout --------------------------------- */

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--margin);
}

.container.narrow { max-width: 620px; }

.section { padding-block: var(--space-xl); }
.stack { display: grid; gap: var(--space-sm); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--gutter); flex-wrap: wrap; }

.divider { height: 1px; background: var(--neutral-70); margin-block: var(--space-md); }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.text-ok { color: var(--primary); }
.text-warn { color: #e3b341; }
.text-bad { color: var(--error); }
.lead { font-size: 20px; line-height: 32px; font-weight: 400; color: var(--secondary); }

/* --------------------------------- header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(25, 25, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--neutral-70);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--rounded-sm);
  background: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--rounded-full);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--neutral-80); }
.nav-link[aria-current="page"] { background: var(--neutral-80); color: var(--primary); }

/* --------------------------------- buttons ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  min-width: 0;
  padding: 8px 24px;
  border: 1px solid var(--neutral-70);
  border-radius: var(--rounded-full);
  background: transparent;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--neutral-80); border-color: var(--secondary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-surface);
  min-width: 180px;
}
.btn-primary:hover { background: var(--primary-70); border-color: var(--primary-70); color: var(--on-surface); }

.btn-ghost { border-color: var(--neutral-70); color: var(--secondary); }
.btn-danger { border-color: rgba(217, 74, 74, 0.55); color: #f1a3a3; }
.btn-danger:hover { background: rgba(217, 74, 74, 0.12); border-color: var(--error); }
.btn-sm { height: 36px; padding: 4px 16px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------------------------------- hero --------------------------------- */

.hero { padding-block: clamp(48px, 8vw, 96px) var(--space-lg); }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}
.hero-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero h1 {
  margin-top: var(--space-sm);
  font-size: clamp(48px, 9vw, 125px);
  line-height: 0.95;
  font-weight: 700;
  max-width: 18ch;
}

.hero h1 .grad { color: var(--primary); }

.hero p.lead { margin-top: var(--space-sm); max-width: 60ch; color: var(--secondary); }

.hero-actions { margin-top: var(--space-md); display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--neutral-70);
}
.hero-stat {
  padding: var(--space-md) var(--space-md) 0 0;
  border-right: 1px solid var(--neutral-70);
}
.hero-stat:last-child { border-right: 0; }
.hero-stat strong {
  display: block;
  font-size: clamp(32px, 4vw, 55px);
  line-height: 1.05;
  font-weight: 600;
  color: var(--secondary);
}
.hero-stat span { display: block; margin-top: 8px; color: #9a9a9a; font-size: 14px; }

/* --------------------------------- cards --------------------------------- */

.card {
  background: var(--neutral);
  border: 1px solid var(--neutral-70);
  border-radius: var(--rounded-md);
  padding: 16px;
  color: var(--secondary);
}
.card-elevated { background: var(--neutral-90); }

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gutter);
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--neutral);
  border: 1px solid var(--neutral-70);
  border-radius: var(--rounded-md);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.product-card:hover { border-color: var(--secondary); transform: translateY(-2px); }

.product-thumb {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 120% at 15% 0%, rgba(135, 230, 75, 0.12), transparent 55%),
    var(--neutral-90);
  display: grid;
  place-items: center;
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--neutral-70);
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-title { font-size: 16px; font-weight: 600; color: var(--secondary); }
.product-title:hover { color: var(--primary); }
.product-meta { color: #9a9a9a; font-size: 14px; }
.product-price { margin-top: auto; font-size: 18px; font-weight: 600; color: var(--primary); }

/* --------------------------------- chips --------------------------------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--rounded-full);
  background: var(--neutral-80);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--neutral-70); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-surface); }

/* --------------------------------- badges -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--neutral-70);
  border-radius: var(--rounded-full);
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.badge-ok { border-color: rgba(135, 230, 75, 0.5); color: var(--primary); }
.badge-warn { border-color: rgba(227, 179, 65, 0.5); color: #e3b341; }
.badge-bad { border-color: rgba(217, 74, 74, 0.5); color: #f1a3a3; }
.badge-accent { border-color: rgba(135, 230, 75, 0.5); color: var(--primary); }

/* --------------------------------- forms --------------------------------- */

.form { display: grid; gap: var(--space-sm); }
.summary-list { display: grid; grid-template-columns: max-content 1fr; gap: 12px var(--space-md); margin: 0; }
.summary-list dt { color: #9a9a9a; font-size: 14px; }
.summary-list dd { margin: 0; font-size: 16px; }

.field { display: grid; gap: 8px; }
.field > span { color: #9a9a9a; font-size: 12px; font-weight: 600; }
.field small { color: #8a8a8a; font-size: 12px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--rounded-full);
  background: var(--neutral-80);
  color: var(--secondary);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
textarea { border-radius: var(--rounded-md); min-height: 120px; resize: vertical; }
select { border-radius: var(--rounded-full); }
select[multiple] { border-radius: var(--rounded-md); }
input::placeholder, textarea::placeholder { color: #7d7d7d; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: var(--neutral-90); }

label.check { display: flex; gap: 8px; align-items: center; color: var(--secondary); font-size: 14px; }

/* --------------------------------- tables -------------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}
.data-table th {
  padding: 12px 12px;
  text-align: left;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--neutral-70);
  white-space: nowrap;
}
.data-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--neutral-80);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--neutral-90); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------- alerts -------------------------------- */

.alert {
  padding: 16px;
  border: 1px solid var(--neutral-70);
  border-left: 3px solid var(--primary);
  border-radius: var(--rounded-sm);
  background: var(--neutral-90);
  font-size: 14px;
}
.alert-ok { border-left-color: var(--primary); }
.alert-warn { border-left-color: #e3b341; }
.alert-bad { border-left-color: var(--error); }

/* --------------------------------- toast --------------------------------- */

.toast-host { position: fixed; right: var(--gutter); bottom: var(--gutter); display: grid; gap: 8px; z-index: 100; }
.toast {
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  border: 1px solid var(--neutral-70);
  border-left: 3px solid var(--primary);
  border-radius: var(--rounded-sm);
  background: var(--neutral-90);
  font-size: 14px;
  animation: toast-in 0.18s ease;
}
.toast.err { border-left-color: var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------- stats --------------------------------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gutter); }
.stat { border-top: 1px solid var(--neutral-70); padding-top: 16px; margin: 0; }
.stat dt { color: #9a9a9a; font-size: 12px; font-weight: 600; }
.stat dd { margin: 8px 0 0; font-size: clamp(24px, 3vw, 36px); line-height: 1.1; font-weight: 600; }

/* --------------------------------- detail -------------------------------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: var(--space-lg); align-items: start; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-hero {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--neutral-70);
  border-radius: var(--rounded-md);
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(135, 230, 75, 0.1), transparent 55%),
    var(--neutral-90);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.check-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--error); }
.check-dot.ok { background: var(--primary); }
.check-dot.warn { background: #e3b341; }

/* --------------------------------- footer -------------------------------- */

.site-footer {
  border-top: 1px solid var(--neutral-70);
  margin-top: var(--space-xl);
  padding-block: var(--space-md);
  color: #9a9a9a;
  font-size: 14px;
}
.site-footer .container { display: flex; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }

/* -------------------------------- utilities ------------------------------ */

.empty {
  border: 1px dashed var(--neutral-70);
  border-radius: var(--rounded-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  color: #9a9a9a;
  font-size: 14px;
}

.skeleton { position: relative; overflow: hidden; background: var(--neutral-90); border-radius: var(--rounded-md); min-height: 240px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 900px) {
  .container { padding-inline: var(--space-sm); }
  .hero h1 { max-width: none; }
  .site-header .container { height: auto; padding-block: 12px; flex-wrap: wrap; gap: 12px; }
  .nav-links { margin-left: 0; width: 100%; }
  .hero-stat { border-right: 0; padding-right: 0; }
  .hero-stats { gap: 0; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
