/* ===============================================
   成和Innovative LP - Core Styles
   Palette blends video reference + spec sheet
   =============================================== */

:root{
  /* Warm paper background family */
  --bg-paper: #F4F1E8;         /* main warm off-white (video ref) */
  --bg-paper-2: #ECE7D7;       /* section highlight */
  --bg-cream: #F9F6EC;         /* lighter cream */
  --bg-navy: #0B1428;          /* deep navy - final CTA / dark sections */
  --bg-navy-2: #12203D;

  /* Ink / text */
  --ink: #1A1A1F;              /* near black for main text (heavier than 4D for web readability) */
  --ink-2: #2E2E33;            /* line art */
  --ink-mute: #6B6B70;         /* secondary text */
  --ink-line: rgba(26,26,31,0.15);

  /* Brand accents */
  --gold: #B8901C;             /* video mustard */
  --gold-2: #C99E1E;           /* spec sheet mustard */
  --gold-deep: #8F6E14;
  --blue: #2E4B8C;             /* video navy blue */
  --blue-deep: #1E3466;
  --blue-soft: #E4E9F5;

  /* Type */
  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  --font-display: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  --font-en: "Inter", "Noto Sans JP", sans-serif;

  /* Layout */
  --content: 1240px;
  --gutter: clamp(20px, 4vw, 56px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--font-jp);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body { scroll-behavior: smooth; }

img, svg { display: block; max-width: 100%; }

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

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

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

/* ---- Paper grain overlay ---- */
.paper-grain{
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.14  0 0 0 0 0.12  0 0 0 0.09 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (max-width: 640px){ .paper-grain{ opacity: .35; } }

/* ---- Graph paper grid: soft blueprint lattice with edge fade ---- */
/* Fixed to the viewport, sits above paper-grain and below content.
   Two layered backgrounds: 40px major cells (slightly darker) + 8px minor cells.
   mask-image restricts visibility to a central band on both axes, so the
   grid appears organically without hard edges. */
.graph-grid{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    /* Major grid lines (every 40px) */
    linear-gradient(to right, rgba(11,20,40,0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,20,40,0.10) 1px, transparent 1px),
    /* Minor grid lines (every 8px) */
    linear-gradient(to right, rgba(11,20,40,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,20,40,0.045) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  opacity: 0.55;
  /* Fade in horizontally at both ends of the viewport,
     and fade out top/bottom so the grid feels like a sheet of graph paper
     laid behind the content column, not a flat overlay. */
  -webkit-mask-image:
    linear-gradient(to right,
      transparent 0%,
      rgba(0,0,0,0.35) 12%,
      rgba(0,0,0,1) 30%,
      rgba(0,0,0,1) 70%,
      rgba(0,0,0,0.35) 88%,
      transparent 100%),
    linear-gradient(to bottom,
      transparent 0%,
      rgba(0,0,0,1) 8%,
      rgba(0,0,0,1) 92%,
      transparent 100%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
          mask-image:
    linear-gradient(to right,
      transparent 0%,
      rgba(0,0,0,0.35) 12%,
      rgba(0,0,0,1) 30%,
      rgba(0,0,0,1) 70%,
      rgba(0,0,0,0.35) 88%,
      transparent 100%),
    linear-gradient(to bottom,
      transparent 0%,
      rgba(0,0,0,1) 8%,
      rgba(0,0,0,1) 92%,
      transparent 100%);
}
@media (max-width: 900px){
  .graph-grid{
    background-size: 32px 32px, 32px 32px, 8px 8px, 8px 8px;
    opacity: 0.4;
  }
}
@media (max-width: 640px){
  .graph-grid{ opacity: 0.3; }
}
@media (prefers-reduced-motion: no-preference){
  /* subtle drift so the grid doesn't look mechanical */
  .graph-grid{ transition: opacity 0.4s ease; }
}

/* ---- Margin ornaments: editorial fixtures in the gutter ---- */
/* Lives in the whitespace on either side of the 1240px content column.
   Only visible on viewports wide enough to have real gutter space. */
.margin-ornaments{
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}
@media (min-width: 1180px){
  .margin-ornaments{ display: block; }
}
.mo{
  position: absolute;
  top: 96px;
  bottom: 40px;
  width: calc((100vw - var(--content)) / 2);
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0;
}
.mo--left{ left: 0; }
.mo--right{ right: 0; }

/* Vertical rotated labels — the editorial fingerprint */
.mo__vtext{
  writing-mode: vertical-rl;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-mute);
  text-transform: uppercase;
  white-space: nowrap;
}
.mo--left .mo__vtext{ transform: rotate(180deg); }
.mo__vtext--bot{ opacity: 0.6; }
/* Japanese vertical text (right rail, bottom) uses display font */
.mo--right .mo__vtext--bot{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: none;
}

/* Left rail: gold ticks — vertical ruler feeling */
.mo__ticks{
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.mo__ticks span{
  width: 14px;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
}
.mo__ticks span:nth-child(5n+1){
  width: 22px;
  opacity: 0.9;
}

/* Right rail: crosshair marker (photo-margin registration mark) */
.mo__crosshair{
  position: relative;
  width: 26px;
  height: 26px;
}
.mo__crosshair-h,
.mo__crosshair-v{
  position: absolute;
  background: var(--ink);
}
.mo__crosshair-h{
  left: 0; right: 0; top: 50%;
  height: 1px; transform: translateY(-50%);
}
.mo__crosshair-v{
  top: 0; bottom: 0; left: 50%;
  width: 1px; transform: translateX(-50%);
}
.mo__crosshair-lbl{
  position: absolute;
  left: 32px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  font-weight: 700;
}

/* Small geometric ornaments */
.mo__shape{
  width: 52px;
  height: 52px;
  opacity: 0.85;
}
.mo__shape--circle{ align-self: center; }
.mo__shape--tri{ align-self: center; }

/* Long dashed hand-drawn stroke traveling down the right gutter */
.mo__stroke{
  position: absolute;
  top: 0;
  right: calc((100vw - var(--content)) / 2 - 20px);
  width: 40px;
  height: 100vh;
  pointer-events: none;
}

/* Additional band: horizontal editorial line below header */
.margin-ornaments::before{
  content: "";
  position: absolute;
  top: 84px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0,
    transparent calc((100vw - var(--content)) / 2 - 40px),
    var(--ink-line) calc((100vw - var(--content)) / 2 - 40px),
    var(--ink-line) calc((100vw - var(--content)) / 2 + 20px),
    transparent calc((100vw - var(--content)) / 2 + 20px),
    transparent calc(100vw - (100vw - var(--content)) / 2 - 20px),
    var(--ink-line) calc(100vw - (100vw - var(--content)) / 2 - 20px),
    var(--ink-line) calc(100vw - (100vw - var(--content)) / 2 + 40px),
    transparent calc(100vw - (100vw - var(--content)) / 2 + 40px)
  );
  opacity: 0.5;
}

/* ---- Site header ---- */
.site-header{
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(244, 241, 232, 0.75);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.is-scrolled{
  border-bottom-color: var(--ink-line);
  background: rgba(244, 241, 232, 0.92);
}
.site-header__inner{
  max-width: var(--content);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.brand{ display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark{ color: var(--gold); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.brand__mark svg{ width: 100%; height: 100%; }
.brand__logo-img{ width: 100%; height: 100%; object-fit: contain; display: block; }
.brand__wordmark{ display: flex; flex-direction: column; line-height: 1; }
.brand__jp{ font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: 0.04em; }
.brand__en{ font-family: var(--font-en); font-weight: 700; font-size: 9px; letter-spacing: 0.22em; color: var(--ink-mute); margin-top: 3px; }

.site-nav{
  margin-left: auto;
  display: flex; gap: 26px;
  font-size: 13px;
  font-weight: 500;
}
.site-nav a{
  color: var(--ink);
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}
.site-nav a::after{
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--gold);
  transition: right .35s var(--ease-out);
}
.site-nav a:hover{ color: var(--gold-deep); }
.site-nav a:hover::after{ right: 0; }

.cta-pill{
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg-paper);
  padding: 12px 20px;
  font-family: var(--font-jp); font-weight: 700; font-size: 13px;
  border-radius: 999px;
  transition: transform .25s var(--ease-out), background .25s ease;
  will-change: transform;
}
.cta-pill:hover{ background: var(--gold); transform: translateY(-1px); }
.cta-pill--sm{ padding: 10px 16px; font-size: 12px; }

@media (max-width: 900px){
  .site-nav{ display: none; }
}

/* ---- Floating CTA ---- */
.floating-cta{
  position: fixed;
  z-index: 90;
  right: 24px; bottom: 24px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-jp); font-weight: 700; font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(184, 144, 28, 0.65),
              0 4px 12px -4px rgba(0,0,0,0.12);
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s, transform .4s var(--ease-out), background .25s;
}
.floating-cta.is-visible{ opacity: 1; transform: translateY(0); }
.floating-cta:hover{ background: var(--ink); color: var(--bg-paper); }
.floating-cta__arrow{ display: inline-flex; }

@media (max-width: 720px){
  .floating-cta{
    left: 16px; right: 16px; bottom: 12px;
    justify-content: center;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 15px;
  }
}

/* ---- Site footer ---- */
.site-footer{
  position: relative; z-index: 2;
  background: var(--ink);
  color: rgba(244,241,232,0.7);
  padding: 40px 0;
}
.site-footer__inner{
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.site-footer__wordmark{
  font-family: var(--font-display); font-weight: 900;
  font-size: 22px; color: var(--bg-paper);
  letter-spacing: 0.04em;
  display: inline-flex; align-items: baseline; gap: 8px;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}
.site-footer__wordmark:hover{ color: var(--gold); }
.site-footer__wordmark:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.site-footer__wordmark::after{
  content: "↗";
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 14px;
  color: var(--gold);
  transition: transform 0.25s var(--ease-out);
}
.site-footer__wordmark:hover::after{
  transform: translate(2px, -2px);
}
.site-footer__tag{
  font-size: 12px; margin-top: 6px; letter-spacing: 0.08em;
}
.site-footer__meta{
  font-family: var(--font-en); font-size: 11px; letter-spacing: 0.14em;
}

/* ---- Global section wrapper ---- */
.section{
  position: relative; z-index: 2;
  padding: clamp(90px, 12vw, 160px) 0;
}
.section__inner{
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}
.section-eyebrow{
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-en);
  font-weight: 700; font-size: 12px; letter-spacing: 0.28em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.section-eyebrow__num{
  font-weight: 700;
  color: var(--gold);
}
.section-eyebrow__line{
  display: inline-block; width: 40px; height: 1.5px; background: var(--gold);
}

.h-display{
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 6.4vw, 88px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.h-section{
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 4.8vw, 62px);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}
.h-section .gold{ color: var(--gold-deep); }
.h-section .navy{ color: var(--blue); }

.lead{
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.9;
  color: var(--ink);
  max-width: 60ch;
}

/* ---- Reveal animation baseline ---- */
.reveal{ opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.in{ opacity: 1; transform: none; }
.reveal[data-delay="1"]{ transition-delay: .08s; }
.reveal[data-delay="2"]{ transition-delay: .16s; }
.reveal[data-delay="3"]{ transition-delay: .24s; }
.reveal[data-delay="4"]{ transition-delay: .32s; }
.reveal[data-delay="5"]{ transition-delay: .40s; }
.reveal[data-delay="6"]{ transition-delay: .48s; }

/* Draw-in line animation for SVG paths */
.draw-path{
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  transition: stroke-dashoffset 1.4s var(--ease-in-out);
}
.reveal.in .draw-path{ stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce){
  .reveal, .draw-path{
    opacity: 1 !important; transform: none !important;
    stroke-dashoffset: 0 !important; transition: none !important;
  }
  html{ scroll-behavior: auto; }
}

/* Utility */
.sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
