/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

a, button { -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --bg-3: #f0f0f0;
  --border: rgba(0,0,0,0.1);
  --text: #111111;
  --text-muted: #888888;
  --accent: #111111;
  --accent-glow: rgba(0,0,0,0.04);
  --green: #111111;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'YuGothic', 'Meiryo', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* ── Noise overlay ── */
.noise { display: none; }

/* ── Typography ── */
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

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

/* ── Layout ── */
.container { max-width: 1100px; margin-inline: auto; padding-inline: 24px; }
.container-narrow { max-width: 680px; margin-inline: auto; padding-inline: 24px; }

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
}

.nav {
  max-width: 1100px;
  margin-inline: auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 60px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin-inline: auto;
  padding: 80px 24px;
}

.hero-tag {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Orbs */
.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}

.orb-1 {
  display: none;
}

.orb-2 {
  display: none;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 80% 40%, black 0%, transparent 70%);
}


/* ── Sections ── */
.section { padding: 40px 0; position: relative; z-index: 1; }
.section-alt { background: var(--bg-2); }

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 56px;
  letter-spacing: -0.01em;
}

/* ── Projects grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, transform .2s;
}

.card:hover {
  border-color: rgba(0,0,0,0.25);
  transform: translateY(-2px);
}

.card-featured {
  border-color: rgba(255,255,255,0.12);
  background: var(--bg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.card-links {
  display: flex;
  gap: 12px;
}

.card-links a {
  color: var(--text-muted);
  transition: color .2s;
}
.card-links a:hover { color: var(--text); }

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 4px;
}

.card-tags li {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-list li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Contact ── */
.contact-desc {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-text-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity .15s;
}

.contact-text-link:hover { opacity: 0.6; }

/* ── Footer ── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer .mono {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Hamburger ── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: opacity .15s;
}

.menu {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.menu.open {
  display: flex;
}

.menu a {
  padding: 14px 24px;
  font-size: 15px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}

.menu a:hover, .menu a.nav-current {
  color: var(--text);
}

/* ── Top page ── */
.top-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.top-tag {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.top-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.top-bio {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 48px;
}

.top-profile {
  margin-bottom: 40px;
}

.top-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.top-projects {
  display: flex;
  flex-direction: column;
}

.top-project-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.top-project-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.top-project-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.top-project-stack {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.top-project-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.top-projects-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
  transition: color .15s;
}

.top-projects-more:hover {
  color: var(--text);
}

/* ── Top grid ── */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  min-height: calc(100svh - 60px);
  padding: 0 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.top-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.top-name {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.top-bio {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 28px;
}


.top-actions {
  display: flex;
  gap: 10px;
}

.top-btn-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity .15s;
}

.top-btn-main:hover { opacity: 0.6; }

.top-btn-sub {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color .15s;
}

.top-btn-sub:hover { color: var(--text); }

/* ── Work cards ── */
.work-cards {
  position: relative;
  height: 420px;
}

.work-card {
  position: absolute;
  width: 72%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.work-card--1 {
  top: 0;
  left: 0;
  transform: rotate(-3deg);
  z-index: 1;
}

.work-card--2 {
  top: 80px;
  right: 0;
  transform: rotate(2deg);
  z-index: 2;
}

.work-card--3 {
  bottom: 0;
  left: 12%;
  transform: rotate(-1deg);
  z-index: 3;
}

.work-card-bar {
  height: 36px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.work-card-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.work-card-body {
  padding: 24px;
}

.work-card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.work-card-desc {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .top-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 40px 24px 60px;
    gap: 48px;
  }

  .top-right { order: -1; }

  .work-cards { height: 320px; }

  .work-card { width: 75%; }
}

/* ── Top nav (index only) ── */
.top-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 320px;
}

.top-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 15px;
  transition: border-color .15s, color .15s;
}

.top-nav-item:hover {
  border-color: var(--accent);
  color: var(--text);
}

.top-nav-arrow {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Nav current ── */
.nav-current {
  color: var(--text) !important;
}

/* ── Responsive ── */
.br-pc { display: none; }

@media (min-width: 900px) {
  .br-pc { display: block; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.4rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 32px 0; }
}

/* ── Scroll-driven fade-in ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card, .skill-group, .contact-text-link {
  animation: fade-up .5s ease both;
  animation-play-state: paused;
}

.card.visible, .skill-group.visible, .contact-text-link.visible {
  animation-play-state: running;
}
