/* Soft Romance Product - CalcLaboratory Love Calculator */

:root {
  --pink: #ff4d6d;
  --pink-dark: #e63956;
  --rose: #ff8fa3;
  --rose-soft: #ffb3c1;
  --blush: #fff0f3;
  --blush-deep: #ffe4ea;
  --cream: #fff7f9;
  --ink: #2b1a1f;
  --muted: #7a6a6e;
  --line: #ffd9e0;
  --card: #ffffff;
  --good: #1faa59;
  --shadow: 0 12px 40px -14px rgba(230, 57, 86, 0.38);
  --shadow-soft: 0 6px 24px -10px rgba(230, 57, 86, 0.22);
  --ring-track: #ffe0e6;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --radius-card: 24px;
  --radius-input: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #ffe8ee 0%, transparent 55%),
    radial-gradient(800px 400px at 100% 20%, #fff0f5 0%, transparent 50%),
    var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a {
  color: var(--pink-dark);
}

.wrap {
  /* Mobile-first: full usable width with comfortable gutters */
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}

/* Tool stage: breathe on tablet/desktop; phones stay edge-to-edge with gutters */
.wrap.tool-stage {
  max-width: 1080px;
}

/* SEO / footer reading column stays a bit narrower for line length */
.wrap.seo-zone,
.site-header .wrap,
footer .wrap {
  max-width: 720px;
}

@media (min-width: 768px) {
  .wrap.tool-stage {
    padding-left: 28px;
    padding-right: 28px;
  }

  .calc-card {
    padding: 32px 36px 36px;
  }

  .hero .sub {
    max-width: 640px;
  }

  .hero h1 {
    font-size: clamp(2rem, 3.2vw, 2.6rem);
  }
}

@media (min-width: 1024px) {
  .wrap.tool-stage {
    padding-left: 40px;
    padding-right: 40px;
  }

  .calc-card {
    padding: 36px 48px 40px;
  }

  .fields {
    gap: 20px;
  }

  .field input {
    padding: 18px 18px;
    font-size: 1.18rem;
  }

  .btn-primary {
    padding: 18px 24px;
    font-size: 1.18rem;
  }
}

/* Header */
.site-header {
  padding: 16px 0 8px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--pink-dark);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  font-size: 1.35rem;
  line-height: 1;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 8px 0 14px;
}

.hero h1 {
  font-size: clamp(1.65rem, 5vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero .sub {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Calculator card */
.calc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 22px 20px 24px;
  margin-bottom: 20px;
}

.calc-card h2.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .fields {
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: end;
  }
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  padding: 16px 16px;
  font-size: 1.12rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--blush);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: #b89aa2;
  font-weight: 500;
}

.field input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.18);
}

.heart-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--pink);
  padding: 4px 0 0;
}

@media (min-width: 640px) {
  .heart-mid {
    padding-bottom: 14px;
  }
}

.err {
  color: var(--pink-dark);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 1.25em;
  margin-top: 12px;
  text-align: center;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: none;
  border-radius: 999px;
  padding: 17px 20px;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(180deg, var(--pink), var(--pink-dark));
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(255, 77, 109, 0.45);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* Calculating state */
.calc-status {
  display: none;
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.calc-status.show {
  display: block;
}

.calc-status .pulse {
  display: inline-block;
  animation: heartbeat 0.9s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.2); }
}

/* Result panel */
.result {
  display: none;
  margin-top: 22px;
  text-align: center;
}

.result.show {
  display: block;
  animation: resultIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes resultIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.result-names {
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 18px;
  color: var(--ink);
}

.result-names .heart {
  color: var(--pink);
  margin: 0 6px;
}

/* Animated ring */
.ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 8px;
}

.ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 12;
}

.ring-progress {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502.65;
  stroke-dashoffset: 502.65;
  transition: stroke-dashoffset 1.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-pct {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--pink-dark);
  line-height: 1;
  letter-spacing: -0.03em;
}

.ring-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 4px;
}

.verdict {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 10px 0 6px;
  color: var(--ink);
}

.verdict-tip {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 360px;
  margin: 0 auto 20px;
}

/* Four metrics */
.metrics {
  display: grid;
  gap: 12px;
  text-align: left;
  margin: 0 0 22px;
  padding: 16px;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.metric-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--pink-dark);
}

.metric-bar {
  grid-column: 1 / -1;
  height: 8px;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.metric-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-soft), var(--pink));
  transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Share card */
.share-card {
  background: linear-gradient(160deg, #fff 0%, var(--blush) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.share-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.share-caption {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--pink-dark);
  background: var(--blush);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.btn-secondary:hover {
  border-color: var(--pink);
  background: #ffe8ee;
  transform: translateY(-1px);
}

.btn-secondary:focus-visible {
  outline: 3px solid rgba(255, 77, 109, 0.4);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--blush);
  border-color: var(--line);
  color: var(--pink-dark);
}

/* History */
.history {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.history h3 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 10px;
}

.history-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  color: inherit;
  transition: border-color 0.12s ease;
}

.history-item:hover {
  border-color: var(--pink);
}

.history-pair {
  font-weight: 650;
  font-size: 0.92rem;
}

.history-score {
  font-weight: 800;
  color: var(--pink-dark);
  font-size: 0.95rem;
  white-space: nowrap;
}

.history-empty {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Content sections */
section {
  margin: 28px 0;
}

section h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

section h3 {
  font-size: 1.05rem;
  margin: 16px 0 6px;
}

section p {
  margin-bottom: 12px;
  color: #43343a;
}

.tiers {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.tier {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.tier .b {
  font-weight: 800;
  color: var(--pink-dark);
  min-width: 74px;
  flex-shrink: 0;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 16px;
  margin-bottom: 10px;
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
  padding: 12px 0;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--pink);
}

.faq details[open] summary::after {
  content: "-";
}

.faq p {
  padding-bottom: 12px;
  margin: 0;
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.related a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.related a:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
}

.disclaimer {
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--muted);
}



footer {
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding: 24px 0 calc(24px + var(--safe-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin-bottom: 10px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--pink-dark);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- FlameCalc / Share-Ritual additions --- */

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin: 14px 0 18px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.trust-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trust-chips .ok {
  color: var(--pink-dark);
  font-weight: 800;
}

.companion {
  margin: 0 0 18px;
}

.companion-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}

.companion-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.companion-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.companion-chip:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
}

.tool-stage {
  /* Sacred tool zone: first viewport owns the interaction */
  padding-bottom: 8px;
}

.share-preview {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #fff;
  font-size: 0.8rem;
  color: var(--muted);
}

.share-preview strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.og-mock {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff5f7, #ffe4ea);
  border: 1px solid var(--line);
}

.og-mock-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--pink-dark);
  line-height: 1;
  min-width: 64px;
  text-align: center;
}

.og-mock-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.og-mock-meta .pair {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.88rem;
}

.result-url {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

.result-url code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  background: var(--blush);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--pink-dark);
}

.seo-zone {
  /* Content / future ad zone starts after tool + result */
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.ad-stub {
  margin: 22px 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.tone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 4px;
}

.tone-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
}

.tone-btn[aria-pressed="true"] {
  border-color: var(--pink);
  background: var(--blush);
  color: var(--pink-dark);
}

.ring-wrap.high-glow .ring-progress {
  filter: drop-shadow(0 0 8px rgba(240, 198, 116, 0.55));
}

.confetti-burst {
  pointer-events: none;
  position: absolute;
  inset: -20px;
  overflow: hidden;
  border-radius: 50%;
}

.confetti-burst i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  opacity: 0;
}

@keyframes confettiPop {
  0% { transform: translate(0, 0) scale(0); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1); opacity: 0; }
}

/* Partner strip (Peptorian) quiet, below content, before footer */
.partner-strip {
  margin: 28px auto 8px;
  max-width: 1080px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}

.partner-strip .partner-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}

.partner-strip a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  line-height: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}

.partner-strip a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.partner-strip img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
}
