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

:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --text: #111111;
  --text-muted: #6a6a6a;
  --border: #e4e4e4;
  --border-subtle: #ededed;
  --placeholder: #ececec;
  --accent: #111111;

  --font-display: "Galvji", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-text: 100%;
  --container-work: 100%;
  --content-max: 1080px;
  --space: clamp(0.75rem, 2.5vw, 1.25rem);
  --space-x: 1rem;
  --radius: 6px;
  --radius-lg: 8px;
}

@font-face {
  font-family: "Galvji";
  src: url("../assets/fonts/Galvji-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(17, 17, 17, 0.12);
  color: var(--text);
}

[id] {
  scroll-margin-top: 4.5rem;
}

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

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

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--space-x);
  padding-right: var(--space-x);
}

.container--text {
  max-width: none;
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem var(--space-x);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
}

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

.site-header nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.nav-resume {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-resume:hover {
  border-color: #b0b0b0;
  background: var(--surface);
}

/* Hero */

.hero {
  min-height: clamp(18rem, 42vh, 26rem);
  display: flex;
  align-items: center;
  padding: calc(var(--space) * 2) var(--space-x) var(--space);
  margin-top: 3rem;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero-label::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: var(--border);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 5rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin-bottom: 0.875rem;
  white-space: pre-line;
}

.lead {
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  max-width: 42ch;
  margin-bottom: 1.25rem;
}

.typewriter {
  display: grid;
}

/* Galvji's r-t pair is naturally tight, and the hero's negative tracking
   makes the letters collide at display sizes. This opens just that pair. */
.kern-rt {
  letter-spacing: 0;
}

.typewriter__ghost {
  grid-area: 1 / 1;
  visibility: hidden;
  user-select: none;
}

.typewriter__line {
  grid-area: 1 / 1;
}

.typewriter__cursor {
  margin-left: 0.05em;
  animation: typewriter-cursor 1s step-end infinite;
}

.typewriter__cursor.is-done {
  animation: none;
  opacity: 0;
}

@keyframes typewriter-cursor {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Tags */

.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.tag--concept {
  background: #ececec;
  color: var(--text-muted);
}

.tag--professional {
  background: #e8efeb;
  color: #3d5c4e;
}

/* Case studies */

.case-study {
  padding: calc(var(--space) * 1.5) 0;
  border-bottom: 1px solid var(--border);
}

.section--shader {
  position: relative;
  /* clip (not hidden) so position: sticky keeps working for rows inside */
  overflow: clip;
  isolation: isolate;
}

/* Fixed background stage: one shader layer per work section, crossfading
   as the visitor moves between sections. Slides scroll over this. */

.deck-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.deck-bg__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.deck-bg__layer.is-active {
  opacity: 0.7;
}

.deck-bg__layer[data-shader="net-set"]:not([data-paper-shader]) {
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(45, 106, 79, 0.35), transparent 70%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(82, 183, 136, 0.22), transparent 70%);
}

.section__content {
  position: relative;
  z-index: 1;
}

.case-study--featured {
  padding: calc(var(--space) * 2.5) 0;
}

.case-study--featured .cover-panel {
  min-height: clamp(18rem, 42vw, 26rem);
  margin-bottom: 1rem;
}

.case-study--featured .cover-panel img {
  min-height: clamp(18rem, 42vw, 26rem);
}

.case-study--featured .cover-panel__title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
}

.case-study--professional {
  padding: var(--space) 0;
}

.case-study--professional .cover-panel {
  min-height: 12rem;
}

.case-study--professional .cover-panel img {
  min-height: 12rem;
}

.case-study--professional .cover-panel__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.case-study--professional .cover-panel__text {
  font-size: 0.8125rem;
}

/* Section markers */

.section-marker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-marker__num {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.section-marker__line {
  width: 2.5rem;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.section-marker__name {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--text-muted);
}

.case-study-header {
  margin-bottom: 1.25rem;
}

.case-study-header h2,
.about-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 0.5rem;
}

.case-study-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.case-study-copy {
  margin-bottom: 1.5rem;
}

.case-study-copy p + p {
  margin-top: 1rem;
}

.case-study-copy p {
  color: var(--text-muted);
}

.case-study-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Cover panels */

.cover-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
  min-height: 14rem;
  border-radius: var(--radius-lg);
  background: var(--placeholder);
  cursor: zoom-in;
}

.cover-panel picture {
  display: contents;
}

.cover-panel img {
  width: 100%;
  height: 100%;
  min-height: 14rem;
  object-fit: cover;
  background: var(--placeholder);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.7s ease;
}

.cover-panel:hover img {
  transform: scale(1.02);
}

.cover-panel .media-fallback {
  background: linear-gradient(135deg, #121212, #262626);
  color: rgba(255, 255, 255, 0.78);
}

.cover-panel__shade {
  position: absolute;
  inset: 0 auto 0 0;
  width: 52%;
  background:
    linear-gradient(
      90deg,
      rgba(8, 8, 8, 0.92) 0%,
      rgba(8, 8, 8, 0.78) 48%,
      rgba(8, 8, 8, 0.32) 80%,
      rgba(8, 8, 8, 0) 100%
    );
  z-index: 1;
  pointer-events: none;
}

.cover-panel__content {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 52%;
  max-width: 36rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  color: #fff;
}

.cover-panel__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

.cover-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 5vw, 3.125rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.cover-panel__text {
  margin: 0;
  max-width: 24rem;
  font-size: clamp(0.8125rem, 1.4vw, 0.9375rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.cover-panel.is-loaded .media-fallback {
  display: none;
}

.cover-panel.is-loaded img {
  opacity: 1;
}

.cover-panel--personal {
  background: var(--bg);
}

.cover-panel--personal img {
  width: calc(100% + 2px);
  margin-left: -1px;
}

/* Media / placeholders */

.media {
  position: relative;
  margin-bottom: 0;
}

.case-study-gallery .media {
  cursor: zoom-in;
}

.case-study-gallery .media picture,
.grid-item picture {
  display: contents;
}

.case-study-gallery .media:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.media img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--placeholder);
  opacity: 0;
  min-height: 120px;
  transition: opacity 0.45s ease, transform 0.4s ease;
}

.case-study-gallery .media:hover img {
  transform: scale(1.01);
}

.media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--placeholder);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 1rem;
  pointer-events: none;
}

.media.is-loaded .media-fallback {
  display: none;
}

.media.is-loaded img {
  opacity: 1;
  min-height: auto;
}

.media--hero {
  margin-bottom: 2.5rem;
}

.media--hero img,
.media--hero .media-fallback {
  min-height: 420px;
  object-fit: cover;
}

.media figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.media-row--triple {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.625rem;
}

.media-row--triple .media {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.media-row--triple .media img,
.media-row--triple .media-fallback {
  width: 100%;
  height: clamp(9rem, 20vw, 14rem);
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.media-row--triple .media figcaption {
  margin-top: 0.5rem;
}

.media--optional {
  opacity: 0.85;
}

.media--brand-kit {
  margin-bottom: 0;
}

.media--brand-kit img {
  width: calc(100% + 2px);
  margin-left: -1px;
  height: auto;
  min-height: 0;
  background: transparent;
  border-radius: 0;
  object-fit: initial;
}

.media--brand-kit .media-fallback {
  position: relative;
  inset: auto;
  min-height: 8rem;
  border-radius: 0;
}

.case-study-gallery--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Work grid section */

.work-grid-section {
  padding: calc(var(--space) * 1.5) 0;
  border-bottom: 1px solid var(--border);
}

.work-grid-section--concepts {
  padding: calc(var(--space) * 2) 0;
}

.work-grid-section--art {
  padding-top: calc(var(--space) * 2);
  padding-bottom: calc(var(--space) * 1.5);
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 0;
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: 0.75rem;
}

.work-grid-section--art .section-header h2 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.section-intro {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 42ch;
}

.work-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.work-grid--concepts {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.work-grid--concepts .grid-item {
  border-radius: var(--radius-lg);
}

/* Art gallery — full bleed */

.art-gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  width: 100%;
  margin-top: 0.75rem;
  background: var(--border-subtle);
}

.art-gallery .grid-item {
  border-radius: 0;
}

.art-gallery .grid-item::after {
  display: none;
}

.art-gallery .grid-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 88vh;
  object-fit: cover;
}

.art-gallery .grid-caption {
  opacity: 0;
}

.art-gallery .grid-item:hover .grid-caption,
.art-gallery .grid-item:focus-visible .grid-caption {
  opacity: 1;
}

.grid-item {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
  touch-action: manipulation;
  background: var(--placeholder);
  --aspect-ratio: 1 / 1;
}

.grid-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  transition: box-shadow 0.25s ease;
}

.grid-item:hover::after,
.grid-item:focus-visible::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.grid-item img {
  width: 100%;
  aspect-ratio: var(--aspect-ratio);
  object-fit: cover;
  background: var(--placeholder);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.grid-item .media-fallback {
  aspect-ratio: var(--aspect-ratio);
}

.grid-item.is-loaded img {
  opacity: 1;
}

.grid-item.is-loaded .media-fallback {
  display: none;
}

.grid-item:hover img,
.grid-item:focus-visible img {
  transform: scale(1.03);
}

.grid-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 0.75rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.grid-item:hover .grid-caption,
.grid-item:focus-visible .grid-caption {
  opacity: 1;
  transform: translateY(0);
}

/* About */

.about-section {
  padding: calc(var(--space) * 1.75) var(--space-x);
}

.about-section p {
  color: var(--text-muted);
  max-width: 58ch;
}

.about-availability {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text) !important;
  font-weight: 600;
}

.skills-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.skills-tags li {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.skills-tags li:hover {
  color: var(--text);
  border-color: #b0b0b0;
}

/* Contact */

/* Contact button (share-button pattern) */

.contact-button {
  position: relative;
  display: inline-block;
  margin-top: 0.25rem;
}

.contact-button__trigger {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 10rem;
  height: 2.5rem;
  padding: 0 1.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 1.5rem;
  background: var(--text);
  color: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.3s ease;
}

.contact-button__icon {
  flex-shrink: 0;
}

.contact-button__links {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: flex;
  height: 2.5rem;
  pointer-events: none;
}

.contact-button__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--text);
  color: var(--bg);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.contact-button__link:last-child {
  border-right: none;
}

.contact-button__link:hover {
  background: #e0e0e0;
}

.contact-button__link:first-child {
  border-radius: 1.5rem 0 0 1.5rem;
}

.contact-button__link:last-child {
  border-radius: 0 1.5rem 1.5rem 0;
}

.contact-button__link:nth-child(1) {
  transition-delay: 0ms;
}

.contact-button__link:nth-child(2) {
  transition-delay: 50ms;
}

.contact-button__link:nth-child(3) {
  transition-delay: 100ms;
}

.contact-button__link:nth-child(4) {
  transition-delay: 150ms;
}

.contact-button:hover .contact-button__trigger,
.contact-button.is-open .contact-button__trigger {
  opacity: 0;
  pointer-events: none;
}

.contact-button:hover .contact-button__link,
.contact-button.is-open .contact-button__link {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.contact-button:hover .contact-button__links,
.contact-button.is-open .contact-button__links {
  pointer-events: auto;
}

.contact-button--header {
  margin-top: 0;
}

.contact-button--header .contact-button__trigger {
  min-width: 7.25rem;
  height: 2.125rem;
  padding: 0 0.95rem;
  font-size: 0.75rem;
}

.contact-button--header .contact-button__links {
  left: auto;
  right: 0;
  flex-direction: row-reverse;
  height: 2.125rem;
}

.contact-button--header .contact-button__link {
  width: 2.125rem;
  height: 2.125rem;
  transform: translateX(100%);
  border-right: none;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.contact-button--header .contact-button__link:first-child {
  border-radius: 0 1.5rem 1.5rem 0;
}

.contact-button--header .contact-button__link:last-child {
  border-radius: 1.5rem 0 0 1.5rem;
  border-left: none;
}

.contact-button--header:hover .contact-button__link,
.contact-button--header.is-open .contact-button__link {
  transform: translateX(0);
}

.contact-alt {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
}

.contact-alt a {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-alt a:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Footer */

.site-footer {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1rem var(--space-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer a {
  transition: color 0.2s ease;
}

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

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
  background: rgba(4, 4, 4, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: lightbox-in 0.25s ease;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  max-width: min(1200px, 96vw);
  width: 100%;
  animation: lightbox-figure-in 0.3s ease;
}

@keyframes lightbox-figure-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox img {
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.lightbox figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #aaa;
}

.lightbox-close {
  position: absolute;
  top: var(--space);
  right: var(--space);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  opacity: 0.6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: opacity 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

/* Stacking rows: each content row pins and the next slides over it.
   Kept late in the file so sticky wins over the component position rules. */

/* Slide deck: every card fills the viewport and the next one slides
   over it, so the page itself never appears to scroll. Kept late in the
   file so these rules win over the older component rules. */

main {
  position: relative;
  z-index: 1;
}

.slide {
  position: relative;
  margin: 0;
  border: 0;
  background: transparent;
  isolation: isolate;
}

@media (min-width: 721px) {
  html {
    scroll-snap-type: y proximity;
  }

  .slide.slide {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem var(--space-x) 1.5rem;
    overflow: clip;
    scroll-snap-align: start;
  }

  .slide[id] {
    scroll-margin-top: 0;
  }

  .slide > .container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    padding-left: 0;
    padding-right: 0;
  }

  /* Hero: intro copy vertically centered, giant name near the bottom.
     Flex order keeps the DOM (and typewriter sequence) unchanged; the two
     auto top margins split the leftover space so the intro sits mid-screen. */
  .slide--hero > .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    height: 100%;
    max-width: none;
  }

  .slide--hero .hero-label {
    order: 0;
    margin-top: auto;
  }

  .slide--hero .lead {
    order: 1;
  }

  .slide--hero .btn {
    order: 2;
    margin-top: 1.5rem;
  }

  .slide--hero h1 {
    order: 3;
    margin-top: auto;
    margin-bottom: 2rem;
    font-size: clamp(5rem, 13.5vw, 14rem);
    line-height: 0.86;
    letter-spacing: -0.05em;
    white-space: pre-line;
  }

  .slide .cover-panel {
    height: min(70vh, 38rem);
    margin-bottom: 0;
  }

  .slide .cover-panel img {
    height: 100%;
    min-height: 0;
  }

  .slide .media {
    margin: 0;
  }

  .slide .media img {
    width: 100%;
    max-height: calc(100vh - 12rem);
    object-fit: contain;
    background: transparent;
    min-height: 0;
  }

  .slide .media-row {
    gap: 1rem;
  }

  .slide .work-grid--concepts {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
    max-width: 66rem;
    margin-inline: auto;
  }

  .slide .work-grid--concepts .grid-item img {
    max-height: calc(100vh - 12rem);
    object-fit: contain;
  }

  .slide .art-gallery {
    margin-top: 0;
    background: transparent;
    gap: 0.625rem;
  }

  .slide .art-gallery .grid-item {
    border-radius: var(--radius-lg);
  }

  .slide .art-gallery .grid-item img {
    max-height: calc(100vh - 12rem);
  }

  .slide .site-footer {
    padding: 1.5rem 0 0;
    margin-top: 1.5rem;
  }
}

@media (max-width: 720px) {
  .slide {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .slide--hero {
    padding-top: 4.5rem;
  }

  .slide .site-footer {
    padding: 1rem 0 0;
    margin-top: 1.5rem;
  }
}

/* Deck next control */

.deck-next {
  position: fixed;
  right: max(1.25rem, var(--space-x));
  bottom: 1.25rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.deck-next:hover {
  border-color: #b0b0b0;
  background: rgba(255, 255, 255, 0.95);
}

.deck-next:active {
  transform: translateY(1px);
}

.deck-next__icon {
  transition: transform 0.25s ease;
}

.deck-next[data-mode="top"] .deck-next__icon {
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .deck-next {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck-next,
  .deck-next__icon {
    transition: none;
  }
}

/* Responsive */

@media (min-width: 768px) {
  :root {
    --space-x: 1in;
    --content-max: 1040px;
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: auto;
    margin-top: 2.5rem;
    padding-top: calc(var(--space) * 1.5);
  }

  .cover-panel,
  .cover-panel img {
    min-height: 12rem;
  }

  .cover-panel__shade {
    inset: 0;
    width: 100%;
    background:
      linear-gradient(
        180deg,
        rgba(8, 8, 8, 0.12) 0%,
        rgba(8, 8, 8, 0.35) 30%,
        rgba(8, 8, 8, 0.88) 100%
      );
  }

  .cover-panel__content {
    justify-content: flex-end;
    width: 100%;
  }

  .cover-panel__text {
    max-width: none;
  }

  .media-row,
  .case-study-gallery--pair,
  .work-grid,
  .work-grid--concepts {
    grid-template-columns: 1fr;
  }

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

  .grid-caption {
    opacity: 1;
    transform: none;
  }

  .art-gallery {
    grid-template-columns: 1fr;
    gap: 0.625rem;
    margin-top: 1.25rem;
    padding-left: var(--space-x);
    padding-right: var(--space-x);
    background: transparent;
  }

  .art-gallery .grid-item {
    border-radius: var(--radius-lg);
  }

  .art-gallery .grid-item img {
    max-height: none;
    aspect-ratio: var(--aspect-ratio);
  }

  .art-gallery .grid-caption {
    opacity: 1;
    transform: none;
  }

  .case-study--featured .cover-panel,
  .case-study--featured .cover-panel img {
    min-height: 14rem;
  }

  .site-header nav {
    gap: 0.875rem;
  }

  .contact-button--header .contact-button__trigger {
    min-width: 2.125rem;
    width: 2.125rem;
    padding: 0;
  }

  .contact-button--header .contact-button__label {
    display: none;
  }

  .nav-resume {
    display: none;
  }
}

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

  .typewriter__cursor {
    animation: none;
    opacity: 0;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* School work page (unlisted) */

.school-page {
  background: var(--bg);
}

.school-page .deck-bg {
  z-index: 0;
}

.school-page .site-header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--border);
}

.school {
  position: relative;
  z-index: 1;
  padding-top: 4.5rem;
}

.school-hero {
  padding: calc(var(--space) * 2.5) var(--space-x) calc(var(--space) * 2);
}

.school-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-bottom: 0.875rem;
}

/* Soft white panels behind copy (shader legibility) */
.school-page .school-hero .hero-label,
.school-page .school-hero h1,
.school-page .school-hero .lead,
.school-page .school-toc a,
.school-page .school-project__header,
.school-page .school-gallery__title,
.school-page .school-slot,
.school-page .school-slot .media-fallback {
  background: rgba(255, 255, 255, 0.72);
}

.school-page .school-hero .hero-label,
.school-page .school-hero h1,
.school-page .school-hero .lead,
.school-page .school-gallery__title {
  display: table;
  padding: 0.28em 0.55em;
}

.school-page .school-hero .hero-label {
  margin-bottom: 0.55rem;
}

.school-page .school-hero h1 {
  margin-bottom: 0.65rem;
}

.school-page .school-hero .lead {
  margin-bottom: 0;
  padding-top: 0.35em;
  padding-bottom: 0.35em;
}

.school-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.school-toc a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  transition: color 0.2s ease;
}

.school-toc a:hover {
  color: var(--text);
}

.school-project {
  padding: calc(var(--space) * 2) 0;
}

.school-project__header {
  max-width: 42rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.15rem;
}

.school-project .container > .school-project__header {
  margin-left: 0;
  margin-right: 0;
}

.school-project__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.school-project__header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.school-project__intro {
  color: var(--text-muted);
  max-width: 48ch;
}

.school-gallery {
  margin-bottom: 1.75rem;
}

.school-gallery__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.school-gallery__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.school-gallery__grid--final {
  grid-template-columns: 1fr;
}

.school-gallery__grid--triple {
  grid-template-columns: repeat(3, 1fr);
}

.school-slot {
  margin: 0;
  min-height: 14rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.school-slot--wide {
  min-height: 22rem;
}

.school-slot img {
  width: 100%;
  height: auto;
  display: block;
}

.school-slot .media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.school-slot:has(img) {
  border-style: solid;
  background: transparent;
  min-height: 0;
}

.school-slot:has(img) .media-fallback {
  display: none;
}

.school-footer {
  margin-top: calc(var(--space) * 1.5);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

@media (max-width: 720px) {
  .school-gallery__grid,
  .school-gallery__grid--triple {
    grid-template-columns: 1fr;
  }

  .school-slot {
    min-height: 12rem;
  }

  .school-slot--wide {
    min-height: 16rem;
  }
}
