:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #6f6f69;
  --line: #ddddda;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 100svh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand,
.github-link {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.github-link {
  color: var(--muted);
  font-weight: 500;
}

main {
  display: grid;
  align-content: center;
  gap: clamp(24px, 4vh, 42px);
  padding: clamp(28px, 5vh, 50px) 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  column-gap: 48px;
  align-items: end;
}

.location,
.section-title p,
.mini-heading {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.location {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.intro-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.projects {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: stretch;
}

.section-title {
  padding-top: 4px;
}

h2 {
  margin: 8px 0 0;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-card {
  min-height: 132px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px);
  border-color: #aaa9a4;
}

.project-kind,
.project-url {
  color: var(--muted);
  font-size: 0.78rem;
}

.project-card strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-grid {
  padding-top: clamp(20px, 3vh, 30px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
}

.plain-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li + li {
  margin-top: 4px;
}

.history {
  margin: 10px 0 0;
}

.plain-list,
.history {
  font-size: 0.9rem;
}

footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  main {
    align-content: start;
    gap: 34px;
    padding: 42px 0;
  }

  .intro,
  .projects,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 18px;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 4.4rem);
  }

  .projects {
    gap: 14px;
  }

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

  .profile-grid {
    gap: 28px;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  main {
    gap: 22px;
    padding: 24px 0;
  }

  h1 {
    font-size: clamp(2.5rem, 4.6vw, 4.2rem);
  }

  .project-card {
    min-height: 112px;
    padding: 15px;
  }

  .profile-grid {
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    transition: none;
  }
}
