:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e5e3;
  --primary: #1a3c37;
  --primary-light: #2a5a52;
  --accent: #c4956a;
  --max-width: 760px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 32px);
}

body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
textarea {
  font: inherit;
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.brand-name {
  font-family: "Manrope", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 150ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease;
}

/* ── Main ── */

.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Intro ── */

.intro {
  padding: 80px 0 64px;
}

.intro h1 {
  font-family: "Manrope", sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 16px;
}

.intro-lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 24px;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 150ms ease, border-color 150ms ease;
}

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

.social-link svg {
  flex-shrink: 0;
}

/* ── Sections ── */

.section {
  margin-bottom: 64px;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-family: "Manrope", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.section-desc {
  color: var(--muted);
  margin: 0;
}

/* ── Portfolio ── */

.project-grid {
  display: grid;
  gap: 20px;
}

.project-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.project-inner {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas:
    "header header"
    "details visual";
  gap: 32px;
  align-items: start;
}

.project-header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
}

.project-details {
  grid-area: details;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-visual {
  grid-area: visual;
  flex-shrink: 0;
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: zoom-in;
}

.lightbox-trigger:focus-visible {
  outline: 2px solid rgba(26, 60, 55, 0.32);
  outline-offset: 4px;
}

.project-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.project-card h3 {
  font-family: "Manrope", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.3;
}

.project-summary {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: none;
  line-height: 1.7;
  white-space: nowrap;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-stack li {
  padding: 6px 10px;
  border: 1px solid rgba(26, 60, 55, 0.12);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(26, 60, 55, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.project-points {
  display: grid;
  gap: 10px;
  margin: 4px 0 24px;
}

.project-points li {
  position: relative;
  padding-left: 18px;
  color: #4d5562;
  font-size: 0.9rem;
  line-height: 1.75;
}

.project-points li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

@media (max-width: 560px) {
  .project-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "visual"
      "details";
  }

  .project-visual {
    order: 0;
  }

  .project-image {
    max-width: 280px;
    margin: 0 auto;
  }

  .project-summary {
    white-space: normal;
  }
}

/* ── About ── */

.about-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.about-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-name {
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.name-hi {
  color: #c0392b;
}

.about-role {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.about-bio p {
  color: var(--muted);
  margin: 0 0 12px;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.skills-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.skills-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.skills-label {
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
  width: 120px;
  padding-top: 5px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tags li {
  font-size: 0.85rem;
  padding: 4px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}

.btn:hover {
  background: var(--primary-light);
}

.btn:active {
  transform: scale(0.98);
}

body.is-lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 48px));
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.lightbox-image {
  width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #111827;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.34);
}

.lightbox-caption {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.85rem;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--text);
}

.site-footer small {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Reveal Animation ── */

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .intro {
    padding: 48px 0 40px;
  }

  .intro h1 {
    font-size: 1.8rem;
  }

  .project-card {
    padding: 22px;
  }

  .skills-row {
    flex-direction: column;
    gap: 10px;
  }

  .skills-label {
    width: auto;
    padding-top: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(250, 249, 247, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 24px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-dialog {
    width: min(100%, calc(100vw - 32px));
  }

  .lightbox-image {
    max-height: calc(100vh - 32px);
  }

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

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}