/* =============================================================================
   Aegis Boundary — design system
   Worldview: Quiet Boundary Infrastructure
   Inherits Nemotek's neutral ink scale; green is translated from a decorative
   neon accent into a muted state / receipt / boundary-line signal.
   No external runtime, no Tailwind, no build step. Self-contained.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------- */
:root {
  /* Neutral ink scale — inherited verbatim from the Nemotek / Aegis doctrine */
  --ink-950: #050506;
  --ink-900: #0a0a0a;
  --ink-850: #0d0d0f;
  --ink-800: #111113;
  --ink-700: #1a1a1d;
  --ink-600: #26262b;
  --ink-500: #3a3a42;
  --ink-400: #5a5a65;
  --ink-300: #8a8a94;
  --ink-200: #b8b8c0;
  --ink-100: #dedee2;
  --ink-50:  #f5f5f7;

  /* Boundary green — muted emerald. Used ONLY as a state / receipt / line
     signal, never as decoration. Brighter steps are reserved for the single
     "Checked" confirmation moment. */
  --green-900: #0b1f16;
  --green-800: #10291d;
  --green-700: #163d2a;
  --green-600: #1f5638;
  --green-500: #2d6a4f; /* primary trust signal — boundary line, receipt mark */
  --green-400: #40916c;
  --green-300: #74c69d; /* "Boundary Checked" state text on dark */
  --green-200: #95d5b2; /* highlight, used very sparingly */

  /* Aegis-core continuity mark — the inherited neon. Logo glyph ONLY. */
  --aegis-core: #00ff41;

  /* Calm status palette — caution, not alarm. No threat red anywhere. */
  --status-allowed: #74c69d; /* muted green   */
  --status-blocked: #d3a16b; /* muted clay/amber — caution, not danger */
  --status-unknown: #8a8a94; /* neutral grey  */

  /* Surfaces & lines */
  --bg:            var(--ink-900);
  --bg-raised:     #141418;  /* clearly above body — cards must read as panels */
  --bg-raised-2:   #18181d;
  --surface:       rgba(255, 255, 255, 0.022);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --line:          rgba(255, 255, 255, 0.085);
  --line-strong:   rgba(255, 255, 255, 0.15);
  --line-green:    rgba(45, 106, 79, 0.6);

  /* Typography */
  --font-display: "Space Grotesk", Inter, "Noto Sans JP", system-ui, sans-serif;
  --font-sans:    Inter, "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Rhythm — generous, architectural */
  --maxw: 1160px;
  --maxw-narrow: 760px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.8rem, 8vw, 6.75rem);

  --radius: 3px;     /* near-sharp; quiet, not rounded SaaS */
  --radius-lg: 6px;

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

/* ---------------------------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink-100);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle, static vignette — depth without noise. No gradients-as-decoration. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(45, 106, 79, 0.07), transparent 60%),
    radial-gradient(100% 60% at 50% 110%, rgba(0, 0, 0, 0.5), transparent 55%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink-50);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(116, 198, 157, 0.22); color: var(--ink-50); }

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

/* ---------------------------------------------------------------------------
   3. Layout primitives
   --------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}
.wrap--narrow { max-width: var(--maxw-narrow); }

.section { padding-block: var(--section-y); position: relative; z-index: 1; }
.section--tight { padding-block: clamp(3rem, 7vw, 5.5rem); }

.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }
.hairline--strong { border-top-color: var(--line-strong); }

/* ---------------------------------------------------------------------------
   4. Typography helpers
   --------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green-300);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: var(--line-green);
}
.eyebrow--muted { color: var(--ink-300); }
.eyebrow--muted::before { background: var(--line-strong); }

.display {
  font-size: clamp(2.4rem, 5.6vw, 4.3rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -0.025em; }
.h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 500; letter-spacing: -0.02em; }

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-200);
  font-weight: 300;
  max-width: 46ch;
}
.muted { color: var(--ink-300); }
.dim   { color: var(--ink-400); }
.mono  { font-family: var(--font-mono); }
.green { color: var(--green-300); }

/* ---------------------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease),
              transform .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--green-500);
  color: #051810;
  border-color: var(--green-400);
}
.btn--primary:hover { background: var(--green-400); }

.btn--ghost {
  background: transparent;
  color: var(--ink-100);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--green-400); color: var(--green-200); }

.btn--plain {
  background: transparent;
  color: var(--ink-200);
  padding-inline: 0;
}
.btn--plain:hover { color: var(--green-200); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------------------------------------------------------------------------
   6. Navigation
   --------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 10, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand__mark { width: 22px; height: 22px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  color: var(--ink-50);
}
.brand__name span { color: var(--ink-400); font-weight: 400; }

.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.1rem); }
.nav__link {
  font-size: 0.9rem;
  color: var(--ink-300);
  transition: color .2s var(--ease);
}
.nav__link:hover { color: var(--ink-50); }
.nav__cta { margin-left: 0.4rem; }
.nav__lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-400);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius);
}
.nav__lang:hover { color: var(--green-200); border-color: var(--line-green); }
@media (max-width: 760px) {
  .nav__links .nav__link { display: none; }
}

/* ---------------------------------------------------------------------------
   7. Hero
   --------------------------------------------------------------------------- */
.hero { padding-block: clamp(4.5rem, 12vw, 8.5rem) clamp(3.5rem, 8vw, 6rem); }
.hero__inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero__inner { grid-template-columns: 1fr; } }

.hero h1 { margin-top: 1.6rem; text-wrap: nowrap; }
@media (max-width: 480px) { .hero h1 { text-wrap: balance; } }
.hero h1 .line2 { color: var(--green-300); }
.hero__sub { margin-top: 1.8rem; max-width: 40ch; }
.hero__cta { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* Circular trust-signal motif — concentric boundary rings, quietly animated */
.trust-dial { width: 100%; max-width: 360px; margin-inline: auto; aspect-ratio: 1; }
.trust-dial circle { fill: none; }
.trust-dial .ring   { stroke: var(--line-strong); stroke-width: 1; }
.trust-dial .ring-g { stroke: var(--line-green); stroke-width: 1.5; }
.trust-dial .sweep {
  stroke: var(--green-300); stroke-width: 2; stroke-linecap: round;
  transform-origin: center;
  animation: dial-sweep 14s linear infinite;
}
.trust-dial .check { stroke: var(--green-300); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.trust-dial .label { fill: var(--ink-300); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.18em; text-transform: uppercase; }
@keyframes dial-sweep { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   8. State track — Unchecked -> Check-in -> Boundary Checked
   --------------------------------------------------------------------------- */
.track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (max-width: 760px) { .track { grid-template-columns: 1fr; } }
.track__cell { background: var(--bg-raised); padding: clamp(1.6rem, 3vw, 2.4rem); position: relative; }
.track__cell--checked { background: linear-gradient(180deg, rgba(45,106,79,0.10), rgba(45,106,79,0.02)); }
.track__state { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }
.track__cell--unchecked .track__state { color: var(--status-unknown); }
.track__cell--checkin   .track__state { color: var(--ink-100); }
.track__cell--checked   .track__state { color: var(--green-300); }
.track__title { margin: 0.9rem 0 0.6rem; font-size: 1.1rem; }
.track__body { color: var(--ink-300); font-size: 0.96rem; line-height: 1.6; }
.track__cell::after {
  content: "→"; position: absolute; right: -0.6em; top: 50%;
  transform: translateY(-50%); color: var(--ink-500); font-size: 1rem; z-index: 2;
}
.track__cell:last-child::after { content: none; }
@media (max-width: 760px) {
  .track__cell::after { content: "↓"; right: 50%; top: auto; bottom: -0.7em; transform: translateX(50%); }
}

/* ---------------------------------------------------------------------------
   9. Cards / grids
   --------------------------------------------------------------------------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid--3 { grid-template-columns: 1fr; } .grid--2 { grid-template-columns: 1fr; } }

.card { background: var(--bg-raised); padding: clamp(1.5rem, 2.6vw, 2.2rem); transition: background .3s var(--ease); }
.card:hover { background: #101012; }
.card__k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-300); }
.card__q { margin: 0.9rem 0 0.5rem; font-size: 1.15rem; }
.card__p { color: var(--ink-300); font-size: 0.97rem; }

.featlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.featlist li {
  display: flex; gap: 0.9rem; align-items: baseline;
  padding: 1rem 0; border-top: 1px solid var(--line);
}
.featlist li:first-child { border-top: 0; }
.featlist .num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--green-400); flex: none; width: 2.2rem; }
.featlist .txt strong { color: var(--ink-50); font-weight: 500; }
.featlist .txt span { color: var(--ink-300); display: block; font-size: 0.95rem; margin-top: 0.2rem; }

/* ---------------------------------------------------------------------------
   10. Status chips — allowed / blocked / unknown
   --------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem; border-radius: 2px; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-200);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip--allowed { border-color: rgba(116,198,157,0.4); color: var(--status-allowed); }
.chip--allowed::before { background: var(--status-allowed); }
.chip--blocked { border-color: rgba(211,161,107,0.4); color: var(--status-blocked); }
.chip--blocked::before { background: var(--status-blocked); }
.chip--unknown { border-color: var(--line-strong); color: var(--status-unknown); }
.chip--unknown::before { background: var(--status-unknown); }

/* ---------------------------------------------------------------------------
   11. Receipt — the signature artifact
   --------------------------------------------------------------------------- */
.receipt {
  font-family: var(--font-mono);
  background: var(--bg-raised);
  border: 1px solid var(--line-green);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--ink-200);
  position: relative;
  overflow: hidden;
}
.receipt::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--green-500), transparent);
}
.receipt__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.9rem; margin-bottom: 0.9rem; border-bottom: 1px dashed var(--line-strong); }
.receipt__title { color: var(--ink-50); letter-spacing: 0.04em; }
.receipt__row { display: flex; justify-content: space-between; gap: 1rem; }
.receipt__row .k { color: var(--ink-400); }
.receipt__row .v { color: var(--ink-100); text-align: right; }
.receipt__row .v.allowed { color: var(--status-allowed); }
.receipt__row .v.blocked { color: var(--status-blocked); }
.receipt__row .v.unknown { color: var(--status-unknown); }
.receipt__stamp {
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong);
  display: flex; align-items: center; gap: 0.6rem; color: var(--green-300);
  letter-spacing: 0.08em;
}
.receipt__note { margin-top: 0.9rem; color: var(--ink-400); font-size: 0.72rem; line-height: 1.6; font-family: var(--font-sans); }

/* ---------------------------------------------------------------------------
   12. Boundary check (what we do / do not claim)
   --------------------------------------------------------------------------- */
.claims { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 760px) { .claims { grid-template-columns: 1fr; } }
.claims__col h3 { font-size: 1.05rem; margin-bottom: 1.1rem; }
.claims__list { list-style: none; margin: 0; padding: 0; }
.claims__list li { padding: 0.7rem 0; border-top: 1px solid var(--line); color: var(--ink-200); font-size: 0.97rem; display: flex; gap: 0.7rem; }
.claims__list li:first-child { border-top: 0; }
.claims__list .mark { flex: none; font-family: var(--font-mono); }
.claims__list--do .mark { color: var(--green-300); }
.claims__list--dont .mark { color: var(--status-blocked); }
.claims__list--dont li { color: var(--ink-400); }

/* ---------------------------------------------------------------------------
   13. Big copy block (positioning / who-for)
   --------------------------------------------------------------------------- */
.stack > * + * { margin-top: 1.1rem; }
.bigcopy {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink-100);
  max-width: 22ch;
}
.bigcopy em { font-style: normal; color: var(--green-300); }
.not-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.not-list li { color: var(--ink-400); font-size: 1.02rem; }
.not-list li.is { color: var(--ink-50); }
.not-list li::before { content: "— "; color: var(--ink-600); }
.not-list li.is::before { content: "→ "; color: var(--green-400); }

/* ---------------------------------------------------------------------------
   14. Origin / CTA band
   --------------------------------------------------------------------------- */
.band {
  border: 1px solid var(--line-green);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(45,106,79,0.08), rgba(45,106,79,0.015));
  padding: clamp(2.4rem, 5vw, 4rem);
  text-align: center;
}
.band h2 { margin-bottom: 1.2rem; }
.band .hero__cta { justify-content: center; margin-top: 2rem; }

/* ---------------------------------------------------------------------------
   15. Footer
   --------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; gap: 2.4rem; } }
.footer__col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-400); font-weight: 500; margin-bottom: 1rem; }
.footer__col a { display: block; color: var(--ink-300); font-size: 0.95rem; padding: 0.3rem 0; transition: color .2s var(--ease); }
.footer__col a:hover { color: var(--green-200); }
.footer__col .reserved { color: var(--ink-500); }
.footer__col .reserved::after { content: " · soon"; color: var(--ink-600); font-family: var(--font-mono); font-size: 0.7rem; }
.footer__about { color: var(--ink-400); font-size: 0.92rem; max-width: 34ch; margin-top: 1rem; }
.footer__legal { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--ink-500); font-size: 0.82rem; }

/* ---------------------------------------------------------------------------
   16. Reveal-on-scroll (fail-safe: content is visible by default; the hidden
   state is only applied once JS has confirmed it can reveal again)
   --------------------------------------------------------------------------- */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.reveal-ready .reveal { opacity: 0; transform: translateY(12px); }
html.reveal-ready .reveal.in { opacity: 1; transform: none; }

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

/* ---------------------------------------------------------------------------
   16b. Form
   --------------------------------------------------------------------------- */
.form { display: grid; gap: 1.4rem; max-width: 620px; }
.field { display: grid; gap: 0.5rem; }
.field--row { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 560px) { .field--row { grid-template-columns: 1fr; } }
.field label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-300);
}
.field label .req { color: var(--green-400); }
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-50);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  padding: 0.8rem 0.9rem;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--ink-500); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--green-400); background: #0e0e10; outline: none; }
.form__note { color: var(--ink-400); font-size: 0.85rem; }
.form__note a { color: var(--green-300); }
.callout {
  border: 1px solid var(--line-green);
  border-radius: var(--radius-lg);
  background: rgba(45,106,79,0.06);
  padding: 1.1rem 1.3rem;
  color: var(--ink-200);
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------------------
   17. Utilities
   --------------------------------------------------------------------------- */
.center { text-align: center; }
.maxw-narrow { max-width: var(--maxw-narrow); margin-inline: auto; }
.mt-1 { margin-top: 0.6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; } .mt-4 { margin-top: 3rem; }
.section-head { max-width: 56ch; margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }
.section-head .h2 { margin-top: 1rem; }
.section-head p { margin-top: 1.1rem; color: var(--ink-300); }
.lang-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-500); letter-spacing: 0.08em; }
