:root {
  --bg: #0a0c0f;
  --panel: #11151b;
  --panel-2: #171d25;
  --ink: #edf1f6;
  --muted: #b0b8c4;
  --line: rgba(237, 241, 246, 0.2);
  --accent: #9ec4ff;
  --accent-2: #7fd0b8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --max-width: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(158, 196, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #0d1014 0%, #090b0e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
}

.site-frame {
  position: relative;
  width: min(calc(100% - 12px), var(--max-width));
  margin: 18px auto 40px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.masthead-home {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 0;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(9, 11, 14, 0.7), rgba(9, 11, 14, 0.08));
}

.signature,
.mastnav a,
.socials a,
.project-card {
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.signature {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.mastnav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mastnav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 2px;
}

.mastnav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.socials {
  display: flex;
  gap: 14px;
}

.socials a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mastnav a:hover,
.signature:hover,
.socials a:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.homepage {
  display: grid;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

h1,
h2,
h3 {
  line-height: 1;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

.projects-page {
  display: grid;
}

.portfolio-page {
  display: grid;
}

.contact-page {
  display: grid;
}

.projects-strip {
  border-bottom: 1px solid var(--line);
}

.project-card p,
.page-copy,
.hero-overlay p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-visual {
  position: relative;
  min-height: 720px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0d1014;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(9, 11, 14, 0.58), rgba(9, 11, 14, 0.22) 22%, rgba(9, 11, 14, 0.34) 52%, rgba(9, 11, 14, 0.84) 100%),
    linear-gradient(90deg, rgba(9, 11, 14, 0.34), rgba(9, 11, 14, 0.08) 36%, rgba(9, 11, 14, 0.4) 100%);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 22%;
  background: linear-gradient(180deg, rgba(10, 12, 15, 0), rgba(10, 12, 15, 0.9));
}

.hero-wordmark {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 110px;
  z-index: 2;
  max-width: 10ch;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  color: var(--accent);
  text-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(158, 196, 255, 0.22);
}

.hero-overlay {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  max-width: 560px;
  padding: 18px 20px;
  background: rgba(10, 12, 15, 0.68);
  border: 1px solid rgba(237, 241, 246, 0.16);
  box-shadow: var(--shadow);
}

.hero-kicker,
.section-label,
.card-label {
  display: inline-flex;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.projects-hero,
.projects-gallery,
.contact-hero,
.contact-form-section {
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.portfolio-grid {
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  max-width: 14ch;
  font-size: clamp(2.8rem, 8vw, 5rem);
}

.page-copy {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.projects-strip {
  padding: 28px;
}

.strip-heading {
  margin-bottom: 22px;
}

.strip-heading h2 {
  max-width: 14ch;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
}

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

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

.contact-hero,
.contact-form-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.contact-actions {
  display: grid;
  align-items: start;
  justify-items: end;
  padding-top: 18px;
}

.contact-form-aside {
  display: grid;
  gap: 16px;
  align-self: start;
}

.contact-aside-image {
  display: block;
  width: 100%;
  min-height: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(237, 241, 246, 0.14);
  box-shadow: var(--shadow);
}

.contact-hero-copy {
  display: grid;
  align-content: start;
}

.contact-inline-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.contact-email-pill {
  display: inline-flex;
  align-items: center;
  padding: 11px 16px;
  border: 1px solid rgba(237, 241, 246, 0.12);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.contact-github-link {
  display: inline-grid;
  justify-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.contact-github-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-github-icon {
  width: 46px;
  height: 46px;
}

.contact-github-handle {
  font-family: "Sora", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.floating-monogram-card {
  --card-radius: 24px;
  --card-rotate-x: 0deg;
  --card-rotate-y: 0deg;
  --card-shift-x: 0px;
  --card-glow-x: 18%;
  --card-glow-y: 18%;
  position: relative;
  width: min(100%, 260px);
  min-height: 286px;
  padding: 1px;
  border-radius: var(--card-radius);
  background:
    linear-gradient(180deg, rgba(194, 220, 255, 0.18), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(158, 196, 255, 0.24), rgba(52, 88, 145, 0.06) 42%, rgba(8, 13, 20, 0.02));
  box-shadow:
    0 26px 50px rgba(0, 0, 0, 0.34),
    0 0 42px rgba(86, 130, 196, 0.2);
  overflow: hidden;
  transform-origin: center;
  transform: perspective(1200px) rotateX(var(--card-rotate-x)) rotateY(var(--card-rotate-y));
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
  animation: monogram-float 9.5s ease-in-out infinite;
  will-change: transform;
}

.floating-monogram-card__inner {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 284px;
  padding: 26px 24px 24px;
  border-radius: calc(var(--card-radius) - 1px);
  background:
    radial-gradient(circle at top right, rgba(110, 156, 229, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(18, 25, 36, 0.76), rgba(10, 14, 19, 0.92)),
    rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.floating-monogram-card__glow,
.floating-monogram-card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-monogram-card__glow {
  background:
    radial-gradient(circle at var(--card-glow-x) var(--card-glow-y), rgba(158, 196, 255, 0.3), transparent 30%),
    radial-gradient(circle at 82% 24%, rgba(126, 174, 245, 0.12), transparent 24%),
    radial-gradient(circle at 22% 78%, rgba(102, 142, 208, 0.1), transparent 26%);
  filter: blur(2px);
}

.floating-monogram-card__sheen {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent 24%, transparent 72%, rgba(255, 255, 255, 0.05)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%);
  mix-blend-mode: screen;
  opacity: 0.8;
}

.floating-monogram-card__initials,
.floating-monogram-card__label {
  margin: 0;
}

.floating-monogram-card__initials {
  position: relative;
  z-index: 1;
  font-family: "Sora", sans-serif;
  font-size: clamp(3.4rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: #f1f5fb;
  text-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(158, 196, 255, 0.18);
}

.floating-monogram-card__label {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(176, 184, 196, 0.82);
}

@keyframes monogram-float {
  0%,
  100% {
    transform:
      perspective(1200px)
      translate3d(var(--card-shift-x), 0, 0)
      rotateX(var(--card-rotate-x))
      rotateY(var(--card-rotate-y))
      rotate(-1.4deg);
  }

  50% {
    transform:
      perspective(1200px)
      translate3d(var(--card-shift-x), -10px, 0)
      rotateX(var(--card-rotate-x))
      rotateY(var(--card-rotate-y))
      rotate(0.6deg);
  }
}

.contact-success {
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(127, 208, 184, 0.14);
  border: 1px solid rgba(127, 208, 184, 0.28);
}

.contact-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 143, 143, 0.14);
  border: 1px solid rgba(255, 143, 143, 0.28);
}

.contact-form {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 28px 28px 26px 76px;
  min-height: 680px;
  border: 1px solid rgba(78, 59, 29, 0.16);
  border-radius: 22px;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.34),
    0 3px 0 rgba(255, 255, 255, 0.2) inset;
  color: #1f2430;
  background:
    linear-gradient(90deg, transparent 0, transparent 50px, rgba(214, 89, 89, 0.5) 50px, rgba(214, 89, 89, 0.5) 52px, transparent 52px),
    repeating-linear-gradient(180deg, rgba(76, 131, 196, 0.2) 0, rgba(76, 131, 196, 0.2) 1px, transparent 1px, transparent 38px),
    linear-gradient(180deg, #fff8de 0%, #f8efcf 100%);
  overflow: hidden;
}

.contact-form::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 34%),
    radial-gradient(circle at top right, rgba(122, 93, 41, 0.08), transparent 28%);
}

.contact-form-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -6px 0 2px;
}

.contact-form-full {
  grid-column: 2;
}

.contact-form-heading p {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #283149;
}

.contact-form-pin {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ffb1b1, #d95858 65%, #a63737 100%);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(255, 255, 255, 0.3);
}

.contact-field {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.contact-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52607f;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 10px 0 8px;
  font: inherit;
  color: #1f2430;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(76, 131, 196, 0.42);
  border-radius: 0;
  outline: none;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-bottom-color: #375f9f;
  box-shadow: inset 0 -1px 0 #375f9f;
}

.contact-field textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 2.4;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 36px,
    rgba(76, 131, 196, 0.22) 36px,
    rgba(76, 131, 196, 0.22) 37px
  );
}

.contact-submit {
  justify-self: start;
  position: relative;
  z-index: 1;
  margin-top: 4px;
  padding: 12px 18px;
  border: 1px solid rgba(46, 59, 86, 0.22);
  border-radius: 14px;
  background: rgba(255, 250, 232, 0.9);
  color: #283149;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.contact-submit:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 59, 86, 0.42);
  background: #fffdf3;
}

.contact-hp {
  position: absolute;
  left: -9999px;
}

.video-card-square {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(237, 241, 246, 0.12);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border-radius: 0;
}

.video-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 6px 0 20px;
  border-radius: 0;
  border: 1px solid rgba(237, 241, 246, 0.1);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(158, 196, 255, 0.16), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.video-embed {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.video-meta span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid rgba(237, 241, 246, 0.12);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.84rem;
}

.video-play {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(10, 12, 15, 0.72);
  border: 1px solid rgba(237, 241, 246, 0.16);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(237, 241, 246, 0.12);
  box-shadow: var(--shadow);
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(158, 196, 255, 0.36);
}

.project-card-featured {
  background:
    linear-gradient(180deg, rgba(158, 196, 255, 0.12), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.project-card-tall {
  min-height: 320px;
}

.project-card p {
  margin-top: 16px;
  max-width: 34ch;
}

.card-action {
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 980px) {
  .projects-grid,
  .projects-gallery,
  .portfolio-grid,
  .contact-actions,
  .contact-hero,
  .contact-form-section {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-items: start;
    padding-top: 6px;
  }

  .floating-monogram-card {
    width: min(100%, 220px);
    min-height: 244px;
  }

  .floating-monogram-card__inner {
    min-height: 242px;
  }
}

@media (max-width: 680px) {
  .site-frame {
    width: min(calc(100% - 10px), var(--max-width));
    margin-top: 10px;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }

  .masthead-home {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .projects-strip,
  .projects-hero,
  .projects-gallery,
  .portfolio-grid,
  .contact-hero,
  .contact-form-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-visual {
    min-height: 520px;
  }

  .hero-wordmark {
    left: 20px;
    right: 20px;
    top: 108px;
    max-width: 7ch;
    font-size: clamp(3.1rem, 16vw, 5.2rem);
  }

  .hero-overlay {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .contact-actions {
    display: none;
  }

  .contact-inline-actions {
    gap: 16px;
  }
}

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

  .floating-monogram-card {
    animation: none;
    transform: none;
    transition: none;
  }
}
