/* ==========================================================================
   収益化研究所 / Monetization Lab
   Design: a quiet observatory. Deep green void, one moving light,
   large Japanese type, small instrument labels.
   ========================================================================== */

:root {
  color-scheme: dark;

  --ink:        #04120c;
  --ink-2:      #071b12;
  --ink-3:      #0a2418;

  --fg:         #eef6f1;
  --fg-dim:     #9db3a8;
  --fg-faint:   #5f7a6d;

  --em:         #35e39c;
  --em-deep:    #14b877;
  --em-veil:    rgba(53, 227, 156, 0.12);

  --line:       rgba(255, 255, 255, 0.09);
  --line-soft:  rgba(255, 255, 255, 0.05);

  --shell:      min(1180px, 100% - 2.5rem);
  --gutter:     clamp(1.25rem, 4vw, 2rem);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas,
          "Roboto Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--em);
  color: #04120c;
}

:focus-visible {
  outline: 2px solid var(--em);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

/* --- small instrument label ------------------------------------------------ */

.label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0;
}

.label--em { color: var(--em); }

/* latin-only fragments inside Japanese sentences */
.mono {
  font-family: var(--mono);
  letter-spacing: 0.14em;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  padding: clamp(1.1rem, 3vw, 1.75rem) 0;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-mark {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--em);
  box-shadow: 0 0 0 4px rgba(53, 227, 156, 0.14);
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}

.site-nav a {
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.site-nav a:hover { color: var(--em); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 7.5rem 0 5rem;
  isolation: isolate;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  display: block;
}

/* soft emerald bloom behind the headline + vignette */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  pointer-events: none;
}

.hero::before {
  left: -10%;
  top: 20%;
  width: 70%;
  height: 60%;
  background: radial-gradient(closest-side, rgba(53, 227, 156, 0.16), transparent 100%);
  filter: blur(20px);
}

.hero::after {
  inset: 0;
  background:
    radial-gradient(125% 95% at 50% 0%, transparent 42%, rgba(4, 18, 12, 0.72) 100%),
    linear-gradient(180deg, transparent 62%, var(--ink) 100%);
}

.hero-inner { max-width: 62rem; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 27, 18, 0.5);
  backdrop-filter: blur(6px);
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--em);
  box-shadow: 0 0 8px var(--em);
  animation: pulse 2.6s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.35rem, 7.4vw, 5.5rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.br-sp { display: none; }

.hero h1 .glow {
  background: linear-gradient(100deg,
              var(--fg) 20%, var(--em) 42%, #b9ffe0 50%, var(--em) 58%, var(--fg) 80%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sweep 11s linear infinite;
}

@keyframes sweep {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.hero-lead {
  margin: clamp(1.5rem, 4vw, 2rem) 0 0;
  max-width: 34em;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  line-height: 2;
  color: var(--fg-dim);
  word-break: auto-phrase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
}

/* ghosted wordmark cropped by the viewport edge */
.hero-ghost {
  position: absolute;
  left: 50%;
  bottom: -0.14em;
  transform: translateX(-50%);
  z-index: -1;
  margin: 0;
  font-size: clamp(2.25rem, 9.5vw, 9rem);
  font-weight: 700;
  line-height: 0.8;
  white-space: nowrap;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.055);
  pointer-events: none;
  user-select: none;
}

.scroll-cue {
  position: absolute;
  right: clamp(1.25rem, 4vw, 2.25rem);
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  color: var(--fg-faint);
}

.scroll-cue span::after {
  content: "";
  display: block;
  width: 1px;
  height: 34px;
  margin-inline: auto;
  background: linear-gradient(var(--em), transparent);
  animation: drop 2.4s var(--ease) infinite;
}

@keyframes drop {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-bd: var(--line);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  min-height: 3rem;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px rgba(53, 227, 156, 0.5);
}

.btn--primary {
  --btn-bg: var(--em);
  --btn-fg: #04120c;
  --btn-bd: var(--em);
}

.btn--primary:hover { --btn-bg: #4bf0ac; }

.btn--ghost:hover {
  --btn-bd: rgba(53, 227, 156, 0.55);
  --btn-bg: rgba(53, 227, 156, 0.07);
}

.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) 0;
  isolation: isolate;
}

/* hairline that catches a little light in the middle */
.section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg,
              transparent, rgba(53, 227, 156, 0.28) 50%, transparent);
}

/* one soft light source per section keeps the page from going flat */
.section::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -6rem;
  left: -8%;
  width: 46%;
  height: 22rem;
  background: radial-gradient(closest-side, rgba(53, 227, 156, 0.075), transparent 100%);
  pointer-events: none;
}

.section:nth-of-type(even)::after { left: auto; right: -8%; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 3.75rem);
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.section-head .rule {
  flex: 1 1 4rem;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  transform: translateY(-0.4em);
}

/* --------------------------------------------------------------------------
   Experiment log
   -------------------------------------------------------------------------- */

.log { border-top: 1px solid var(--line-soft); }

.exp {
  position: relative;
  display: grid;
  grid-template-columns: 10.5rem 1fr 7rem;
  gap: 1.5rem;
  align-items: start;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(0.5rem, 2vw, 1.25rem);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.4s var(--ease);
}

.exp::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--em);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--ease);
}

.exp:hover { background: rgba(53, 227, 156, 0.035); }
.exp:hover::before { transform: scaleY(1); }

.exp-id {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  padding-top: 0.5rem;
}

.exp-name {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.exp-cat {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--em);
}

.exp-cat .mono { font-size: 0.75rem; }

.exp-note {
  margin: 0.9rem 0 0;
  max-width: 40em;
  color: var(--fg-dim);
  font-size: 0.9375rem;
}

/* --- experiment status ---------------------------------------------------
   Three states, used everywhere an experiment appears:
     TESTING   検証中          — currently being used and checked
     VERIFIED  検証済み        — finished, results published as an article
     ARCHIVED  記録終了        — no longer tracked
   Never mark an experiment VERIFIED before its article exists.
   -------------------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  white-space: nowrap;
  margin-top: 0.4rem;
}

.status .dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

/* 検証中 — a live, pulsing signal */
.status--testing {
  color: var(--em);
  border-color: rgba(53, 227, 156, 0.32);
}

.status--testing .dot {
  box-shadow: 0 0 8px var(--em);
  animation: pulse 2.6s var(--ease) infinite;
}

/* 検証済み — settled, filled, no motion */
.status--verified {
  color: #04120c;
  background: var(--em);
  border-color: var(--em);
}

/* 記録終了 — receded */
.status--archived {
  color: var(--fg-faint);
  border-color: var(--line-soft);
}

.status--archived .dot { background: none; box-shadow: inset 0 0 0 1px currentColor; }

/* --- verified result block (shown once an article exists) ----------------- */

.exp-result {
  margin-top: 1.25rem;
  padding: 1.15rem 1.35rem;
  border-left: 2px solid var(--em);
  background: rgba(53, 227, 156, 0.05);
  border-radius: 0 8px 8px 0;
}

.exp-result-label {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--em);
}

.exp-result-text {
  margin: 0;
  max-width: 42em;
  color: var(--fg);
  font-size: 0.9375rem;
  word-break: auto-phrase;
}

.exp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--em);
  transition: gap 0.3s var(--ease);
}

.exp-link:hover { gap: 0.75rem; text-decoration: none; }

.log-foot {
  margin: 2rem 0 0;
  color: var(--fg-dim);
  font-size: 0.875rem;
  word-break: auto-phrase;
}

/* link through to the full archive */
.log-more {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(53, 227, 156, 0.35);
  font-size: 1rem;
  font-weight: 600;
  color: var(--em);
  transition: gap 0.3s var(--ease), border-color 0.3s var(--ease);
}

.log-more:hover {
  gap: 0.95rem;
  border-color: var(--em);
  text-decoration: none;
}

.log-note {
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  max-width: 44em;
  color: var(--fg-faint);
  font-size: 0.8125rem;
  line-height: 1.95;
  word-break: auto-phrase;
}

/* --------------------------------------------------------------------------
   Method
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.step {
  background: var(--ink);
  padding: clamp(1.75rem, 3.5vw, 2.5rem) clamp(1.25rem, 2.5vw, 1.75rem);
  transition: background 0.4s var(--ease);
}

.step:hover { background: var(--ink-2); }

.step-n {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  color: var(--em);
}

.step h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
}

.step p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--fg-dim);
  line-height: 1.9;
}

/* --------------------------------------------------------------------------
   Stance
   -------------------------------------------------------------------------- */

.stance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 4vw, 2.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.stance li {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 0.9375rem;
}

.stance strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--fg);
  font-size: 1.0625rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Content pages (about / privacy / affiliate-policy / 404)
   -------------------------------------------------------------------------- */

.page-head {
  position: relative;
  isolation: isolate;
  padding: clamp(8rem, 18vw, 11rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

/* archive header carries the field too, so /lab feels like the same room */
.page-head--field { padding-bottom: clamp(3.5rem, 8vw, 5rem); }

.page-head--field::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, transparent 45%, var(--ink) 100%);
}

.page-head-lead {
  margin: 1.25rem 0 0;
  max-width: 34em;
  color: var(--fg-dim);
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  word-break: auto-phrase;
}

.page-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: clamp(1.75rem, 4vw, 2.25rem) 0 0;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 27, 18, 0.5);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
}

.page-head-meta strong {
  color: var(--em);
  font-weight: 700;
}

.page-head::after {
  content: "";
  position: absolute;
  left: -5%;
  top: 30%;
  width: 55%;
  height: 70%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(53, 227, 156, 0.11), transparent 100%);
}

.page-head h1 {
  margin: 0.85rem 0 0;
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.35;
}

.page-content {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(5rem, 12vw, 7rem);
}

.page-content .prose { max-width: 44rem; }

.page-content h2 {
  margin: clamp(2.75rem, 6vw, 3.5rem) 0 1rem;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.6;
}

.page-content h2:first-child { margin-top: 0; }

.page-content p,
.page-content li {
  color: var(--fg-dim);
  font-size: 0.9375rem;
}

.page-content ul { padding-left: 1.15rem; }
.page-content li { margin-bottom: 0.6rem; }

.page-content a {
  color: var(--em);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(53, 227, 156, 0.4);
  transition: text-decoration-color 0.25s var(--ease);
}

.page-content a:hover { text-decoration-color: var(--em); }

/* buttons inside prose keep their own colours */
.page-content a.btn {
  color: var(--btn-fg);
  text-decoration: none;
}

.updated {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-cta { margin: clamp(2.25rem, 5vw, 3rem) 0 0; }

.contact-cta .btn { font-size: 1rem; }

.contact-pending {
  margin: clamp(2.25rem, 5vw, 3rem) 0 0;
  padding: 1.15rem 1.35rem;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
}

.contact-meta {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--fg-faint);
  word-break: auto-phrase;
}

@media (max-width: 720px) {
  .contact-cta .btn { width: 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--ink-2);
  padding: clamp(3.5rem, 8vw, 5rem) 0 clamp(2.5rem, 5vw, 3rem);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
}

.footer-links {
  display: flex;
  gap: clamp(1.1rem, 3vw, 2rem);
  flex-wrap: wrap;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
}

.footer-links a { transition: color 0.25s var(--ease); }
.footer-links a:hover { color: var(--em); }

.affiliate-notice {
  margin: clamp(2rem, 5vw, 2.5rem) 0 0;
  max-width: 48em;
  font-size: 0.8125rem;
  line-height: 1.95;
  color: var(--fg-faint);
}

.affiliate-notice a {
  color: var(--fg-dim);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--line);
}

.affiliate-notice a:hover { color: var(--em); }

.copyright {
  margin: 1.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}

/* --------------------------------------------------------------------------
   Reveal on scroll (only armed when JS runs)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .br-sp { display: inline; }
  .exp {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-inline: 0;
  }
  .exp-id { padding-top: 0; }
  .status { justify-self: start; margin-top: 0.25rem; }
  .hero { padding-top: 8.5rem; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
  .site-header .shell { gap: 0.75rem; }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .site-nav { gap: 0.75rem; font-size: 0.75rem; letter-spacing: 0; }
  .brand { font-size: 0.875rem; gap: 0.45rem; }
  .scroll-cue { display: none; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
