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

:root {
  --color-bg-light: #f0f0f0;
  --color-bg-white: #ffffff;
  --color-bg-dark: #0d1117;
  --color-text: #111111;
  --color-text-muted: #555555;
  --color-text-light: #ffffff;
  --color-text-light-muted: rgba(255, 255, 255, 0.72);
  --color-accent-blue: #1877f2;
  --color-accent-meta: #1a1f2e;
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 1200px;
  --section-padding: clamp(1.5rem, 4vw, 3rem);
  --hero-padding: clamp(6rem, 18vw, 11rem);
  --color-border: #e5e5e5;
  --site-header-height: calc(3rem + 0.875rem * 1.6 + 1px);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-white);
  -webkit-font-smoothing: antialiased;
}

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

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid var(--color-border);
}

.site-header-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.contact-link {
  font-size: 0.875rem;
  color: #295edb;
  transition: color 0.2s;
}

.contact-link:hover {
  color: #1f4bb8;
}

.hero {
  padding: 0 clamp(1.5rem, 5vw, 4rem) var(--hero-padding);
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: calc(var(--site-header-height) + var(--hero-padding));
}

.hero-text {
  text-align: center;
  max-width: calc(var(--max-width) * 0.9);
  width: 100%;
  margin: 0 auto;
}

.hero-text .bio-lead {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.35;
}

.hero-text .bio-name {
  color: #295edb;
}

.hero-text .bio-desc {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-top: 2rem;
  max-width: 58%;
  margin-left: auto;
  margin-right: auto;
}

.project-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  width: 100%;
  margin-left: auto;
}

.project-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

.project {
  padding: var(--section-padding) clamp(1.5rem, 5vw, 4rem);
}

#meta {
  padding-top: calc(var(--section-padding) + 1.5rem);
}

.project--light,
.project--white,
.project--dark {
  background: var(--color-bg-white);
  color: var(--color-text);
}

.project-link {
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-content {
  max-width: 70ch;
}

.project-content h2 {
  font-size: clamp(1.375rem, 2.25vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.project-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-content p,
.project--light .project-content p,
.project--white .project-content p,
.project--dark .project-content p {
  color: var(--color-text-muted);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.project-meta div {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.project-meta dt {
  font-weight: 600;
  min-width: 6.5rem;
  flex-shrink: 0;
}

.project-meta__spacer {
  visibility: hidden;
}

.project-meta dd {
  line-height: 1.5;
}

.project--light .project-meta dd,
.project--white .project-meta dd,
.project--dark .project-meta dd {
  color: var(--color-text-muted);
}

.project-content .project-case-study,
.detail-content .project-case-study {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 3rem;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.project-case-study a {
  color: #295edb;
  transition: color 0.2s;
}

.project-case-study a:hover {
  color: #1f4bb8;
}

/* Detail pages */
.detail-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: var(--section-padding) clamp(1.5rem, 5vw, 4rem);
  max-width: var(--max-width);
  margin: 0 auto;
}

.detail-page--dark,
.detail-page--light,
.detail-page--white {
  background: var(--color-bg-white);
  color: var(--color-text);
  max-width: 100%;
}

.back-link {
  position: fixed;
  top: 1.5rem;
  left: clamp(1.5rem, 5vw, 4rem);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  z-index: 10;
  transition: color 0.2s;
}

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

.detail-content {
  max-width: 42ch;
}

.detail-content h1 {
  font-size: clamp(1.375rem, 2.25vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.detail-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.detail-page--dark .detail-content p,
.detail-page--light .detail-content p,
.detail-page--white .detail-content p {
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .hero {
    --hero-padding: clamp(6rem, 18vw, 9rem);
    padding: 0 clamp(1.5rem, 5vw, 4rem) var(--hero-padding);
  }

  .hero-inner {
    padding-top: calc(var(--site-header-height) + var(--hero-padding));
  }

  .hero-text .bio-lead {
    font-size: clamp(2.25rem, 8vw, 3.25rem);
  }

  .hero-text .bio-desc {
    max-width: 100%;
    margin-top: 1.5rem;
  }

  .project-link,
  .detail-page {
    grid-template-columns: 1fr;
  }
}
