/* ==========================================================================
   KeepMyCut - Design tokens, matched to approved reference mockup
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;700&family=Caveat:wght@500;600&display=swap');

:root {
  --paper: #F7F4EE;
  --paper-card: #FCFAF5;
  --band: #EFEBE1;
  --ink: #111111;
  --secondary: #5D5D5D;
  --divider: #CFC7BB;

  --keep: #1F6A54;
  --fees: #C84D31;

  --font-headline: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Roboto Mono', 'Courier New', monospace;
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;

  --max-width: 1280px;
  --radius: 4px;

  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #1A1815;
  --paper-card: #221F1A;
  --band: #262218;
  --ink: #F2EEE3;
  --secondary: #A8A296;
  --divider: #3D392F;

  --keep: #4CAF8B;
  --fees: #E2694A;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.012) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.012) 0%, transparent 45%);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header { background: var(--paper); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a:hover { color: var(--keep); }
.main-nav svg { width: 14px; height: 14px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--secondary);
  background: none;
  border: none;
  cursor: pointer;
}
.dark-toggle svg { width: 16px; height: 16px; }

.tear-line {
  height: 0;
  border: none;
  border-top: 2px dotted var(--divider);
  margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.5em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-secondary {
  background: transparent;
  color: var(--keep);
  padding: 0.85em 0;
  font-weight: 600;
}
.btn-secondary:hover { color: #164f3f; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.6em 1em;
  border-radius: var(--radius);
  border: 1.5px solid var(--divider);
  background: var(--paper-card);
  color: var(--ink);
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--ink); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 72px 0 88px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-weight: 500;
  display: block;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 4rem;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  text-transform: none;
}
.hero h1 .accent { color: var(--keep); display: block; }

.hero-rule {
  width: 100px;
  height: 4px;
  background: var(--ink);
  border: none;
  margin: 0 0 28px;
}

.hero p.lede {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--secondary);
  max-width: 48ch;
  margin: 0 0 32px;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.platform-chip {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65em 1.1em;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  background: var(--paper-card);
  color: var(--ink);
  text-decoration: none;
}
.platform-chip:hover { border-color: var(--ink); }

.hero-actions { display: flex; align-items: center; gap: 28px; }

/* ==========================================================================
   Receipt card
   ========================================================================== */

.receipt-wrap { position: relative; }

.receipt {
  background: var(--paper-card);
  border: 1px solid var(--divider);
  padding: 32px 36px 44px;
  position: relative;
  box-shadow: 0 1px 3px rgba(17,17,17,0.05);
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 92%,
    98% 93%, 95% 91%, 92% 94%, 89% 91%, 86% 93%, 83% 90%, 80% 93%,
    77% 91%, 74% 94%, 71% 91%, 68% 93%, 65% 90%, 62% 93%, 59% 91%,
    56% 94%, 53% 91%, 50% 93%, 47% 90%, 44% 93%, 41% 91%, 38% 94%,
    35% 91%, 32% 93%, 29% 90%, 26% 93%, 23% 91%, 20% 94%, 17% 91%,
    14% 93%, 11% 90%, 8% 93%, 5% 91%, 2% 94%, 0% 92%
  );
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.receipt-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
}
.receipt-platform {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.7rem;
}
.receipt-price {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.7rem;
  text-align: right;
}

.receipt-dashed {
  border: none;
  border-top: 1.5px dashed var(--divider);
  margin: 18px 0;
}

.fees-heading {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fees);
  font-weight: 700;
  margin: 0 0 14px;
}

.fee-line {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.fee-line .val { color: var(--fees); font-weight: 500; }

.total-fees-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
}
.total-fees-row .val { color: var(--fees); }

.keep-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.keep-row .label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--keep);
  letter-spacing: 0.04em;
}
.keep-row .val {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 2rem;
  color: var(--keep);
}

/* Cut bar */

.cutbar {
  display: flex;
  height: 52px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: var(--radius);
}
.cutbar-keep, .cutbar-cut {
  display: flex;
  align-items: center;
  transition: width 250ms ease;
  min-width: 2px;
  white-space: nowrap;
  position: relative;
}
.cutbar-keep { justify-content: flex-start; background: var(--keep); color: #fff; }
.cutbar-cut { justify-content: flex-end; background: var(--fees); color: #fff; z-index: 1; }
.cutbar-keep span, .cutbar-cut span {
  padding: 0 1em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius);
}
.cutbar-keep span { background: var(--keep); }
.cutbar-cut span { background: var(--fees); }

.cutbar-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-top: 12px;
}
.cutbar-legend .keep-legend { color: var(--keep); font-weight: 600; text-transform: uppercase; }
.cutbar-legend .fees-legend { color: var(--fees); font-weight: 600; text-transform: uppercase; }

.hand-caption {
  position: relative;
  text-align: center;
  margin-top: 8px;
}
.hand-caption span {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--ink);
}
.hand-arrow {
  position: absolute;
  top: -22px;
  left: 46%;
  width: 24px;
  height: 24px;
  color: var(--ink);
}

/* ==========================================================================
   Features band
   ========================================================================== */

.features-band { background: var(--band); padding: 48px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.feature-item {
  padding: 0 32px;
  position: relative;
}
.feature-item:not(:last-child) {
  border-right: 2px dotted var(--divider);
}
.feature-item:first-child { padding-left: 0; }
.feature-icon { margin-bottom: 14px; color: var(--ink); }
.feature-icon svg { width: 26px; height: 26px; }
.feature-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.feature-desc {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--secondary);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Section headings + calculator catalog grid
   ========================================================================== */

.section { padding: 64px 0; border-top: 2px dotted var(--divider); }

.section-head { margin-bottom: 40px; max-width: 60ch; }
.section-head h2 {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.section-head p {
  font-family: var(--font-body);
  color: var(--secondary);
  margin: 0;
  font-size: 0.95rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
}
.calc-card {
  background: var(--paper-card);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-card:hover { background: var(--band); }
.calc-card .cat {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fees);
}
.calc-card .name {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.25rem;
  text-transform: uppercase;
}
.calc-card .desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--secondary);
  margin: 0;
}

/* ==========================================================================
   Calculator page layout (receipt-style)
   ========================================================================== */

.calc-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
  padding: 56px 0;
}

.calc-page .calc-inputs h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.calc-page .calc-inputs .sub {
  font-family: var(--font-body);
  color: var(--secondary);
  margin: 0 0 32px;
  line-height: 1.8;
}

.breadcrumb {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.breadcrumb a { color: var(--secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }

.cutbar-field { margin-bottom: 20px; }
.cutbar-field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.input-money { position: relative; }
.input-money::before {
  content: var(--currency-symbol, "$");
  position: absolute;
  left: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  color: var(--secondary);
  font-size: 1rem;
  pointer-events: none;
}
.input-money input[type="number"] { padding-left: 2.2em !important; }

input[type="number"], input[type="text"], select {
  width: 100%;
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  background: var(--paper-card);
  color: var(--ink);
}
input[type="number"]:focus, input[type="text"]:focus, select:focus { border-color: var(--ink); outline: none; }
input[type=number]::-webkit-inner-spin-button { opacity: 0.4; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--keep);
  outline-offset: 2px;
}

.editorial {
  max-width: 68ch;
  margin: 56px auto 0;
  padding-top: 48px;
  border-top: 2px dotted var(--divider);
}
.editorial h2 {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 32px 0 10px;
  color: var(--keep);
}
.editorial h2:first-child { margin-top: 0; }
.editorial p { font-family: var(--font-body); color: var(--secondary); line-height: 1.8; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #111111;
  color: #D8D4C8;
  padding: 56px 0 40px;
  margin-top: 0;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
}
.site-footer h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8C8778;
  margin: 0 0 16px;
  font-weight: 700;
}
.site-footer a {
  color: #D8D4C8;
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.site-footer a:hover { color: #fff; }
.site-footer .foot-logo {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.site-footer .foot-tag {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #8C8778;
  max-width: 32ch;
  line-height: 1.7;
}
.foot-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 24px 32px 0;
  border-top: 1px solid #333029;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: #8C8778;
}

/* ==========================================================================
   Email signup - fee-change alerts
   ========================================================================== */

.signup-card {
  background: var(--paper-card);
  border: 1.5px solid var(--divider);
  padding: 32px;
  margin: 48px 0;
  text-align: center;
}
.signup-card h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.signup-card p {
  font-family: var(--font-body);
  color: var(--secondary);
  font-size: 0.9rem;
  margin: 0 0 20px;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}
.signup-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.signup-form input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
}
.signup-form button {
  white-space: nowrap;
}
.signup-note {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--secondary);
  margin-top: 12px !important;
}
.signup-success {
  display: none;
  font-family: var(--font-body);
  color: var(--keep);
  font-weight: 700;
  padding: 12px 0;
}

@media (max-width: 500px) {
  .signup-form { flex-direction: column; }
}

/* ==========================================================================
   Ad zones - reserved space, no live ads yet.
   Fixed min-height prevents layout shift once real ad units are dropped in.
   ========================================================================== */

.ad-zone {
  border: 1.5px dashed var(--divider);
  background: var(--paper-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ad-zone-leaderboard { min-height: 100px; margin: 48px auto; max-width: var(--max-width); }
.ad-zone-incontent { min-height: 250px; margin: 48px 0; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.8rem; }
  .calc-page { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .feature-item:nth-child(2) { border-right: none; }
  .feature-item:nth-child(odd) { border-right: 2px dotted var(--divider); }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 32px; }
  .main-nav { display: none; }
}
