html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(212, 175, 55, 0.12), transparent 28%),
    linear-gradient(135deg, #09090d 0%, #0f1117 40%, #131722 100%);
  background-size: 120% 120%, 120% 120%, 100% 100%;
  background-position: 0% 0%, 100% 100%, 50% 50%;
  animation: backgroundDrift 28s ease-in-out infinite alternate;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.g {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.gp {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
}

.th {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 9999px;
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.th:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.20);
}

.th:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.55);
  outline-offset: 2px;
}

.th-i {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.th-i-on {
  display: none;
  color: #facc15;
}

.th-i-off {
  display: block;
  color: #e5e7eb;
}

.tv {
  height: 14rem;
  overflow: hidden;
  position: relative;
}

.tv::before,
.tv::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3rem;
  z-index: 1;
  pointer-events: none;
}

.tv::before {
  top: 0;
  background: linear-gradient(to bottom, #0f1117, rgba(15,17,23,0));
}

.tv::after {
  bottom: 0;
  background: linear-gradient(to top, #0f1117, rgba(15,17,23,0));
}

.tt {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sp {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows 0.45s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.spi {
  min-height: 0;
  overflow: hidden;
}

.sp[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1rem;
}

.pdp {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows 0.45s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.pdpi {
  min-height: 0;
  overflow: hidden;
}

.pdp[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1rem;
}

.bs::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.12) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.ts:hover .bs::after,
.ts:focus-visible .bs::after {
  transform: translateX(120%);
}

.cp {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.cp::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #d4af37 0%, #7c3aed 100%);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.10);
  flex-shrink: 0;
}

.calculator-shell {
  position: relative;
  overflow: visible;
  opacity: 1;
  transform: translateY(0);
}

.calculator-toggle {
  cursor: pointer;
  user-select: none;
}

.calculator-toggle .toggle-indicator {
  transition: transform 0.3s ease;
}

.calculator-toggle[aria-expanded="true"] .toggle-indicator {
  transform: rotate(180deg);
}

.cc {
  position: relative;
  z-index: 1;
  color: #1a1916;
  --bg: #f7f5f0;
  --card: #ffffff;
  --text: #1a1916;
  --muted: #8a8880;
  --border: #e2ded8;
  --accent: #2a2520;
  --highlight: #c8f0d8;
  --highlight-text: #0f5e32;
  --warn: #fde8d0;
  --warn-text: #8a3a00;
  --danger: #fae0e0;
  --danger-text: #8a0000;
  --radius: 14px;
  --mono: "DM Mono", monospace;
  --sans: "DM Sans", sans-serif;
  font-family: var(--sans);
}

.cc .section-title {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.8rem;
}

.cc .device-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 0.5rem;
}

.cc .device-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  transition: border-color 0.15s;
}

.cc .device-card:hover {
  border-color: #c0b8b0;
}

.cc .device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.8rem;
}

.cc .device-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cc .device-price {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.cc .counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc .counter-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: var(--mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s, transform 0.1s;
  user-select: none;
  line-height: 1;
}

.cc .counter-btn:hover {
  background: var(--border);
  border-color: #c0b8b0;
}

.cc .counter-btn:active {
  transform: scale(0.95);
}

.cc .counter-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  min-width: 24px;
  text-align: center;
  color: var(--text);
}

.cc .device-subtotal {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.5rem;
  min-height: 16px;
}

.cc .includes {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.cc .summary-card {
  position: relative;
  clear: both;
  z-index: 3;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2.5rem;
}

.cc .summary-rows {
  margin-bottom: 1rem;
}

.cc .sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 4px 0;
}

.cc .sum-key {
  color: var(--muted);
}

.cc .sum-val {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.cc .sd {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.8rem 0;
}

.cc .total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.cc .total-label {
  font-size: 14px;
  color: var(--muted);
}

.cc .total-val {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cc .total-period {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}

.cc .badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.cc .badge {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--highlight);
  color: var(--highlight-text);
}

.cc .badge.warn {
  background: var(--warn);
  color: var(--warn-text);
}

.cc .note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.cc .empty-state {
  text-align: center;
  padding: 2rem;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

.cc .pc {
  background: #10131a;
  border: 1px solid #232938;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  color: #e5e7eb;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.cc .package-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8a8880;
  margin-bottom: 0.4rem;
}

.cc .pt {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.cc .pf {
  margin-bottom: 2rem;
}

.cc .pfh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 0.8rem;
}

.cc .pfl {
  font-size: 14px;
  color: #e5e7eb;
  font-weight: 500;
}

.cc .pfv {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: #7c3aed;
}

.cc .psc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.cc .po {
  border: 1px solid #232938;
  background: rgba(255,255,255,0.03);
  color: #d1d5db;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.cc .po:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.10);
  color: #ffffff;
}

.cc .po:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.65);
  outline-offset: 2px;
}

.cc .po.is-active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.7);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.18);
}

.cc .prb {
  border-radius: 10px;
  padding: 1.5rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  text-align: center;
}

.cc .prp {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  margin-bottom: 4px;
}

.cc .prs {
  font-size: 13px;
  color: #8a8880;
}

.cc .pfb {
  margin-top: 1.5rem;
  background: rgba(255,255,255,0.02);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid #232938;
}

.cc .pft {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8880;
  margin-bottom: 0.75rem;
  font-family: var(--mono);
}

.cc .pfls {
  list-style: none;
  font-size: 13px;
  line-height: 1.6;
  color: #d1d5db;
  padding: 0;
  margin: 0;
}

.cc .pfls li {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}

.cc .pfls li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #c8f0d8;
}

.cc .pmr {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #232938;
}

.cc .pmr:last-child {
  border-bottom: none;
}

.cc .pmk {
  color: #8a8880;
}

.cc .pmv {
  font-family: var(--mono);
  font-weight: 500;
  color: #e5e7eb;
  white-space: nowrap;
}

.cc .pn {
  font-size: 12px;
  color: #8a8880;
  margin-top: 1.5rem;
  line-height: 1.6;
  text-align: center;
}

body.light-theme {
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.10), transparent 34%),
    radial-gradient(circle at bottom right, rgba(212, 175, 55, 0.10), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #e2e8f0 100%);
  color: #0f172a;
}

body.light-theme .g {
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.58));
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .gp {
  background-image:
    linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.05) 1px, transparent 1px);
}

body.light-theme .th {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.82);
  color: #0f172a;
}

body.light-theme .th:hover {
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.10);
}

body.light-theme .th-i-on {
  color: #f59e0b;
}

body.light-theme .th-i-off {
  color: #475569;
}

body.light-theme .tv::before {
  background: linear-gradient(to bottom, #eef2ff, rgba(238,242,255,0));
}

body.light-theme .tv::after {
  background: linear-gradient(to top, #eef2ff, rgba(238,242,255,0));
}

body.light-theme .cc .pc {
  background: rgba(255,255,255,0.82);
  border-color: rgba(15, 23, 42, 0.10);
  color: #0f172a;
}

body.light-theme .cc .pt,
body.light-theme .cc .pfl,
body.light-theme .cc .prp,
body.light-theme .cc .pmv {
  color: #0f172a;
}

body.light-theme .cc .po {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(15,23,42,0.03);
  color: #334155;
}

body.light-theme .cc .po:hover {
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.08);
  color: #0f172a;
}

body.light-theme .cc .po.is-active {
  color: #0f172a;
  background: rgba(124, 58, 237, 0.14);
}

body.light-theme .cc .prb {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.20);
}

body.light-theme .cc .pfb {
  background: rgba(15,23,42,0.02);
  border-color: rgba(15, 23, 42, 0.10);
}

body.light-theme .cc .pfls {
  color: #334155;
}

body.light-theme .cc .pmr {
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

body.light-theme .cc .pmk,
body.light-theme .cc .pft,
body.light-theme .cc .prs,
body.light-theme .cc .pn {
  color: #64748b;
}

body.light-theme .text-white,
body.light-theme h1,
body.light-theme h2,
body.light-theme h3 {
  color: #0f172a !important;
}

body.light-theme .text-slate-300 {
  color: #475569 !important;
}

body.light-theme .text-slate-400 {
  color: #64748b !important;
}

body.light-theme .border-white\/10 {
  border-color: rgba(15, 23, 42, 0.10) !important;
}

body.light-theme .bg-white\/5 {
  background-color: rgba(15, 23, 42, 0.04) !important;
}

body.light-theme .bg-white\/10 {
  background-color: rgba(15, 23, 42, 0.06) !important;
}

@keyframes backgroundDrift {
  0% {
    background-position: 0% 0%, 100% 100%, 50% 50%;
  }
  50% {
    background-position: 8% 6%, 92% 94%, 50% 50%;
  }
  100% {
    background-position: 14% 10%, 86% 90%, 50% 50%;
  }
}

@media (max-width: 1024px) {
  main {
    overflow-x: hidden;
  }

  section {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .tv {
    height: 12rem;
  }

  .cc .psc {
    grid-template-columns: 1fr;
  }

  .th {
    top: 20px;
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-reveal,
  .animate-fadeUp,
  .animate-floatSlow,
  .tt {
    animation: none !important;
  }

  body {
    animation: none;
  }

  .sp,
  .pdp,
  .th,
  .bs::after {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
