:root {
  color-scheme: light;
  --background: #f8f7f4;
  --surface: #ffffff;
  --surface-soft: #fbfaf8;
  --surface-muted: #efede8;
  --border: #e5e2dc;
  --border-strong: #b8b3aa;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #7d8c8d;
  --accent-soft: #e6ece9;
  --shadow: 0 18px 48px -32px rgba(29, 29, 31, 0.22);
  --shadow-hover: 0 24px 70px -36px rgba(29, 29, 31, 0.3);
  --radius-card: 20px;
  --radius-media: 14px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 247, 244, 0.94) 42%),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  padding-top: 64px;
}

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

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

section {
  scroll-margin-top: 88px;
}

.shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(229, 226, 220, 0.72);
  background: rgba(248, 247, 244, 0.84);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.site-header.has-brand .brand {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-nav,
.footer-links,
.link-row,
.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav {
  justify-content: flex-end;
  gap: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.site-nav a {
  white-space: nowrap;
  transition: color 160ms ease;
}

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

.intro {
  display: grid;
  grid-template-columns: 140px minmax(0, 680px);
  gap: 32px;
  align-items: center;
  padding-block: 72px 40px;
  animation: rise 680ms ease both;
}

.portrait-frame {
  width: 132px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-muted);
  box-shadow: var(--shadow);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 5.8vw, 4.8rem);
  font-weight: 650;
  line-height: 0.95;
  white-space: nowrap;
}

.intro-line {
  max-width: 640px;
  margin-bottom: 16px;
  color: #373739;
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
}

.intro-note,
.section-heading p,
.project-summary {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.intro-note {
  max-width: 560px;
  margin-bottom: 28px;
}

.pill-link,
.project-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 650;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.pill-link:hover,
.project-link:hover {
  border-color: var(--text);
  background: var(--surface);
  transform: translateY(-1px);
}

[aria-disabled="true"] {
  cursor: not-allowed;
}

.projects-section {
  padding-block: 0 96px;
}

.placeholder-section {
  padding-block: 0 88px;
}

.placeholder-section .section-heading {
  border-top: 1px solid var(--border);
  max-width: none;
  padding-top: 48px;
}

.section-heading {
  max-width: 640px;
  margin-bottom: 24px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 650;
  line-height: 1.08;
}

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

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

#discussion .media-grid {
  max-width: 900px;
}

.project-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.project-card:hover,
.project-card.is-expanded {
  border-color: rgba(29, 29, 31, 0.18);
  box-shadow: var(--shadow-hover);
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-card.is-expanded:hover {
  transform: none;
}

.project-card.is-expanded {
  grid-column: 1 / -1;
  transform: none;
}

.media-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.media-card:hover {
  border-color: rgba(29, 29, 31, 0.18);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.media-card img {
  width: 100%;
  aspect-ratio: 2.52 / 1;
  object-fit: contain;
  background: var(--surface-muted);
}

.media-card h3 {
  margin: 0;
  padding: 20px 22px 24px;
}

#discussion .media-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-card.is-expanded .project-preview {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: auto;
}

.project-preview {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex: 1;
  flex-direction: column;
  cursor: pointer;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.22;
}

.project-summary {
  margin-bottom: 20px;
}

.project-card-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
}

.hackathon-tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #ffffff;
  padding: 7px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.hackathon-trophy {
  font-size: 0.8rem;
  line-height: 1;
}

.project-expanded {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.project-expanded[hidden] {
  display: none;
}

.project-carousel {
  min-width: 0;
  background: var(--surface-muted);
}

.carousel-frame {
  display: grid;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f4f2ee;
  place-items: center;
}

.carousel-frame::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(29, 29, 31, 0.06));
  content: "";
  pointer-events: none;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 500ms ease;
}

.carousel-image[style*="contain"] {
  padding: 14px;
}

.project-card:hover .carousel-image {
  transform: scale(1.045);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1;
  opacity: 0.72;
  transform: translateY(-50%);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.carousel-arrow[hidden] {
  display: none;
}

.carousel-arrow:hover {
  opacity: 0.95;
  transform: translateY(-50%) scale(1.04);
}

.carousel-arrow:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.carousel-previous {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.expanded-copy {
  max-width: 780px;
  min-width: 0;
  padding-top: 0;
}

h4 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.expanded-description {
  margin-bottom: 22px;
  color: #373739;
  font-size: 1.02rem;
  line-height: 1.65;
}

.related-content {
  margin-bottom: 22px;
}

.related-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.expanded-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.expanded-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--text);
  color: #ffffff;
  padding: 0 15px;
  font-size: 0.85rem;
  font-weight: 650;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.expanded-link:hover {
  background: #343436;
  transform: translateY(-1px);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.54);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 36px;
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-inner span {
  color: var(--text);
  font-weight: 700;
}

.footer-link {
  text-decoration: underline;
  text-decoration-color: rgba(110, 110, 115, 0.28);
  text-underline-offset: 4px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .header-inner {
    min-height: 64px;
  }

  .site-nav {
    flex-wrap: nowrap;
    gap: 14px;
    font-size: 0.74rem;
    overflow-x: auto;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-block: 40px 28px;
  }

  .portrait-frame {
    width: 112px;
  }

  h1 {
    font-size: clamp(2.2rem, 10.8vw, 3rem);
  }

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

  .media-card h3 {
    padding: 18px;
  }

  .project-card.is-expanded .project-preview {
    display: flex;
  }

  .project-expanded {
    padding: 18px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
