:root {
  --bg: #0a0a0a;
  --surface: #101010;
  --line: #242424;
  --line-soft: #1a1a1a;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --dim: #5c5c5c;
  --accent: #a3e635;
  --accent-dim: rgba(163, 230, 53, 0.12);
  --font-sans: 'Inter', ui-sans-serif, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-jp: 'Noto Sans JP', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #0a0a0a; }

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

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

section[id] { scroll-margin-top: 4rem; }

.container {
  width: min(1080px, 90%);
  margin: 0 auto;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 3px;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(163, 230, 53, 0.7);
  transition: width 0.08s linear;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 42rem at 88% -12%, rgba(163, 230, 53, 0.07), transparent 62%),
    radial-gradient(52rem 34rem at -12% 32%, rgba(163, 230, 53, 0.05), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  width: min(1080px, 90%);
  margin: 0 auto;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.logo:hover { color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  position: relative;
  padding: 11rem 0 7rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 5rem 5rem;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 78%);
}

.hero::before {
  content: "";
  position: absolute;
  top: 6%;
  right: 10%;
  width: 24rem;
  height: 24rem;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.13), transparent 70%);
  filter: blur(12px);
  animation: drift 13s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4rem, 2.5rem) scale(1.18); }
}

.hero .container { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 14vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  transition: text-shadow 0.4s;
}

.hero-title:hover { text-shadow: 0 0 70px rgba(163, 230, 53, 0.45); }

.hero-title-jp {
  font-family: var(--font-jp);
  font-size: 0.28em;
  font-weight: 500;
  letter-spacing: 0.35em;
  color: var(--dim);
  margin-left: 0.5em;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  margin-top: 3.5rem;
  align-items: start;
}

.hero-type {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  min-height: 1.6em;
}

.typewriter { color: var(--accent); text-shadow: 0 0 18px rgba(163, 230, 53, 0.35); }

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero .eyebrow { animation: fade-up 0.7s ease both; }
.hero-title { animation: fade-up 0.7s 0.08s ease both; }
.hero-grid { animation: fade-up 0.7s 0.16s ease both; }

.hero-desc {
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2.25rem;
}

.hero-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.text-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.arrow { display: inline-block; transition: transform 0.25s; }

.text-link:hover .arrow { transform: translateY(2px); }

.hero-meta {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.5rem 1.75rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.85rem;
}

.meta-row:last-child { border-bottom: none; }

.meta-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.meta-val {
  color: var(--text);
  text-align: right;
  font-size: 0.85rem;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5rem;
  box-shadow: 0 0 8px rgba(163, 230, 53, 0.8);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.meta-row { transition: background 0.25s; }

.meta-row:hover { background: rgba(163, 230, 53, 0.03); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 4rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(16, 16, 16, 0.6);
  padding: 1.4rem 1.5rem;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.stat:hover {
  border-color: rgba(163, 230, 53, 0.5);
  transform: translateY(-3px);
  background: var(--surface);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.95rem 0;
  background: var(--surface);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  animation: ticker-scroll 30s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-track .tick {
  color: var(--accent);
  font-weight: 600;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.section { padding: 6.5rem 0; border-top: 1px solid var(--line-soft); }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 3rem;
}

.section-label-line {
  display: inline-block;
  width: 3.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(163, 230, 53, 0.75), transparent);
  vertical-align: middle;
  margin-right: 0.75rem;
}

.section-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: -2rem 0 3rem;
  max-width: 55ch;
}

.row-list {
  border-top: 1px solid var(--line);
}

.row-item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 2rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, padding-left 0.3s;
}

.row-item:hover {
  background: linear-gradient(90deg, rgba(163, 230, 53, 0.04), transparent 55%);
  padding-left: 0.75rem;
}

.row-num {
  font-size: 0.8rem;
  color: var(--dim);
  padding-top: 0.35rem;
}

.row-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.row-item:hover .row-title { color: var(--accent); }

.row-item:hover .row-num { color: var(--accent); }

.row-text {
  color: var(--muted);
  max-width: 60ch;
  font-size: 0.95rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 4rem;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.skill-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.skill:hover .skill-name { color: var(--accent); }

.skill-pct {
  font-size: 0.8rem;
  color: var(--dim);
}

.skill-track {
  height: 3px;
  background: var(--line);
}

.skill-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(163, 230, 53, 0.4);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.learning-label {
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.learning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  list-style: none;
  font-size: 0.95rem;
}

.learning-list li { color: var(--muted); }

.learning-list li span { color: var(--accent); margin-right: 0.5rem; }

.learning-list li:hover { color: var(--text); }

.project-list {
  border-top: 1px solid var(--line);
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2rem;
  padding: 2.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: background 0.25s, border-left-color 0.25s;
}

.project-row:hover {
  background: var(--surface);
  border-left-color: var(--accent);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.4rem;
}

.project-num {
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  transition: color 0.25s;
}

.project-row:hover .project-num { color: var(--accent); }

.project-year { color: var(--dim); font-size: 0.8rem; }

.project-status {
  display: inline-block;
  width: fit-content;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(163, 230, 53, 0.35);
  padding: 0.2rem 0.6rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.project-row:hover .project-title { color: var(--accent); }

.project-arrow {
  display: inline-block;
  font-size: 0.7em;
  color: var(--dim);
  transition: transform 0.25s, color 0.25s;
}

.project-row:hover .project-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.project-desc {
  color: var(--muted);
  max-width: 62ch;
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  font-size: 0.72rem;
  color: var(--dim);
}

.project-tags li::before {
  content: "//";
  color: var(--accent);
  margin-right: 0.4rem;
}

.project-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: var(--accent);
  padding: 0.6rem 1.05rem;
  margin-top: 1rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.25s;
}

.project-btn:hover {
  background: #b8f24d;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(163, 230, 53, 0.3);
}

.project-btn:hover .btn-arrow {
  transform: translate(2px, -2px);
}

.project-btn:active {
  transform: translateY(0);
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.underline-link {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
  transition: color 0.2s;
}

.underline-link:hover { color: var(--accent); }

.contact-sub {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.contact-email { margin-bottom: 2rem; }

.mailto {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color 0.2s, border-color 0.2s;
}

.mailto:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-socials {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.contact-socials a {
  display: inline-block;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.contact-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--dim);
}

.footer-link { color: var(--dim); transition: color 0.2s; }

.footer-link:hover { color: var(--accent); }

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

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease var(--d, 0s), transform 0.6s ease var(--d, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.row-item:nth-child(2) { --d: 0.1s; }
.row-item:nth-child(3) { --d: 0.2s; }
.skill:nth-child(2) { --d: 0.08s; }
.skill:nth-child(3) { --d: 0.16s; }
.skill:nth-child(4) { --d: 0.24s; }
.learning-list li:nth-child(2) { --d: 0.05s; }
.learning-list li:nth-child(3) { --d: 0.1s; }
.learning-list li:nth-child(4) { --d: 0.15s; }
.project-row:nth-child(2) { --d: 0.1s; }
.stat:nth-child(2) { --d: 0.1s; }
.stat:nth-child(3) { --d: 0.2s; }

@media (max-width: 820px) {
  .hero { padding-top: 8rem; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .row-item,
  .project-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .row-num { padding-top: 0; }

  .project-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .skills-grid { grid-template-columns: 1fr; }

  .hero-stats { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-menu li { width: 100%; }

  .nav-link {
    display: block;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line-soft);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .skill-fill { transition: none; }
  .ticker-track { animation: none; }
  .hero::before { animation: none; }
  .hero .eyebrow,
  .hero-title,
  .hero-grid { animation: none; }
}