/* ============================================================
   DoRealAdvice Tools — Shared Design System
   Aligned with DoSwiss Japan brand (Swiss red + charcoal)
   Editorial, refined, distinctly Swiss-Japanese
   ============================================================ */

:root {
  /* Brand — from DoSwiss letterhead */
  --swiss-red: #D01010;
  --swiss-red-dark: #A80A0A;
  --swiss-red-soft: #FCEAEA;
  --charcoal: #2B2B2B;
  --charcoal-soft: #4A4A4A;
  --charcoal-light: #6B6B6B;

  /* Neutrals — warm, paper-like */
  --paper: #FAF8F5;
  --paper-dark: #F2EEE8;
  --ink: #1A1A1A;
  --rule: #E5DFD6;
  --rule-strong: #C9C0B2;

  /* Accents — subtle */
  --gold: #A88B3A;
  --sumi: #1C1C1C;  /* Japanese ink */

  /* Functional */
  --ok: #2D7A4F;
  --warn: #B8731C;
  --err: var(--swiss-red);

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);

  --t: 180ms cubic-bezier(0.2, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HEADER ================= */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background: rgba(255,255,255,0.92);
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  position: relative;
}

.brand-mark-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--swiss-red);
  border-radius: 3px;
}

.brand-mark-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 18%;
  background: #fff;
  box-shadow: 0 0 0 0 #fff;
}

.brand-mark-icon svg {
  position: relative;
  z-index: 2;
  color: #fff;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-wordmark .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-wordmark .brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--charcoal-light);
  margin-top: 4px;
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  color: var(--charcoal-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--t);
}
.site-nav a:hover { color: var(--swiss-red); }

.cta-button {
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-md);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--t);
  border: none;
  cursor: pointer;
}
.cta-button:hover { background: var(--swiss-red); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ================= MAIN LAYOUT ================= */
.page {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.tool-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.tool-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 72px;
  height: 2px;
  background: var(--swiss-red);
}

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--swiss-red);
  font-weight: 600;
  margin-bottom: 12px;
}

h1.tool-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 800px;
}

.tool-lede {
  font-size: 17px;
  color: var(--charcoal-soft);
  max-width: 680px;
  line-height: 1.55;
}

/* ================= CARDS ================= */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ================= FORM ================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--charcoal-light);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--swiss-red);
  box-shadow: 0 0 0 3px var(--swiss-red-soft);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
  line-height: 1.55;
}

.hint {
  font-size: 12.5px;
  color: var(--charcoal-light);
  margin-top: 4px;
}

button.btn-primary {
  background: var(--swiss-red);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button.btn-primary:hover {
  background: var(--swiss-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button.btn-primary:disabled {
  background: var(--rule-strong);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  padding: 11px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
}

button.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--paper-dark);
}

/* ================= RESULT BLOCKS ================= */
.result-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--swiss-red);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin-top: 24px;
}

.result-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--charcoal-soft);
  margin-bottom: 12px;
}

.result-primary {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 8px;
}

.result-meta {
  font-size: 13px;
  color: var(--charcoal-light);
  font-family: var(--font-mono);
}

.result-breakdown {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14.5px;
}
.breakdown-row + .breakdown-row { border-top: 1px dashed var(--rule); }
.breakdown-row .label { color: var(--charcoal-light); }
.breakdown-row .value { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }
.breakdown-row.total { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--ink); }
.breakdown-row.total .value { font-weight: 700; font-size: 16px; color: var(--swiss-red); }

/* ================= CONTENT ================= */
.content-block {
  max-width: 780px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--charcoal-soft);
}

.content-block h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--ink);
  margin: 40px 0 14px;
  letter-spacing: -0.015em;
}

.content-block h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  margin: 28px 0 10px;
}

.content-block p { margin-bottom: 14px; }

.content-block ul, .content-block ol {
  padding-left: 22px;
  margin-bottom: 14px;
}
.content-block li { margin-bottom: 6px; }

.content-block strong { color: var(--ink); font-weight: 600; }

.content-block a {
  color: var(--swiss-red);
  text-decoration: none;
  border-bottom: 1px solid var(--swiss-red-soft);
  transition: border-color var(--t);
}
.content-block a:hover { border-color: var(--swiss-red); }

.callout {
  background: var(--swiss-red-soft);
  border-left: 3px solid var(--swiss-red);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.callout-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--swiss-red-dark);
  margin-bottom: 6px;
}
.callout p { margin: 0; font-size: 15px; color: var(--charcoal); }

/* ================= FAQ ================= */
.faq {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

details {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
details[open] summary { color: var(--swiss-red); }

summary {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color var(--t);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-size: 22px;
  color: var(--charcoal-light);
  font-weight: 300;
  line-height: 1;
  transition: transform var(--t);
}
details[open] summary::after { transform: rotate(45deg); }

details > div {
  padding-top: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--charcoal-soft);
}

/* ================= UPSELL ================= */
.upsell {
  background: linear-gradient(135deg, var(--ink) 0%, var(--charcoal) 100%);
  color: #fff;
  padding: 40px 44px;
  border-radius: var(--r-lg);
  margin: 48px 0;
  position: relative;
  overflow: hidden;
}

.upsell::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: var(--swiss-red);
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(20px);
}

.upsell-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--swiss-red);
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
}

.upsell h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: #fff;
  position: relative;
}

.upsell p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
  font-size: 15.5px;
  max-width: 560px;
  position: relative;
}

.upsell .cta-button {
  background: var(--swiss-red);
  position: relative;
}
.upsell .cta-button:hover { background: var(--swiss-red-dark); }

/* ================= RELATED TOOLS ================= */
.related {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.related-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--ink);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-card .tag {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--swiss-red);
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.tool-card p {
  font-size: 13.5px;
  color: var(--charcoal-light);
  line-height: 1.5;
}

/* ================= FOOTER ================= */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 48px 32px 28px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: #fff;
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h5 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--swiss-red);
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 8px;
  transition: color var(--t);
}
.footer-col a:hover { color: #fff; }

.footer-legal {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.5);
}

/* ================= SPINNER ================= */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= RESPONSIVE ================= */
@media (max-width: 820px) {
  .site-header-inner { padding: 14px 20px; }
  .site-nav { display: none; }
  .page { padding: 32px 20px 60px; }
  .card { padding: 22px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .upsell { padding: 28px 24px; }
}

/* ================= ANIMATION ================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease-out both; }
