:root {
  --bg: #0b1020;
  --bg2: #10172e;
  --ink: #eef2ff;
  --sub: #a5b0d6;
  --line: rgba(255,255,255,.10);
  --card: rgba(255,255,255,.045);
  --a1: #5b8cff;   /* blue */
  --a2: #2fd6b5;   /* teal */
  --a3: #b07cff;   /* violet */
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); line-height: 1.8;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }

/* ---- scroll progress / cursor glow ---- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100;
  background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3));
  transform-origin: 0 50%; transform: scaleX(0); }
.glow { position: fixed; width: 420px; height: 420px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(91,140,255,.16), transparent 65%);
  transform: translate(-50%, -50%); left: -500px; top: -500px; transition: opacity .3s; }

/* ---- nav ---- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px); backdrop-filter: blur(14px);
  background: rgba(11,16,32,.55); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.nav.scrolled { border-color: var(--line); background: rgba(11,16,32,.8); }
.logo { font-weight: 800; letter-spacing: .04em; text-decoration: none; font-size: 1.1rem; }
.logo span { color: var(--a2); margin: 0 2px; display: inline-block; transition: transform .5s var(--ease); }
.logo:hover span { transform: rotate(180deg); }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { text-decoration: none; color: var(--sub); font-size: .88rem; position: relative; transition: color .2s; }
.nav nav a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--a2); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav nav a:hover, .nav nav a.active { color: var(--ink); }
.nav nav a:hover::after, .nav nav a.active::after { transform: scaleX(1); transform-origin: left; }

/* ---- hero ---- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden;
  padding: 100px 16px 80px; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: drift 20s ease-in-out infinite alternate; }
.b1 { width: 42vmax; height: 42vmax; background: var(--a1); top: -14vmax; left: -12vmax; }
.b2 { width: 36vmax; height: 36vmax; background: var(--a2); bottom: -16vmax; right: -10vmax; animation-delay: -7s; }
.b3 { width: 24vmax; height: 24vmax; background: var(--a3); top: 30%; left: 55%; opacity: .3; animation-delay: -13s; }
@keyframes drift { 50% { transform: translate(6vmax, 4vmax) scale(1.12); } 100% { transform: translate(-4vmax, 6vmax) scale(.95); } }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-inner { position: relative; z-index: 2; width: min(880px, 100%); }
.hello { color: var(--a2); font-weight: 700; letter-spacing: .1em; opacity: 0; animation: fadeUp .8s .2s var(--ease) forwards; }
.title { font-size: clamp(1.5rem, 6.8vw, 4.4rem); line-height: 1.3; font-weight: 800; margin: 12px 0 20px; }
.title .line { display: block; overflow: hidden; }
.title .line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1s var(--ease) forwards; }
.title .line:nth-child(2) > span { animation-delay: .15s; }
.title .line:nth-child(3) > span { animation-delay: .3s; }
@keyframes lineUp { to { transform: none; } }
.grad { background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3), var(--a1)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: lineUp 1s .3s var(--ease) forwards, shine 6s linear infinite !important; }
@keyframes shine { to { background-position: 300% 0; } }
.typing { font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--sub); font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  opacity: 0; animation: fadeUp .8s .8s var(--ease) forwards; }
#typed { color: var(--ink); }
.caret { color: var(--a2); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.ecg { width: 100%; height: 80px; margin-top: 36px; overflow: visible; }
.ecg path { fill: none; stroke: var(--a2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(47,214,181,.8)); stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: draw 3.2s 1s ease-in-out forwards, pulse 2.4s 4.2s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { filter: drop-shadow(0 0 14px rgba(47,214,181,1)); } }

.scroll { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--sub); border-radius: 14px; }
.scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: var(--ink); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---- sections ---- */
.sec { position: relative; z-index: 1; width: min(1080px, 100%); margin: 0 auto; padding: 110px 16px 40px; }
.sec-title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: .02em; margin-bottom: 14px; }
.sec-title em { font-style: normal; font-size: .9rem; color: var(--a2); margin-right: 12px; vertical-align: middle;
  font-family: ui-monospace, Consolas, monospace; }
.sec-title small { font-size: .9rem; color: var(--sub); font-weight: 500; }
.sec-lead { color: var(--sub); margin-bottom: 32px; }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* about */
.about { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; margin-top: 24px; }
.avatar { position: relative; width: 150px; height: 150px; display: grid; place-items: center; font-size: 3.6rem;
  background: var(--bg2); border-radius: 50%; }
.avatar span { animation: float 4s ease-in-out infinite; }
.ring { position: absolute; inset: -6px; border-radius: 50%; padding: 3px;
  background: conic-gradient(var(--a1), var(--a2), var(--a3), var(--a1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask-composite: exclude; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
.lead { font-size: 1.35rem; margin-bottom: 10px; }
.lead strong { color: var(--a2); }
.about p:not(.lead) { color: var(--sub); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.stats > div { text-align: center; padding: 26px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.stats b { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--a1), var(--a2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { font-size: 1.6rem; font-weight: 800; color: var(--a2); }
.stats p { color: var(--sub); font-size: .85rem; margin-top: 8px; line-height: 1.6; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.cards.small { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); margin-top: 32px; }
.card { position: relative; padding: 28px 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  transform-style: preserve-3d; transition: transform .25s ease-out, border-color .3s, opacity .9s var(--ease); overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(91,140,255,.18), transparent 50%); }
.card:hover { border-color: rgba(91,140,255,.5); }
.card:hover::before { opacity: 1; }
.card .icon { font-size: 2rem; margin-bottom: 10px; display: inline-block; transition: transform .4s var(--ease); }
.card:hover .icon { transform: scale(1.2) rotate(-8deg); }
.card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.card p { color: var(--sub); font-size: .9rem; }
.cards .reveal:nth-child(2) { transition-delay: .08s; }
.cards .reveal:nth-child(3) { transition-delay: .16s; }
.cards .reveal:nth-child(4) { transition-delay: .24s; }
.cards .reveal:nth-child(5) { transition-delay: .32s; }
.cards .reveal:nth-child(6) { transition-delay: .40s; }

.quote { margin: 56px auto 0; max-width: 760px; padding: 32px 36px; border-left: 3px solid var(--a2);
  background: linear-gradient(90deg, rgba(47,214,181,.08), transparent); border-radius: 0 20px 20px 0; }
.quote p { font-size: 1.05rem; line-height: 2; }
.quote cite { display: block; margin-top: 10px; color: var(--a2); font-style: normal; text-align: right; }

/* marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 14px 0;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.track span { padding: 6px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2);
  font-family: ui-monospace, Consolas, monospace; font-size: .88rem; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } }

/* flip cards */
.flips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; }
.flip { position: relative; height: 220px; perspective: 1000px; cursor: pointer; outline: none; }
.flip .face { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px;
  border-radius: 20px; border: 1px solid var(--line); backface-visibility: hidden; transition: transform .8s var(--ease); }
.flip .front { background: var(--card); }
.flip .front span { font-size: 2.8rem; }
.flip .back { background: linear-gradient(135deg, rgba(91,140,255,.35), rgba(47,214,181,.3)); transform: rotateY(180deg); }
.flip:hover .front, .flip:focus .front, .flip.on .front { transform: rotateY(-180deg); }
.flip:hover .back, .flip:focus .back, .flip.on .back { transform: rotateY(0); }

/* timeline */
.timeline { list-style: none; position: relative; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline::after { content: ""; position: absolute; left: 9px; top: 6px; width: 2px; height: calc(var(--tl, 0) * (100% - 12px));
  background: linear-gradient(var(--a1), var(--a2)); }
.timeline li { position: relative; padding-bottom: 36px; }
.timeline .dot { position: absolute; left: -36px; top: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--a2); z-index: 1; }
.timeline li.in .dot { animation: ping 1.2s .3s var(--ease); background: var(--a2); transition: background .4s .3s; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,214,181,.7); } 100% { box-shadow: 0 0 0 16px rgba(47,214,181,0); } }
.timeline h3 { font-size: 1.1rem; }
.timeline p { color: var(--sub); font-size: .92rem; }

/* footer */
.foot { position: relative; z-index: 1; text-align: center; padding: 100px 16px 80px; }
.foot p { font-size: clamp(1.2rem, 3vw, 1.6rem); margin-bottom: 24px; }
.btn { display: inline-block; padding: 12px 26px; border-radius: 999px; text-decoration: none; font-weight: 700;
  background: linear-gradient(135deg, var(--a1), var(--a2)); color: #061024; transition: transform .2s ease-out, box-shadow .3s; }
.btn:hover { box-shadow: 0 10px 30px rgba(47,214,181,.4); }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .nav nav { display: none; }
  .about { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 28px; }
  .stats { grid-template-columns: 1fr; }
  .quote { padding: 24px 20px; }
  .glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}
