/* ============================================
   NEVERIN Inc. — common.css
   v2: Bold modular + illustration-friendly
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fraunces:ital,opsz,wght,SOFT@1,9..144,300..700,30..100&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  /* core — B2B SaaS clean + green accent */
  --ink: #0f1729;            /* deep cool navy-black */
  --ink-soft: #2b3346;
  --paper: #ffffff;
  --paper-soft: #f6f8f6;     /* very subtle cool off-white */
  --paper-mint: #ecfdf5;     /* emerald-50 — soft green tint */
  --paper-stone: #eef0ee;    /* neutral slot */

  --accent: #10b981;         /* emerald-500 — primary green */
  --accent-deep: #047857;    /* emerald-700 — hover/text */
  --accent-soft: #d1fae5;    /* emerald-100 — chip bg */

  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --muted: #5b6776;

  /* fonts */
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans:  'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* layout */
  --max: 1280px;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 6px;

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

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin:0; padding:0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  font-feature-settings: 'palt';
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit; }
ul,ol { list-style: none; }

/* italics → reserved for one-off accents only */
em {
  font-style: normal;
  color: var(--accent);
  font-weight: inherit;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.h-display {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.0;
  font-size: clamp(2.8rem, 7.5vw, 6.4rem);
}
.h-section {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--ink);
}

.lede {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.9;
  color: var(--muted);
  max-width: 38em;
  font-weight: 500;
}

/* ---------- layout helpers ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.container-narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.section { padding: clamp(4rem, 9vw, 8rem) 0; }

/* ============================================
   NAV — flat, top-bar (enmish-like)
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem var(--pad-x);
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid transparent;
  /* NOTE: no backdrop-filter — it would create a containing block for
     the position:fixed mobile menu and trap it inside the nav box.
     transition is limited to specific props (never backdrop-filter). */
  transition: padding 0.3s var(--ease), border-color 0.3s var(--ease);
}
@supports (backdrop-filter: blur(1px)) {
  /* desktop only: re-enable the blur where it won't break the mobile menu */
  @media (min-width: 881px) {
    .nav {
      background: rgba(255,255,255,0.82);
      backdrop-filter: blur(14px) saturate(160%);
      -webkit-backdrop-filter: blur(14px) saturate(160%);
    }
  }
}
.nav.is-scrolled {
  padding: 0.85rem var(--pad-x);
  border-bottom-color: var(--line);
}

.nav-brand {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}
.nav-brand img {
  height: 26px;
  width: auto;
  display: block;
  transition: height 0.3s var(--ease);
}
.nav.is-scrolled .nav-brand img { height: 22px; }
.nav-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  display: inline-block;
}
.nav-brand sup { display: none; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.nav-menu a {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}
.nav-menu a:not(.nav-cta):hover { color: var(--accent); }
.nav-menu a.is-active:not(.nav-cta) { color: var(--accent); }
.nav-menu a.is-active:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.nav-cta {
  background: var(--accent);
  color: var(--paper) !important;
  padding: 0.7rem 1.4rem !important;
  border-radius: 8px;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease;
  box-shadow: 0 4px 12px rgba(16,185,129,0.22);
}
.nav-cta:hover { background: var(--accent-deep); }
.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none;
  font-size: 1.2rem;
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 880px) {
  /* .nav has backdrop-filter, which would trap position:fixed children
     inside the nav box. Disable it on mobile so the menu overlay can
     cover the full viewport and stay completely hidden when closed. */
  .nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--paper);
  }
  .nav-menu {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 1.4rem;
    overflow-y: auto;
    /* hidden state — opacity/visibility based (bulletproof show/hide) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.25s var(--ease),
                transform 0.25s var(--ease),
                visibility 0s linear 0.25s;
  }
  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s var(--ease),
                transform 0.25s var(--ease),
                visibility 0s linear 0s;
  }
  .nav-menu a { font-size: 1.6rem; font-weight: 700; }
  .nav-menu .nav-cta { margin-top: 0.6rem; }
  .nav-toggle { display: flex; align-items:center; justify-content:center; }
}

/* ============================================
   PAGE HERO (interior)
   ============================================ */
.page-hero {
  padding-top: clamp(7rem, 11vw, 10rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.page-hero-inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad-x); }

.crumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  font-weight: 600;
}
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--line); }

.page-hero h1 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  margin-bottom: 1.5rem;
  max-width: 20ch;
}
.page-hero h1 em { color: var(--accent); }
.page-hero .lede { margin-top: 1rem; }
.page-hero .eyebrow { margin-bottom: 1.2rem; }

/* ============================================
   SHARED SECTION HELPERS (interior pages)
   ============================================ */
.sec { padding: clamp(5rem, 10vw, 8rem) 0; }
.sec.alt { background: var(--paper-soft); }
.sec.dark { background: var(--ink); color: var(--paper); }
.sec.dark .eyebrow { color: var(--accent); }
.sec.dark .eyebrow::before { background: var(--accent); }

.sec-head { text-align: center; margin-bottom: 3.5rem; }
.sec-head .eyebrow { justify-content: center; }
.sec-head h2 {
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-top: 1rem;
}
.sec-head h2 em { color: var(--accent); }
.sec-head p {
  color: var(--muted);
  margin-top: 1.2rem;
  font-weight: 500;
  line-height: 1.85;
  max-width: 40em;
  margin-left: auto;
  margin-right: auto;
}
.sec.dark .sec-head p { color: rgba(255,255,255,0.7); }

/* left-aligned section head variant */
.sec-head.left { text-align: left; }
.sec-head.left .eyebrow { justify-content: flex-start; }
.sec-head.left p { margin-left: 0; }

/* ============================================
   BUTTONS — flat, square corners
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.05rem 1.8rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-primary { background: var(--accent); color: var(--paper); border-color: var(--accent); box-shadow: 0 6px 18px rgba(16,185,129,0.28); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-accent { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* text-only link button (enmish style) */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  transition: gap 0.3s var(--ease), color 0.2s ease;
}
.btn-link:hover { gap: 1.2rem; color: var(--accent); border-color: var(--accent); }

.btn .arr { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

/* ============================================
   CARD primitives — flatter, no shadow by default
   ============================================ */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.8rem;
  border: 1px solid var(--line);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
}

/* DIAGRAM / illustration slot — clean B2B style icon container */
.diagram {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--paper-mint);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diagram > svg,
.diagram > img {
  width: 55%;
  height: 55%;
  display: block;
}

/* aspect ratios */
.diagram.r-square   { aspect-ratio: 1/1; }
.diagram.r-portrait { aspect-ratio: 4/5; }
.diagram.r-wide     { aspect-ratio: 16/9; }
.diagram.r-pano     { aspect-ratio: 21/9; }
.diagram.r-tall     { aspect-ratio: 3/4; }

/* tints — calm B2B palette */
.diagram.t-mint  { background: var(--paper-mint); }
.diagram.t-soft  { background: var(--paper-soft); }
.diagram.t-stone { background: var(--paper-stone); }
.diagram.t-ink   { background: var(--ink); color: var(--paper); }

/* photo slot still exists for cases section etc. */
.photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--paper-stone);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.photo > img,
.photo > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.r-square   { aspect-ratio: 1/1; }
.photo.r-portrait { aspect-ratio: 4/5; }
.photo.r-wide     { aspect-ratio: 16/9; }
.photo:empty::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(0,0,0,0.025) 12px 13px);
}
.photo[data-label]:empty::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* legacy .illu alias */
.illu { width: 100%; aspect-ratio: 4/3; background: var(--paper-mint); border-radius: var(--radius); }
.illu svg { display: none; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(4rem, 8vw, 6rem) 0 2.5rem;
  font-size: 0.92rem;
  border-radius: 0;
  margin-top: 0;
}
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad-x); }

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 3rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1;
}
.footer-brand img {
  height: 36px;
  width: auto;
  display: block;
}
.footer-brand .dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
}
.footer-tagline {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 22em;
  font-weight: 500;
}
.footer-col h4 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.2rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a { color: rgba(255,255,255,0.85); }
.footer-col a:hover { color: var(--accent); }

.footer-addr { color: rgba(255,255,255,0.7); font-size: 0.86rem; line-height: 1.7; margin-bottom: 1rem; }
.footer-addr strong { display: block; color: var(--paper); font-weight: 700; margin-bottom: 0.2rem; }

.footer-bottom {
  padding-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.footer-bottom .quote {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

@media (max-width: 880px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 540px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ============================================
   REVEAL animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.13s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.21s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.29s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.37s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.45s; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 0.53s; }

::selection { background: var(--accent); color: var(--paper); }

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