@font-face {
  font-family: "Rindu Hujan";
  src: url("assets/fonts/rindu-hujan.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Agrandir";
  src: url("assets/fonts/Agrandir-Narrow.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Agrandir";
  src: url("assets/fonts/Agrandir-Regular.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Agrandir";
  src: url("assets/fonts/Agrandir-TextBold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --coral: #e34b4e;
  --sky: #cbe1ed;
  --bg: #f8f8f8;
  --bg-elevated: #f2f2f2;
  --text: #1a1a1a;
  --text-muted: #4a4a4a;
  --text-faint: #767676;
  --border: rgba(26, 26, 26, 0.1);
  --accent: var(--coral);
  --accent-soft: color-mix(in srgb, var(--sky) 55%, white);
  --font-display: "Rindu Hujan", cursive;
  --font-subhead: "Agrandir", system-ui, sans-serif;
  --font-body: "Agrandir", system-ui, sans-serif;
  --max: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

#main {
  position: relative;
}

#main > :not(.connections) {
  position: relative;
  z-index: 1;
}

/* Connection graphics — home page */
.connections {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.page-home .connections,
.page-about .connections {
  -webkit-mask-image: none;
  mask-image: none;
}

.page-home #intro .intro__name-stage,
.page-home #intro .intro__disciplines,
.page-home #intro .intro__bio,
.page-home .project__link,
.page-home .project .carousel {
  position: relative;
  z-index: 1;
  background-color: var(--bg);
  box-shadow: 0 0 10px 6px var(--bg);
}

.page-home .project .carousel {
  box-shadow:
    0 0 10px 6px var(--bg),
    0 24px 60px rgba(28, 25, 22, 0.08);
}

.connections__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.connections__figures {
  position: absolute;
  inset: 0;
}

.connection-figure {
  position: absolute;
  width: clamp(26px, 2.96vw, 43px);
  aspect-ratio: 194 / 334.5;
  background-image: url("assets/connections/human-silhouettes.png");
  background-size: 400% 400%;
  background-repeat: no-repeat;
  background-position: var(--sprite-x, 0%) var(--sprite-y, 0%);
  opacity: 0.94;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.connection-figure--flip {
  transform: translate(-50%, -50%) scaleX(-1);
}

.connection-figure-group {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: clamp(2px, 0.35vw, 5px);
  transform: translate(-50%, -50%);
}

.connection-figure-group .connection-figure {
  position: relative;
  left: auto;
  top: auto;
  flex-shrink: 0;
  transform: none;
}

.connection-figure-group .connection-figure.connection-figure--flip {
  transform: scaleX(-1);
}

.connections__line {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connections__line--black {
  stroke: var(--text-muted);
  opacity: 0.315;
}

.connections__line--coral {
  stroke: var(--coral);
  opacity: 0.495;
  stroke-width: 1.5;
}

.connections__line--sky {
  stroke: #cbe1ed;
  opacity: 0.495;
  stroke-width: 1.35;
}

.connections__line--draw {
  animation: connection-draw 1.1s var(--ease) forwards;
}

.connections__line--fade {
  animation: connection-fade 0.8s var(--ease) forwards;
}

@keyframes connection-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes connection-fade {
  to {
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .connection-figure[data-hide-mobile],
  .connection-figure-group[data-hide-mobile] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .connections__line--draw,
  .connections__line--fade {
    animation: none;
  }
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
}

.shell {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-color: var(--border);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--coral);
  text-decoration: none;
}

.logo:hover {
  color: var(--coral);
}

.logo__icon {
  display: block;
  width: 1.75rem;
  height: auto;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 1.75rem;
}

.nav a {
  text-decoration: none;
  font-family: var(--font-subhead);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

/* Intro */
.intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
}

.intro__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  width: 100%;
}

.intro__name-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.intro__name-row {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.intro__name-a-measure {
  position: absolute;
  left: -9999px;
  top: 0;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.intro__name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 7.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.intro__name-icon {
  position: absolute;
  right: 100%;
  bottom: 0.08em;
  margin-right: 0.35rem;
  width: 3rem;
  height: auto;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
}

.intro__disciplines {
  justify-content: center;
}

.intro__title {
  font-family: var(--font-subhead);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  max-width: 28ch;
}

.intro__tagline {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list li {
  font-family: var(--font-subhead);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  background: var(--sky);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}

.intro__bio {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: clamp(1.35rem, 2.5vw, 1.85rem) clamp(1.5rem, 3vw, 2rem);
  width: min(100%, 42rem);
}

.intro__bio p {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.65;
}

.intro__about-link {
  display: inline-block;
}

/* Bio (legacy section — kept for subpages) */
.bio {
  padding: clamp(3rem, 8vh, 6rem) 0;
  border-top: 1px solid var(--border);
}

.bio p {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 1.25rem;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* Scroll cue */
.scroll-cue {
  padding: 1.25rem 0 3rem;
  text-align: center;
}

.scroll-cue__text {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(4px);
  }
}

/* Project teasers */
.project {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  border-top: 1px solid var(--border);
}

.project__inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .project__inner {
    grid-template-columns: 1fr 1.05fr;
    gap: 3.5rem;
  }

  .project--reverse .project__inner {
    direction: rtl;
  }

  .project--reverse .project__inner > * {
    direction: ltr;
  }
}

.project__link {
  display: block;
  position: relative;
  z-index: 2;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  outline-offset: 4px;
}

.project__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  pointer-events: none;
}

.project__link:focus-visible {
  outline: 2px solid var(--accent);
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.project__tags li {
  font-family: var(--font-subhead);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--sky);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.project__type {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.project__type li {
  font-family: var(--font-subhead);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--sky);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.project__title {
  font-family: var(--font-subhead);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.project__summary {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 46ch;
}

.project__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.project__pills li {
  font-family: var(--font-subhead);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--sky);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}


.project__cta::after {
  content: "→";
  transition: transform 0.2s var(--ease);
}

.project__link:hover .project__cta::after {
  transform: translateX(4px);
}

/* Carousel */
.carousel {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(28, 25, 22, 0.08);
}

.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.carousel__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Website screenshots — match PNG aspect ratio (~3024×1644) */
.carousel--screenshot {
  aspect-ratio: 3024 / 1644;
  background: transparent;
}

.carousel--screenshot .carousel__slide img {
  object-fit: cover;
  object-position: top center;
}

.carousel__dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.carousel__dot.is-active {
  background: var(--coral);
  transform: scale(1.2);
}

/* Footer */
.site-footer {
  padding: 4rem 0 3rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 60%, var(--bg));
}

.footer__grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 700px) {
  .footer__grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.footer__heading {
  font-family: var(--font-display);
  font-size: clamp(1.654rem, 2.835vw, 2.126rem);
  margin: 0 0 0.75rem;
  font-weight: 400;
  color: var(--text);
}

.footer__email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1rem;
}

.footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__socials a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

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

.footer__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* About page */
.page-about .intro__tagline,
.page-about .page-section ul,
.page-about .skills-grid p {
  position: relative;
  z-index: 1;
  background-color: var(--bg);
  box-shadow: 0 0 10px 6px var(--bg);
}

.page-about .back-link {
  margin-left: 50px;
}

.page-about .page-hero__copy,
.page-about .page-section.shell,
.page-about .site-footer .shell {
  padding-left: 50px;
}

.page-hero {
  padding: calc(var(--header-h) + 3rem) 0 2rem;
}

.page-hero__grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 860px) {
  .page-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
    gap: 3rem;
  }
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 400;
  margin: 0 0 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--coral);
}

html:not(.fonts-display-ready) .page-hero h1 {
  visibility: hidden;
}

html.fonts-display-ready .page-hero h1 {
  visibility: visible;
}

.page-hero .intro__tagline + .intro__tagline {
  margin-top: 1rem;
}

.about-slideshow {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
  margin-top: 50px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
}

@media (min-width: 860px) {
  .about-slideshow {
    margin-inline: 0;
    margin-left: -75px;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

.about-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.about-slideshow img.is-active {
  opacity: 1;
  z-index: 1;
}

.page-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.page-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.page-section ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.page-section li + li {
  margin-top: 0.35rem;
}

.skills-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.skills-grid p {
  margin: 0;
  color: var(--text-muted);
}

/* Case study */
.case-hero {
  padding: calc(var(--header-h) + 2.5rem) 0 2rem;
}

.case-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.case-hero__tags li {
  font-family: var(--font-subhead);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--sky);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

p.case-hero__tags {
  font-family: var(--font-subhead);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem;
}

.case-hero h1 {
  font-family: var(--font-subhead);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

.case-hero__lede {
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.case-meta strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.2rem;
}

.case-gallery {
  padding: 2rem 0 4rem;
}

.case-gallery__grid {
  display: grid;
  gap: 1.25rem;
}

.case-gallery__grid img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.case-body {
  padding-bottom: 3rem;
}

.case-body h2 {
  font-family: var(--font-subhead);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.case-body p,
.case-body li {
  color: var(--text-muted);
  max-width: 62ch;
}

.case-body ul {
  padding-left: 1.2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.external-link {
  color: var(--accent);
  font-weight: 600;
}

/* Case study — thematic sections */
.case-study {
  padding-bottom: 4rem;
}

.case-part {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.case-part > .shell > h2 {
  font-family: var(--font-subhead);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--text);
  text-transform: none;
}

.case-part h3 {
  font-family: var(--font-subhead);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.case-part h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
  color: var(--text);
}

.case-part p,
.case-part li {
  color: var(--text-muted);
  max-width: 65ch;
  margin: 0 0 1rem;
}

.case-part ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.case-figure {
  margin: 1.5rem 0 0;
}

.case-figure__grid {
  display: grid;
  gap: 1rem;
}

.case-figure__grid--process {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

@media (min-width: 720px) {
  .case-figure__grid--process {
    grid-template-columns: repeat(5, 1fr);
  }
}

.case-figure__grid--website {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.case-figure__grid--final {
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .case-figure__grid--final {
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: start;
  }
}

.case-figure__grid--merch {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.case-figure__grid--storefront {
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .case-figure__grid--storefront {
    grid-template-columns: 1fr 1fr;
  }
}

.case-figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.case-figure__grid--website img {
  border-radius: 4px;
}

.case-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.case-live-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.case-live-link:hover {
  border-color: var(--accent);
}

.case-shipped-note {
  font-size: var(--step--1, 0.92rem);
  color: var(--text-faint);
  margin-top: 0.5rem;
}

.carousel--linked {
  cursor: pointer;
}

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

a.carousel {
  display: block;
  text-decoration: none;
  color: inherit;
}

.carousel--preview {
  aspect-ratio: 16 / 9;
}

.carousel--preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
