/* ============================================================
   SmartPropFact — marketing site
   Aesthetic: "the ledger, elevated" — washi paper, sumi ink,
   hanko vermillion, surplus green. Mincho display + gothic body.
   Hand-rolled, mobile-first, zero CDN dependencies.
   ============================================================ */

:root {
  --paper:      #faf6ef;
  --paper-deep: #f2ecdf;
  --ink:        #1c2430;
  --ink-2:      #2a3444;
  --ink-soft:   #5b6472;
  --line:       #ddd4c2;
  --line-soft:  #e9e2d3;
  --red:        #c73a2b;   /* hanko vermillion — brand/CTA only, never money */
  --red-deep:   #a92f22;
  --green:      #0e7a5a;   /* 黒字 surplus green — refund figures */
  --green-deep: #0b6349;   /* darker green for small text on --green-soft (≥4.5:1) */
  --green-soft: #e3f0ea;
  --white:      #ffffff;

  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;

  --maxw: 1080px;
}

html[lang="en"] {
  --serif: "Iowan Old Style", "Palatino", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  /* clip (not hidden): hidden creates a scroll container and breaks
     position: sticky on the header */
  overflow-x: clip;
}

/* washi grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.38 0 0 0 0 0.30 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* lift content above the fixed grain overlay; the header handles its own
   stacking (position: sticky + z-index below) */
main, footer { position: relative; z-index: 1; }

img { max-width: 100%; }
a { color: inherit; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.01em;
}

/* ---------- reveals ----------
   Hidden initial states are scoped to .js (set by an inline <script> in
   <head>) so the full page renders when JavaScript is unavailable. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="2"].is-visible { transition-delay: 0.12s; }
[data-reveal="3"].is-visible { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
/* ?static=1 QA mode (set by countup.js) */
html.static-mode [data-reveal] { opacity: 1; transform: none; transition: none; }
html.static-mode #loop-demo .loop-receipt { opacity: 1; transform: rotate(-2deg); animation: none; }
html.static-mode #loop-demo .loop-delta { opacity: 1; transform: none; animation: none; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.28em;
  background: var(--red);
  border-radius: 1px;
  transform: rotate(45deg) translateY(-1px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.86rem;
}
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--red); }
.site-nav .nav-anchor { display: none; }
@media (min-width: 640px) {
  .site-nav .nav-anchor { display: inline; }
}

.lang-link {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 9px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.btn-login {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 7px 16px;
  border-radius: 3px;
  font-weight: 600;
}
.btn-login:hover { background: var(--ink-2); color: var(--paper); }

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

.btn-primary {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 15px 34px;
  border-radius: 4px;
  box-shadow: 0 4px 0 var(--red-deep);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--red-deep);
}
.btn-note {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ============================================================
   Section chrome — ledger rules + section numerals
   ============================================================ */

section { padding: 72px 0; }
@media (min-width: 768px) { section { padding: 100px 0; } }

.sec-head { margin-bottom: 44px; }
.sec-no {
  font-family: var(--serif);
  color: var(--red);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  display: block;
  margin-bottom: 10px;
}
.sec-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.55rem, 4.5vw, 2.3rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.sec-lede {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 38em;
}
/* double ledger rule */
.sec-head::after {
  content: "";
  display: block;
  margin-top: 22px;
  height: 5px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

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

.hero {
  padding: 64px 0 80px;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(199, 58, 43, 0.05), transparent 60%),
    radial-gradient(50rem 26rem at -10% 110%, rgba(14, 122, 90, 0.06), transparent 60%);
}
@media (min-width: 768px) { .hero { padding: 96px 0 110px; } }

.hero-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--red);
  vertical-align: middle;
  margin-right: 12px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 6vw, 3.3rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
  max-width: 21em;
}

.hero-number-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 34px 0 6px;
  flex-wrap: wrap;
}

.hero-number {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--green);
  font-size: clamp(3.2rem, 12vw, 6.2rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

/* hanko-style "例" seal — the integrity mark */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5em;
  height: 2.5em;
  border: 2px solid var(--red);
  border-radius: 4px;
  color: var(--red);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.95rem;
  transform: rotate(-6deg);
  margin-bottom: 0.6em;
  flex: none;
  user-select: none;
}

.hero-caveat {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.hero-sub {
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  max-width: 30em;
  margin-bottom: 34px;
}

/* ============================================================
   Mockups — stylized UI facsimiles (clearly illustrations)
   ============================================================ */

.mock {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(28, 36, 48, 0.08);
  overflow: hidden;
  position: relative;
}
.mock-label {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 6px;
  background: var(--paper);
  z-index: 2;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--paper);
}
.mock-bar i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}
.mock-body { padding: 16px; }

.mock-band {
  background: var(--green-soft);
  border: 1px solid rgba(14, 122, 90, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.mock-band small {
  display: block;
  font-size: 0.68rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.mock-band strong {
  font-family: var(--serif);
  color: var(--green);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.mock-doc {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dotted var(--line);
  font-size: 0.8rem;
}
.mock-doc:last-child { border-bottom: 0; }
.mock-doc .tag {
  font-size: 0.7rem;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 2px;
  padding: 1px 6px;
  margin-right: 6px;
}
.mock-doc .amt { color: var(--ink-2); }

/* ============================================================
   How it works
   ============================================================ */

.steps {
  display: grid;
  gap: 40px;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}

.step-no {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--red);
  line-height: 1;
}
.step h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 10px 0 8px;
  letter-spacing: 0.03em;
}
.step p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 18px; }

.step .mock { min-height: 190px; }

/* small illustrative shapes inside step mocks */
.mock-photo {
  border: 2px dashed var(--line);
  border-radius: 8px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}
.mock-photo .lens {
  width: 34px; height: 34px;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  position: relative;
}
.mock-photo .lens::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--line);
}

/* ============================================================
   Loop demo
   ============================================================ */

.loop-wrap { background: var(--paper-deep); }

.loop-stage {
  display: grid;
  gap: 22px;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .loop-stage { grid-template-columns: 1fr auto 1.2fr; gap: 30px; }
}

.loop-receipt {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  max-width: 280px;
  box-shadow: 0 10px 24px rgba(28, 36, 48, 0.1);
  position: relative;
  font-size: 0.85rem;
}
/* perforated receipt edge */
.loop-receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 6px;
  background: radial-gradient(circle at 6px -2px, transparent 6px, var(--white) 6px);
  background-size: 14px 8px;
}
.loop-receipt h4 {
  font-family: var(--serif);
  letter-spacing: 0.25em;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 10px;
}
.loop-receipt .row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted var(--line);
  padding: 5px 0;
}
.loop-receipt .row:last-child { border-bottom: 0; }

.loop-arrow {
  font-size: 1.5rem;
  color: var(--red);
  text-align: center;
  transform: rotate(90deg);
}
@media (min-width: 768px) { .loop-arrow { transform: none; } }

.loop-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 26px;
  box-shadow: 0 14px 34px rgba(28, 36, 48, 0.08);
  position: relative;
}
.loop-panel small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.loop-amount {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--green);
  font-size: clamp(2rem, 7vw, 2.9rem);
  line-height: 1.1;
}
.loop-delta {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 3px;
  padding: 2px 8px;
}

/* animation states — hidden initial states scoped to .js so the demo
   renders in its final state when JavaScript is unavailable */
.js #loop-demo .loop-receipt {
  opacity: 0;
  transform: translateY(-18px) rotate(-2deg);
}
.js #loop-demo .loop-delta {
  opacity: 0;
  transform: translateY(6px);
}
#loop-demo.play .loop-receipt {
  animation: receipt-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}
#loop-demo.play .loop-delta {
  animation: delta-pop 0.5s ease 1.5s forwards;
}
@keyframes receipt-in {
  to { opacity: 1; transform: translateY(0) rotate(-2deg); }
}
@keyframes delta-pop {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .js #loop-demo .loop-receipt { opacity: 1; transform: rotate(-2deg); animation: none; }
  .js #loop-demo .loop-delta { opacity: 1; transform: none; animation: none; }
}

.loop-caption {
  margin-top: 30px;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  letter-spacing: 0.03em;
}
.loop-caption em {
  font-style: normal;
  color: var(--green);
}

/* ============================================================
   Year-end (PDF payoff)
   ============================================================ */

.yearend-grid {
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 860px) {
  .yearend-grid { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}

.pdf-mock {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(28, 36, 48, 0.12);
  padding: 26px 24px 48px;
  position: relative;
  transform: rotate(1.2deg);
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.pdf-mock::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
}
.pdf-mock h4 {
  font-family: var(--serif);
  text-align: center;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0.35em;
  margin-bottom: 14px;
}
.pdf-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding: 5px 2px;
}
.pdf-row.total {
  border-bottom: 3px double var(--ink);
  color: var(--ink);
  font-weight: 700;
}
.pdf-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 6px;
  background: var(--paper);
}

.yearend-copy .formats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.chip {
  font-size: 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  background: var(--white);
}

/* ============================================================
   Trust — dark ink section
   ============================================================ */

.trust {
  background: var(--ink);
  color: var(--paper);
}
.trust .sec-no { color: #e58a7d; }
.trust .sec-head::after {
  border-top-color: var(--paper);
  border-bottom-color: rgba(250, 246, 239, 0.25);
}
.trust .sec-lede { color: rgba(250, 246, 239, 0.75); }

.trust-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 640px) { .trust-grid { grid-template-columns: 1fr 1fr; } }

.trust-card {
  border: 1px solid rgba(250, 246, 239, 0.18);
  border-radius: 8px;
  padding: 24px 22px;
  background: rgba(250, 246, 239, 0.04);
}
.trust-card h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.trust-card h3::before {
  content: "◆";
  color: #e58a7d;
  font-size: 0.7em;
  margin-right: 9px;
  vertical-align: 2px;
}
.trust-card p {
  font-size: 0.88rem;
  color: rgba(250, 246, 239, 0.78);
}

/* ============================================================
   Pricing
   ============================================================ */

.pricing-grid {
  display: grid;
  gap: 20px;
  align-items: stretch;
}
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }

.plan {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.plan.featured {
  border: 2px solid var(--red);
  box-shadow: 0 18px 40px rgba(199, 58, 43, 0.12);
}
.plan-flag {
  position: absolute;
  top: -13px;
  left: 24px;
  background: var(--red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  border-radius: 3px;
  padding: 3px 12px;
}
.plan h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.plan-price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1.15;
}
.plan-price .per {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-soft);
  font-family: var(--sans);
}
.plan-monthly {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 4px 0 20px;
  min-height: 1.4em;
}
.plan ul {
  list-style: none;
  font-size: 0.88rem;
  border-top: 1px solid var(--line-soft);
  margin-bottom: 22px;
  flex: 1;
}
.plan ul li {
  padding: 9px 2px;
  border-bottom: 1px dotted var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.plan ul li .v { font-weight: 700; }
.plan-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 11px 0;
  font-weight: 700;
  font-size: 0.92rem;
}
.plan-cta:hover { background: var(--paper-deep); }
.plan.featured .plan-cta {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  box-shadow: 0 3px 0 var(--red-deep);
}
.plan.featured .plan-cta:hover { background: var(--red-deep); }

.pricing-notes {
  margin-top: 28px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.pricing-notes p { margin-bottom: 6px; }
.pricing-notes .frame {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  margin-top: 14px;
}

/* ============================================================
   EN / JA strip
   ============================================================ */

.lang-strip {
  background: var(--paper-deep);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 52px 0;
}
.lang-strip .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.lang-strip h2 {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  letter-spacing: 0.02em;
  max-width: 22em;
}
.lang-strip p { font-size: 0.9rem; color: var(--ink-soft); margin-top: 6px; }
.strip-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 11px 26px;
  white-space: nowrap;
  background: var(--white);
}
.strip-link:hover { background: var(--paper); }
.strip-link::after { content: " →"; color: var(--red); }

/* ============================================================
   FAQ
   ============================================================ */

.faq-list { max-width: 780px; }
.faq-list details {
  border-bottom: 1px solid var(--line);
}
.faq-list summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  padding: 20px 40px 20px 2px;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "＋";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-size: 1rem;
}
.faq-list details[open] summary::after { content: "－"; }
.faq-list .faq-a {
  padding: 0 2px 24px;
  font-size: 0.92rem;
  color: var(--ink-2);
  max-width: 44em;
}
.faq-list .faq-a p + p { margin-top: 10px; }

/* ============================================================
   Final CTA + footer
   ============================================================ */

.final-cta { text-align: center; }
.final-cta h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  letter-spacing: 0.03em;
  margin-bottom: 28px;
}

.site-footer {
  background: var(--ink);
  color: rgba(250, 246, 239, 0.7);
  padding: 44px 0;
  font-size: 0.82rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.site-footer .wordmark { color: var(--paper); font-size: 1rem; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: rgba(250, 246, 239, 0.7); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
