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

:root {
  --bg: #000000;
  --text: #f5f5f5;
  --text-muted: #888888;
  --border: #222222;
  --accent: #ffffff;
  --font: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --header-pad: clamp(1.25rem, 4vw, 2.5rem);
  --page-max: 72rem;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

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

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  padding: var(--header-pad);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.site-header__left {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.home-btn {
  flex-shrink: 0;
  display: block;
  line-height: 0;
  border-radius: 0.375rem;
  overflow: hidden;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

.home-btn__img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 0.375rem;
}

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link--active {
  color: var(--text);
}

/* Hero (index) */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--header-pad);
  text-align: center;
  overflow: visible;
}

.hero-title-wrap {
  position: relative;
  display: inline-block;
  overflow: visible;
}

.hero-title {
  font-size: clamp(3.5rem, 14vw, 9rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--accent);
  position: relative;
  z-index: 1;
  transition: text-shadow 0.3s ease;
}

.hero-title.is-beaming {
  text-shadow:
    0 0 24px rgba(255, 255, 255, 0.35),
    0 0 48px rgba(255, 255, 255, 0.15);
}

.hero-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}

.hero-ray {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5px;
  height: var(--ray-length, 40vmin);
  margin-left: -0.75px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.65) 8%,
    rgba(255, 255, 255, 0.28) 35%,
    rgba(255, 255, 255, 0.06) 70%,
    transparent 100%
  );
  transform-origin: top center;
  transform: rotate(var(--angle)) scaleY(0);
  opacity: 0;
  will-change: transform, opacity;
}

.hero-burst.is-active .hero-ray {
  animation: raySunrise 2s cubic-bezier(0.12, 0.72, 0.18, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes raySunrise {
  0% {
    transform: rotate(var(--angle)) scaleY(0);
    opacity: 0;
  }
  6% {
    opacity: 0.35;
  }
  18% {
    transform: rotate(var(--angle)) scaleY(0.22);
    opacity: 0.75;
  }
  40% {
    transform: rotate(var(--angle)) scaleY(0.55);
    opacity: 0.92;
  }
  65% {
    transform: rotate(var(--angle)) scaleY(0.82);
    opacity: 0.7;
  }
  85% {
    transform: rotate(var(--angle)) scaleY(0.96);
    opacity: 0.4;
  }
  100% {
    transform: rotate(var(--angle)) scaleY(1);
    opacity: 0;
  }
}

.hero-subtitle {
  margin-top: 1.5rem;
  font-size: clamp(0.8125rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Subpages */
.page-main {
  min-height: 100dvh;
  padding: calc(var(--header-pad) + 4rem) var(--header-pad) var(--header-pad);
  max-width: var(--page-max);
  margin: 0 auto;
}

.page-intro {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.page-intro .page-title:only-child {
  margin-top: 0;
}

.page-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.page-desc {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  list-style: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #0a0a0a;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: #444444;
  transform: translateY(-2px);
}

.project-card__image-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111111;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card__image {
  transform: scale(1.03);
}

.project-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
}

.project-card__content {
  flex: 1;
}

.project-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 1.25rem;
}

.project-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-card__tagline {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
}

.project-card__desc {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.project-card__tagline + .project-card__desc {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6a6a6a;
  line-height: 1.6;
}

.project-card__desc + .project-card__desc {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6a6a6a;
}

.project-card__link {
  display: inline-block;
  margin-top: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.project-card__link:hover {
  color: var(--text);
}

/* Contact list */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 36rem;
}

.contact-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.contact-item:first-child {
  border-top: 1px solid var(--border);
}

.contact-item__label {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact-item__value {
  font-size: 1.0625rem;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.contact-item__value a {
  transition: opacity 0.2s ease;
}

.contact-item__value a:hover {
  opacity: 0.7;
}

/* Coming soon page */
.coming-soon {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-pad) + 3rem) var(--header-pad) var(--header-pad);
  text-align: center;
}

.coming-soon__message {
  max-width: 42rem;
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.55;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Fade-in on load */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .contact-item {
    flex-direction: column;
    gap: 0.375rem;
  }

  .contact-item__value {
    text-align: left;
  }
}
