/* unlock-shell-take-3: Take 3 calc UI (BLL logo + softer motion) + Take 1 unlock gate */
:root {
  --bg: #f4f1eb;
  --bg-accent: #e8efe9;
  --ink: #1c2420;
  --ink-soft: #5a655f;
  --card: #ffffff;
  --line: #d7ddd8;
  --brand: #1f6b5a;
  --brand-deep: #145043;
  --brand-soft: #e3f2ed;
  --accent: #c47a2c;
  --accent-soft: #f8efe4;
  --total: #14352d;
  --shadow: 0 12px 40px rgba(28, 36, 32, 0.08);
  --shadow-lift: 0 16px 36px rgba(28, 36, 32, 0.12);
  --glow-brand: 0 0 0 3px rgba(31, 107, 90, 0.18), 0 8px 24px rgba(31, 107, 90, 0.12);
  --radius: 18px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dceee7 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #f3e4d0 0%, transparent 50%),
    var(--bg);
  line-height: 1.5;
}

.page {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.25rem 0 3.5rem;
}

.header {
  margin-bottom: 1.75rem;
}

.brand-bar {
  display: flex;
  align-items: center;
  margin-bottom: 1.15rem;
}

.brand-logo {
  display: block;
  width: auto;
  height: 56px;
  max-width: 200px;
  object-fit: contain;
}

.brand-logo:hover {
  box-shadow: 0 8px 28px rgba(34, 78, 135, 0.22);
  transform: translateY(-1px);
}

.hero-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.hero-mark {
  flex-shrink: 0;
  margin-top: 0.15rem;
  padding: 0.45rem 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(28, 36, 32, 0.05);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
}

.hero-mark:hover {
  border-color: rgba(31, 107, 90, 0.45);
  background: #fff;
  box-shadow: var(--glow-brand);
  transform: translateY(-2px);
}

.dash-mark {
  display: block;
  overflow: visible;
}

.mark-area {
  opacity: 0;
  animation: area-in 1s ease-out 0.35s forwards, area-breathe 5.5s ease-in-out 1.5s infinite;
}

.mark-trend {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation:
    trend-draw 0.95s ease-out 0.15s forwards,
    trend-breathe 5.5s ease-in-out 1.2s infinite;
  filter: drop-shadow(0 0 0 transparent);
}

.mark-pulse {
  opacity: 0;
  animation: pulse-in 0.35s ease-out 0.95s forwards, pulse-soft 4.5s ease-in-out 1.3s infinite;
}

.mark-pulse-ring {
  opacity: 0;
  transform-origin: 58px 12px;
  animation: ring-pulse 4.5s ease-in-out 1.3s infinite;
}

@keyframes area-in {
  to { opacity: 1; }
}

@keyframes area-breathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes trend-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes trend-breathe {
  0%, 100% {
    opacity: 1;
    stroke-width: 2.4;
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    opacity: 0.88;
    stroke-width: 2.7;
    filter: drop-shadow(0 0 3px rgba(31, 107, 90, 0.35));
  }
}

@keyframes pulse-in {
  to { opacity: 1; }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 0.9; transform: translateY(-4px) scale(1.08); }
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  35% { opacity: 0.55; }
  70% { opacity: 0; transform: scale(2.15); }
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.header h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 860px) {
  .layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.5rem;
  transition:
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.28s ease,
    background 0.28s ease;
}

.card.inputs:hover {
  border-color: rgba(31, 107, 90, 0.4);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(31, 107, 90, 0.08);
  transform: translateY(-3px);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
}

.card.results:hover {
  box-shadow: 0 18px 44px rgba(18, 53, 46, 0.35), 0 0 0 1px rgba(232, 181, 106, 0.2);
  transform: translateY(-3px);
}

.enter-card {
  animation: card-enter 0.48s ease-out both;
  animation-delay: var(--enter-delay, 0ms);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.field {
  margin-bottom: 1.15rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 520px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

label,
.label-text {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.input-wrap:hover {
  border-color: rgba(31, 107, 90, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 107, 90, 0.1);
  background: #fff;
}

.input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 107, 90, 0.2), 0 4px 14px rgba(31, 107, 90, 0.1);
  background: #fff;
}

.prefix,
.suffix {
  display: grid;
  place-items: center;
  min-width: 2.4rem;
  padding: 0 0.55rem;
  background: var(--bg-accent);
  color: var(--ink-soft);
  font-weight: 650;
}

.input-wrap input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.input-wrap input:focus {
  outline: none;
  box-shadow: none;
}

input[type="number"] {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input[type="number"]:hover {
  border-color: rgba(31, 107, 90, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 107, 90, 0.1);
  background: #fff;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 107, 90, 0.2), 0 4px 14px rgba(31, 107, 90, 0.1);
  background: #fff;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.preset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.16s ease,
    box-shadow 0.18s ease;
}

.preset:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
  box-shadow: 0 4px 14px rgba(31, 107, 90, 0.14);
  transform: translateY(-1px);
}

.preset:active {
  transform: scale(0.96) translateY(0);
  box-shadow: none;
}

.preset.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(31, 107, 90, 0.28);
}

.preset.is-active:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
  transform: translateY(-1px);
}

.preset:focus-visible {
  outline: 3px solid rgba(31, 107, 90, 0.35);
  outline-offset: 2px;
}

.results {
  background: linear-gradient(180deg, #12352e 0%, #1a4a40 100%);
  border-color: transparent;
  color: #f4faf7;
}

.results h2 {
  color: #fff;
}

.results-intro {
  margin: -0.35rem 0 1.1rem;
  color: rgba(244, 250, 247, 0.78);
  font-size: 0.9rem;
}

.metrics {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.metric {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  overflow: hidden;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.metric:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(232, 181, 106, 0.18), 0 10px 28px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.metric-with-ring {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.metric.highlight {
  background: rgba(196, 122, 44, 0.18);
  border-color: rgba(243, 196, 128, 0.35);
}

.metric.highlight:hover {
  background: rgba(196, 122, 44, 0.28);
  border-color: rgba(243, 196, 128, 0.55);
  box-shadow: 0 0 20px rgba(196, 122, 44, 0.25), 0 10px 28px rgba(0, 0, 0, 0.18);
}

.metric.total {
  background: #fff;
  color: var(--total);
  border-color: transparent;
}

.metric.total:hover {
  background: #fff;
  border-color: rgba(31, 107, 90, 0.35);
  box-shadow: 0 0 0 2px rgba(31, 107, 90, 0.15), 0 12px 32px rgba(31, 107, 90, 0.18);
  transform: translateY(-2px);
}

.metric-total-glow {
  animation: total-border-pulse 5s ease-in-out infinite;
}

.metric-sheen {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(31, 107, 90, 0.07) 48%,
    rgba(196, 122, 44, 0.1) 52%,
    transparent 65%
  );
  background-size: 220% 100%;
  animation: sheen-sweep 7s ease-in-out infinite;
}

@keyframes total-border-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(31, 107, 90, 0), 0 4px 16px rgba(28, 36, 32, 0.06);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(31, 107, 90, 0.14), 0 8px 22px rgba(31, 107, 90, 0.12);
  }
}

@keyframes sheen-sweep {
  0%, 100% { background-position: 120% 0; opacity: 0.55; }
  40% { background-position: -40% 0; opacity: 1; }
  60% { background-position: -40% 0; opacity: 0.7; }
}

.metric dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}

.metric.total dt {
  opacity: 0.7;
  color: var(--ink-soft);
}

.metric dd {
  margin: 0.2rem 0 0;
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric dd.is-updating {
  animation: value-settle 0.55s ease-out;
}

@keyframes value-settle {
  from {
    opacity: 0.72;
    transform: translateY(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric .formula {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  opacity: 0.7;
}

.metric.total .formula {
  color: var(--ink-soft);
  opacity: 1;
}

.result-ring {
  flex-shrink: 0;
  transform: rotate(-90deg);
  position: relative;
  z-index: 1;
  transition: filter 0.25s ease;
}

.metric:hover .result-ring {
  filter: drop-shadow(0 0 4px rgba(232, 181, 106, 0.45));
}

.metric.total:hover .result-ring {
  filter: drop-shadow(0 0 4px rgba(31, 107, 90, 0.4));
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 3.5;
}

.ring-draw {
  fill: none;
  stroke: #e8b56a;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-ring--total .ring-track {
  stroke: rgba(31, 107, 90, 0.2);
}

.result-ring--total .ring-draw {
  stroke: var(--brand);
}

.ring-draw.is-drawn {
  stroke-dashoffset: 0;
}

.footer {
  margin-top: 1.75rem;
  padding: 1.2rem 1.3rem;
  border: 1px dashed #c9d2cb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.footer:hover {
  border-color: rgba(31, 107, 90, 0.35);
  border-style: solid;
  box-shadow: 0 8px 24px rgba(28, 36, 32, 0.06);
  transform: translateY(-1px);
}

.footer h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.footer ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.footer li + li {
  margin-top: 0.45rem;
}

.fineprint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: #7a867f;
}

@media (prefers-reduced-motion: reduce) {
  .enter-card,
  .mark-trend,
  .mark-area,
  .mark-pulse,
  .mark-pulse-ring,
  .metric dd.is-updating,
  .ring-draw,
  .metric-total-glow,
  .metric-sheen,
  .brand-logo,
  .hero-mark,
  .card,
  .metric,
  .footer,
  .preset,
  .input-wrap,
  input[type="number"] {
    animation: none !important;
    transition: none !important;
  }

  .mark-trend {
    stroke-dashoffset: 0;
    opacity: 1;
    filter: none;
  }

  .mark-area {
    opacity: 1;
  }

  .mark-pulse {
    opacity: 1;
    transform: none;
  }

  .mark-pulse-ring {
    opacity: 0;
  }

  .enter-card {
    opacity: 1;
    transform: none;
  }

  .ring-draw.is-drawn {
    stroke-dashoffset: 0;
  }

  .preset:active,
  .preset:hover,
  .card:hover,
  .metric:hover,
  .hero-mark:hover,
  .brand-logo:hover,
  .footer:hover {
    transform: none;
  }

  .metric-sheen {
    display: none;
  }
}

/* —— Soft unlock gate (teal/cream SMB — not ADHD pink) —— */

body.is-gated {
  overflow: hidden;
}

#unlock-gate {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  position: relative;
}

#unlock-gate.is-visible {
  display: flex;
}

#unlock-loading {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#unlock-loading.is-visible {
  display: flex;
}

#calculator-root {
  display: none;
}

#calculator-root.is-visible {
  display: block;
}

.unlock-blob {
  pointer-events: none;
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.unlock-blob.a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(31, 107, 90, 0.16) 0%, transparent 70%);
}

.unlock-blob.b {
  width: 320px;
  height: 320px;
  bottom: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(196, 122, 44, 0.14) 0%, transparent 70%);
}

.unlock-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem 1.6rem;
  text-align: center;
}

.unlock-icon {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.unlock-card .eyebrow {
  margin-bottom: 0.35rem;
}

.unlock-card h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.unlock-lede {
  margin: 0 0 1.35rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.unlock-form {
  text-align: left;
}

.unlock-form label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.unlock-form input[type="text"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.unlock-form input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 107, 90, 0.15);
}

.unlock-error {
  margin: 0.65rem 0 0;
  color: #b42318;
  font-size: 0.88rem;
  font-weight: 650;
  text-align: center;
}

.unlock-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 1rem;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.unlock-submit:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.unlock-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.unlock-note {
  margin: 1.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.unlock-offline {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(196, 122, 44, 0.28);
  font-size: 0.82rem;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
}

.unlock-offline[hidden] {
  display: none !important;
}

.unlock-preview-btn {
  margin-top: 0.65rem;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand-deep);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}

.unlock-preview-btn:hover {
  background: var(--brand-soft);
}

.unlock-loading-inner {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.unlock-loading-dot {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: var(--brand-soft);
  animation: unlock-pulse 1.1s ease-in-out infinite;
}

@keyframes unlock-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

/* Unlock gate reduced-motion extras (calc block already has Take 3 reduce) */
@media (prefers-reduced-motion: reduce) {
  .unlock-loading-dot {
    animation: none !important;
    transition: none !important;
  }
  .unlock-submit:hover:not(:disabled) {
    transform: none;
  }
}
