/* ============================================================
   GigCutCalc — premium design system
   Vanilla CSS, zero dependencies, zero external assets.
   ============================================================ */

:root {
  --bg: #f3f5fb;
  --bg-soft: #eceff7;
  --card: #ffffff;
  --ink: #131a35;
  --ink-soft: #2b3352;
  --muted: #5d6680;
  --faint: #8a93ad;
  --line: #e2e8f4;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-dark: #3a31c2;
  --brand-tint: #eef0ff;
  --accent: #06b6d4;
  --good: #059669;
  --good-tint: #e7f7f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(19, 26, 53, 0.06), 0 4px 14px rgba(19, 26, 53, 0.06);
  --shadow-md: 0 2px 4px rgba(19, 26, 53, 0.06), 0 14px 34px rgba(19, 26, 53, 0.10);
  --shadow-lg: 0 4px 10px rgba(19, 26, 53, 0.08), 0 24px 60px rgba(79, 70, 229, 0.16);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 320px at 50% -120px, rgba(79, 70, 229, 0.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Header ---------------- */
.site-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #141040 0%, #29216e 55%, #4f46e5 100%);
  color: #fff;
  padding: 30px 0 34px;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 260px at 88% -40px, rgba(124, 58, 237, 0.5), transparent 60%),
    radial-gradient(520px 240px at 8% 130%, rgba(6, 182, 214, 0.3), transparent 60%);
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo span {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo a { color: inherit; text-decoration: none; }
.tagline { margin: 4px 0 0; color: #c9d4f7; font-size: 0.95rem; }

/* ---------------- Navigation ---------------- */
.site-nav {
  flex-basis: 100%;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.site-nav a {
  color: #dbe3ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.site-nav a:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  transform: translateY(-1px);
}
.site-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.site-nav a[aria-current="page"] {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

/* ---------------- Hero ---------------- */
.hero { text-align: center; padding: 54px 0 10px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-dark);
  background: var(--brand-tint);
  border: 1px solid #dde2ff;
  padding: 8px 17px;
  border-radius: 999px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}
.hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.hero p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 660px;
  margin: 0 auto;
}

/* ---------------- Calculator card ---------------- */
.calc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 30px 0;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-soft);
  padding: 7px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 13px 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.tab:hover { color: var(--ink-soft); background: rgba(255, 255, 255, 0.65); }
.tab.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.currency-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
  background: #fafbfe;
  font-size: 0.9rem;
}
.currency-row label { color: var(--muted); }
.currency-row .hint { font-size: 0.8rem; color: var(--faint); }
.currency-row select { margin-left: auto; }

.panel { display: none; padding: 28px 24px; }
.panel.active { display: block; animation: panelIn 0.28s var(--ease); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.inputs label {
  display: block;
  margin-bottom: 17px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.inputs input,
.inputs select,
.currency-row select {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.inputs input:hover,
.inputs select:hover,
.currency-row select:hover { border-color: #c4cbe4; }
.inputs input:focus,
.inputs select:focus,
.currency-row select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.16);
}
.currency-row select { width: auto; min-width: 190px; margin-top: 0; padding: 9px 12px; font-size: 0.92rem; }
.field-note {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

.btn {
  display: inline-block;
  width: 100%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.44);
}
.btn:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.btn:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.35); outline-offset: 2px; }

.results h2 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.breakdown { margin: 0; }
.breakdown .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  border-radius: 6px;
  transition: background 0.14s var(--ease);
}
.breakdown .row:hover { background: #f7f9fe; }
.breakdown dt { color: var(--muted); font-weight: 500; }
.breakdown dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.breakdown .row.sub dt { padding-left: 14px; }
.breakdown .row.total {
  border: 1px solid #bfe6d2;
  background: linear-gradient(135deg, var(--good-tint), #f4fcf8);
  border-radius: 12px;
  padding: 15px 16px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.breakdown .row.total:hover { background: linear-gradient(135deg, var(--good-tint), #f4fcf8); }
.breakdown .row.total dt { color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.breakdown .row.total dd { color: var(--good); font-size: 1.55rem; letter-spacing: -0.01em; }
.pct { font-size: 0.8rem; color: var(--faint); font-weight: 400; }

.note { font-size: 0.82rem; color: var(--muted); }

/* ---------------- Compare cards ---------------- */
.compare-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .compare-cards { grid-template-columns: 1fr; } }
.compare-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px 18px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  overflow: hidden;
}
.compare-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent, linear-gradient(90deg, var(--brand), var(--accent)));
}
.compare-card:nth-child(1) { --card-accent: linear-gradient(90deg, #4f46e5, #7c3aed); }
.compare-card:nth-child(2) { --card-accent: linear-gradient(90deg, #059669, #34d399); }
.compare-card:nth-child(3) { --card-accent: linear-gradient(90deg, #475569, #94a3b8); }
.compare-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cfd6ec;
}
.compare-card h3 { margin: 6px 0 6px; font-size: 1.08rem; letter-spacing: -0.01em; }
.compare-card .fee-line { color: var(--muted); font-size: 0.85rem; margin: 0 0 10px; min-height: 2.4em; }
.compare-card .net {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--good);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.compare-card .keep { font-size: 0.82rem; color: var(--faint); margin: 8px 0 0; }

/* ---------------- Sources + FAQ ---------------- */
.sources, .faq { margin: 40px 0; }
.sources h2, .faq h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.sources {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.sources h2 { font-size: 1.15rem; margin-bottom: 10px; }
.sources ul { padding: 0; margin: 0; list-style: none; }
.sources li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.sources li::before {
  content: "↗";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.sources li:last-child { margin-bottom: 0; }
.sources a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 1px);
  transition: background-size 0.22s var(--ease), color 0.16s var(--ease);
}
.sources a:hover { background-size: 100% 1.5px; }

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.faq-item:hover { border-color: #ccd4ea; }
.faq-item.open { box-shadow: var(--shadow-sm); border-color: #c9d2f2; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 17px 20px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: color 0.16s var(--ease);
}
.faq-q:hover { color: var(--brand-dark); }
.faq-q::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 50%;
  transition: transform 0.25s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.faq-item.open .faq-q::after {
  transform: rotate(135deg);
  background: var(--brand);
  color: #fff;
}
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.28s var(--ease); }
.faq-a p { padding: 2px 20px 20px; margin: 0; color: var(--muted); font-size: 0.95rem; }
.faq-a strong { color: var(--ink); }

/* ---------------- Footer ---------------- */
.site-footer {
  position: relative;
  background: #0e1330;
  color: #aab3d0;
  padding: 36px 0 30px;
  margin-top: 28px;
  font-size: 0.88rem;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--accent));
}
.site-footer strong { color: #fff; }
.site-footer .note { color: #7c86a8; }
.site-footer p { max-width: 860px; }
.footer-nav { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a {
  color: #c7d2fe;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 2;
  transition: color 0.16s var(--ease);
}
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- Article pages ---------------- */
.article { padding: 34px 36px; }
@media (max-width: 760px) { .article { padding: 24px 20px; } }
.article h2 {
  position: relative;
  font-size: 1.34rem;
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
  padding-left: 16px;
}
.article h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1.1rem; letter-spacing: -0.01em; margin: 26px 0 8px; color: var(--ink-soft); }
.article p { margin: 0 0 15px; }
.article p.lead, .article > p:first-of-type { font-size: 1.05rem; color: var(--ink-soft); }
.article ul, .article ol { margin: 0 0 17px; padding-left: 22px; }
.article li { margin-bottom: 9px; }
.article li::marker { color: var(--brand); font-weight: 700; }
.article a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left calc(100% - 1px);
  transition: background-size 0.22s var(--ease);
}
.article a:hover { background-size: 100% 1.5px; }
.article strong { color: var(--ink); }

.table-scroll {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 620px;
  margin: 0;
}
.article th, .article td {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
.article thead th {
  background: linear-gradient(180deg, #f2f4fb, #e9edf8);
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.article tbody tr { transition: background 0.14s var(--ease); }
.article tbody tr:hover { background: #f7f9fe; }
.article tbody tr:last-child th,
.article tbody tr:last-child td { border-bottom: 0; }
.article td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.cta-box {
  border: 1.5px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(#f5f7ff, #f5f7ff) padding-box,
    linear-gradient(135deg, var(--brand), var(--accent)) border-box;
  padding: 24px 26px;
  margin: 32px 0;
  box-shadow: var(--shadow-sm);
}
.cta-box p { margin: 0 0 14px; }
.cta-box p:last-child { margin-bottom: 0; }
.cta-box .btn { width: auto; padding: 12px 32px; text-decoration: none; }
.cta-box a:not(.btn) { color: var(--brand-dark); font-weight: 700; }

.disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  background: #fafbfe;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  margin-top: 34px;
  padding: 16px 18px;
}
.disclaimer p { margin: 0 0 8px; font-size: 0.82rem; }
.disclaimer p:last-child { margin-bottom: 0; }

/* ---------------- Contact form ---------------- */
.form-row { margin-bottom: 17px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.form-row input:hover,
.form-row textarea:hover { border-color: #c4cbe4; }
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.16);
}
.form-row textarea { min-height: 150px; resize: vertical; }

/* ---------------- Small screens ---------------- */
@media (max-width: 560px) {
  .hero { padding: 40px 0 6px; }
  .tab { font-size: 0.83rem; padding: 12px 4px; }
  .panel { padding: 22px 16px; }
  .currency-row { padding: 13px 16px; }
  .currency-row select { margin-left: 0; width: 100%; }
  .breakdown .row.total dd { font-size: 1.35rem; }
  .article h2 { font-size: 1.22rem; }
  .site-nav a { padding: 8px 12px; font-size: 0.85rem; }
}

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