:root {
  --bg: #ffffff;
  --text: #37352f;
  --muted: #7d7c78;
  --border: #e7e6e6;
  --card: #f8f8f8;
  --card-hover: #f4f4f4;
  --quote: #e2edff;
  --button-bg: #1f5f9f;
  --button-text: #ffffff;
  --focus: #2563eb;
  --max: 1000px;
  --post-max: 740px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgb(37 99 235 / 18%);
}

a {
  color: var(--text);
  touch-action: manipulation;
}

:where(a, button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  transform: translateY(calc(-100% - 24px));
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.18s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

main,
.site-header,
.site-footer {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

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

.site-header nav {
  display: flex;
  gap: 0.7rem;
}

.site-header nav a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-header nav a:hover {
  color: var(--text);
}

.brand {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
}

.brand span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

main {
  padding: 2rem 0 4rem;
}

section {
  margin-top: 2.4rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

:where(h1, h2, h3, section[id]) {
  scroll-margin-top: 72px;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.045em;
}

h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0.65rem 0 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 2rem;
  align-items: start;
}

.hero-copy p {
  max-width: 60ch;
}

.hero-quote {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  background: var(--quote);
  border: 0;
  font-size: 1.28rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.portrait {
  width: 100%;
  max-width: 320px;
  height: auto;
  justify-self: center;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 50%;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 7px;
  text-decoration: none;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 500;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.button:hover {
  background: #174c82;
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
  opacity: 0.92;
}

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

.skill-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.95rem;
  background: #fff;
}

.skill-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 0.45rem;
}

.soft-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
}

.soft-lead {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--quote);
  padding: 1.05rem 1.1rem;
}

.soft-overline {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.soft-lead h3 {
  margin-top: 0.5rem;
  font-size: 1.65rem;
  line-height: 1.1;
}

.soft-lead ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.soft-lead li {
  margin-bottom: 0.35rem;
}

.soft-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.soft-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.85rem 0.9rem;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.7rem;
  align-items: start;
}

.soft-item .skill-icon {
  margin: 0.05rem 0 0;
}

.soft-item h3 {
  font-size: 1.03rem;
}

.soft-item p {
  margin-top: 0.3rem;
}

.project-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), background-color 0.25s ease;
}

.project-card:hover {
  opacity: 0.9;
  transform: translateY(-4px);
  background: var(--card-hover);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card div {
  padding: 1rem;
}

.project-card-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

.project-card-featured h3 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-top: 0.7rem;
}

.pill {
  display: inline-block;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  background: #f2f2f2;
}

.all-posts-title {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.8rem;
}

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

.project-grid .project-card-medium:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.project-card-medium img {
  height: 220px;
}

.project-card-medium p:not(.meta) {
  color: var(--muted);
  font-size: 0.98rem;
}

.meta,
.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.post {
  width: min(var(--post-max), 100%);
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.post-header {
  text-align: center;
}

.post h1 {
  font-size: 3rem;
  letter-spacing: -0.045em;
}

.hero-image {
  width: 120%;
  max-width: 120%;
  height: auto;
  margin: 1.2rem -10% 1.4rem;
  border-radius: 8px;
}

.post-content {
  font-size: 1.2rem;
  line-height: 1.4;
}

.post-content blockquote {
  margin: 0.9rem 0 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  background: var(--quote);
  border: 0;
  font-size: 1.26rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post-content h2,
.post-content h3 {
  margin-top: 1.35rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.3rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-content figure {
  margin: 1rem 0;
}

.hero-caption {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.embed-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin: 1.25rem 0;
  overflow: hidden;
}

.embed-wrap iframe {
  width: 100%;
  min-height: 520px;
  border: 0;
}

.embed-fallback {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.9rem;
  margin: 1.1rem 0;
}

.embed-fallback img {
  width: 100%;
  border-radius: 6px;
}

.embed-fallback p {
  margin-top: 0.7rem;
}

.embed-fallback .button {
  background: #1f4f9c;
}

.embed-fallback .button:hover {
  background: #173f7e;
}

.link-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.viz-link-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
  background: #fff;
}

.viz-link-card:hover {
  background: var(--card-hover);
}

.viz-link-card:focus-visible {
  background: var(--card-hover);
}

.viz-link-card strong {
  display: block;
  font-size: 1rem;
}

.viz-link-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

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

@media (max-width: 768px) {
  main,
  .site-header,
  .site-footer {
    width: calc(100% - 32px);
  }

  h1,
  .post h1 {
    font-size: 2.6rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .hero,
  .grid.two,
  .soft-layout,
  .project-grid,
  .project-card-featured {
    grid-template-columns: 1fr;
  }

  .soft-lead h3 {
    font-size: 1.35rem;
  }

  .project-card-featured {
    min-height: 0;
  }

  .project-card-featured img {
    height: auto;
  }

  .portrait {
    justify-self: center;
    max-width: 260px;
  }

  .project-grid .project-card-medium:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .project-card-featured h3 {
    font-size: 2rem;
  }

  .project-card-medium img {
    height: 200px;
  }

  .post-content {
    font-size: 1.1rem;
  }

  .post-content li {
    margin-bottom: 0.5rem;
  }

  .post-content blockquote {
    font-size: 1.18rem;
  }

  .hero-image {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 1.2rem;
  }

  .embed-wrap iframe {
    min-height: 360px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 0;
  }

  .brand span:last-child {
    font-size: 0.74rem;
  }

  .link-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
