@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

@font-face {
  font-family: "LCT Mogi";
  src: url("./public/fonts/lct-mogi-vf.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --wine: #3f0b0b;
  --cream: #dddbc0;
  --blue: #95c4ea;
  --corner-radius: 35px;
  --gallery-gap: 50px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wine); }
.site {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--blue);
  -webkit-user-select: none;
  user-select: none;
}
.page { position: relative; width: 100%; height: 100vh; overflow: hidden; }
.hero {
  --draw-duration: 1.3s;
  --fill-delay: 0.6s;
  --fill-duration: 0.5s;
  --draw-easing: cubic-bezier(0, 0.66, 0.5, 1);
  --stroke-width: 3.5px;
  background: var(--wine);
  color: var(--blue);
}
.hero h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 51.25%;
  height: 55%;
  margin: 0;
  transform: translate(-50%, -50%);
}
.hero h1 svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hero-title-line {
  --letter-duration: 0.164s;
  --letter-delay: 0s;
  --letter-fill-delay: 2.1s;
}
.hero-letter {
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: var(--stroke-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0 1200;
  stroke-opacity: 0;
  font-family: "LCT Mogi", sans-serif;
  font-size: 256px;
  font-weight: 400;
  font-variation-settings: "wdth" 700;
  letter-spacing: 0;
  animation: none;
}
.hero.is-animating .hero-letter {
  animation: draw-title var(--letter-duration) var(--draw-easing) var(--letter-delay) forwards,
    fill-title var(--fill-duration) ease-out var(--letter-fill-delay) forwards;
}
.hero.is-drawn .hero-letter {
  fill-opacity: 1;
  stroke-dasharray: 6000 0;
  stroke-opacity: 0;
}
@keyframes draw-title {
  from { stroke-dasharray: 0 1200; stroke-opacity: 0; }
  to { stroke-dasharray: 6000 0; stroke-opacity: 1; }
}
@keyframes fill-title {
  to { fill-opacity: 1; stroke-opacity: 0; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.about { background: var(--cream); color: var(--wine); }
.about-content {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5.183%;
  width: 51.25%;
  transform: translate(-50%, -50%);
}
.about h2 {
  position: relative;
  flex: 0 0 54.573%;
  width: 54.573%;
  height: auto;
  margin: 0;
  font: 400 min(6.667vw, 128px)/1.15625 "LCT Mogi", sans-serif;
  font-variation-settings: "wdth" 700;
  letter-spacing: 0;
}
.about-heading-line { white-space: nowrap; }
.about-arrow {
  width: 1.5em;
  height: auto;
  margin-inline-start: .22em;
  pointer-events: none;
}
.portrait-card {
  --orbit-overhang-x: 3.79%;
  --orbit-overhang-y: 2.81%;
  position: relative;
  flex: 0 0 40.244%;
  width: 40.244%;
  aspect-ratio: 396 / 534;
  margin: 0;
}
.portrait {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--corner-radius);
  object-fit: cover;
  object-position: center;
}
.orbit-geometry { position: absolute; pointer-events: none; }
.portrait-orbit {
  position: absolute;
  z-index: 1;
  left: calc(-1 * var(--orbit-overhang-x));
  top: calc(-1 * var(--orbit-overhang-y));
  width: calc(100% + 2 * var(--orbit-overhang-x));
  height: calc(100% + 2 * var(--orbit-overhang-y));
  pointer-events: none;
}
.portrait-orbit canvas {
  position: absolute;
  /* The extra 24 units on each side let the artwork extend past the orbit path. */
  left: calc(-24 / 426 * 100%);
  top: calc(-24 / 564 * 100%);
  width: calc(474 / 426 * 100%);
  height: calc(612 / 564 * 100%);
  color: var(--wine);
  font: 400 16px/1 "Bebas Neue", sans-serif;
}

@media (max-width: 700px) and (orientation: portrait) {
  .hero { height: 100svh; }
  .hero h1 { width: 88%; }

  .about {
    display: grid;
    place-items: center;
    height: auto;
    min-height: 100svh;
    padding: 32px 24px;
  }
  .about-content {
    position: static;
    flex-direction: column;
    gap: clamp(24px, 5svh, 44px);
    width: 100%;
    transform: none;
  }
  .about h2 {
    flex: none;
    width: max-content;
    font-size: clamp(32px, 12vw, 58px);
  }
  .about-arrow {
    width: 1em;
    margin-inline-start: .16em;
    vertical-align: .1em;
    transform: rotate(90deg);
  }
  .portrait-card {
    flex: none;
    width: min(62vw, 36svh, 280px);
  }
}

.work {
  position: relative;
  container-type: inline-size;
  --work-top: clamp(80px, 12.4vw, 238px);
  --ink-bloom-duration: 1600ms;
  --ink-corner-height: clamp(48px, 8.5vw, 120px);
  min-height: calc(100dvh + var(--ink-corner-height) + 2px);
  padding: var(--work-top) 24px clamp(80px, 8.33vw, 160px);
  background: var(--blue);
}
.work-transition {
  --ink-origin: calc(var(--work-top) + clamp(30px, 7vw, 115px));
  display: none;
  position: absolute;
  inset: 0;
  background: var(--cream);
  pointer-events: none;
}
.work[data-ink-bloom] .work-transition { display: block; }
.work-transition::before {
  position: absolute;
  inset: 0;
  background: var(--blue);
  clip-path: ellipse(0 0 at 50% var(--ink-origin));
  content: "";
}
.work[data-ink-bloom="playing"] .work-transition::before {
  animation: spread-ink var(--ink-bloom-duration) ease-out both;
}
.ink-corners {
  display: none;
  position: absolute;
  inset: 0 0 auto;
  height: var(--ink-corner-height);
}
.work[data-ink-bloom] .ink-corners,
.work[data-effect="ink"] .ink-corners { display: block; }
.ink-corners::before, .ink-corners::after {
  position: absolute;
  top: 0;
  width: min(23%, 290px);
  height: 100%;
  background: radial-gradient(ellipse 100% 100% at var(--ink-corner-center) 100%, transparent 98%, var(--cream) 100%);
  content: "";
}
.ink-corners::before {
  --ink-corner-center: 100%;
  left: 0;
  transform-origin: top left;
}
.ink-corners::after {
  --ink-corner-center: 0%;
  right: 0;
  transform-origin: top right;
}
.work[data-ink-bloom="playing"] .ink-corners::before,
.work[data-ink-bloom="playing"] .ink-corners::after,
.work[data-effect="ink"][data-phase="playing"] .ink-corners::before,
.work[data-effect="ink"][data-phase="playing"] .ink-corners::after {
  animation: fill-ink-corner 420ms ease-out both;
}
@keyframes fill-ink-corner {
  from { transform: scale(1); }
  to { transform: scale(0); }
}
@keyframes spread-ink {
  30% {
    clip-path: ellipse(65% max(220px, 42svh) at 50% var(--ink-origin));
    animation-timing-function: linear;
  }
  63% { clip-path: ellipse(72% 80% at 50% var(--ink-origin)); }
  80% { clip-path: ellipse(76% 102% at 50% var(--ink-origin)); }
  90% { clip-path: ellipse(79% 113% at 50% var(--ink-origin)); }
  96% { clip-path: ellipse(83% 121% at 50% var(--ink-origin)); }
  to { clip-path: ellipse(88% 130% at 50% var(--ink-origin)); }
}
.work-content {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}
.work h2 {
  margin: 0;
  color: var(--cream);
  font: 400 min(148px, 14.5cqi)/1.162 "LCT Mogi", sans-serif;
  font-variation-settings: "wdth" 700;
  letter-spacing: 0;
}
.work h2 span { display: block; }
.work[data-ink-bloom="ready"] h2 { color: var(--wine); }
.work[data-ink-bloom="playing"] h2 { transition: color 140ms ease-out 350ms; }
.work[data-title-bloom="ready"] h2 span { clip-path: inset(0 0 100%); }
.work[data-title-bloom="playing"] h2 span {
  animation: title-bloom 480ms cubic-bezier(.21, .72, .31, 1) both;
}
.work[data-title-bloom="playing"] h2 span + span { animation-delay: 75ms; }
@keyframes title-bloom {
  from { clip-path: ellipse(0% 0% at 50% 57%); transform: scale(.91); }
  to { clip-path: ellipse(72% 100% at 50% 57%); transform: scale(1); }
}
.work-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gallery-gap);
  margin-top: clamp(50px, 5.05vw, 97px);
  /* The heading sets the shared width, regardless of the images' native sizes. */
  contain: inline-size;
}
.gallery-stack {
  display: grid;
  align-content: start;
  gap: var(--gallery-gap);
}
.slot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 426 / 594;
  object-fit: cover;
}
.slot-wide { aspect-ratio: 426 / 276; }
.slot-calendar { object-position: 21% center; }

.gallery-frame {
  --frame-radius: min(var(--corner-radius), 5cqi);
  --frame-side: -1;
  --frame-delay: 0ms;
  --frame-curve: cubic-bezier(.2, .7, .23, 1);
  position: relative;
  aspect-ratio: 426 / 594;
}
.work-gallery > .gallery-frame:nth-child(even) {
  --frame-side: 1;
  --frame-delay: 95ms;
}
.gallery-frame-wide { aspect-ratio: 426 / 276; }
.gallery-frame-fill { align-self: stretch; aspect-ratio: auto; }
.gallery-motion {
  position: absolute;
  inset: 0;
  border-radius: var(--frame-radius);
  overflow: hidden;
  transition: box-shadow 180ms ease-out, scale 180ms ease-out;
}
.gallery-motion .slot { height: 100%; }
.gallery-frame:focus-within > .gallery-motion { box-shadow: 0 12px 28px rgb(63 11 11 / 28%); }
@media (hover: hover) {
  .gallery-frame:hover { z-index: 1; }
  .gallery-frame:hover > .gallery-motion {
    box-shadow: 0 12px 28px rgb(63 11 11 / 28%);
    scale: 1.05;
  }
}
.gallery-photo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.gallery-photo:focus-visible { outline: 3px solid var(--cream); outline-offset: -5px; }

@media (max-width: 700px) {
  .work {
    --work-top: clamp(56px, 14vw, 88px);
    --ink-corner-height: clamp(20px, 5vw, 30px);
    --gallery-gap: clamp(14px, 4.6vw, 24px);
    padding-inline: 16px;
    padding-bottom: clamp(48px, 12vw, 72px);
  }
  .work h2 { font-size: 15cqi; }
  .work-gallery { margin-top: clamp(28px, 8vw, 44px); }
}

@media (max-width: 600px) {
  .work-gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery-frame { --frame-radius: min(var(--corner-radius), 9cqi); }
  .gallery-frame-fill { aspect-ratio: 426 / 594; }
}

html:has(.gallery-viewer[open]) { overflow: hidden; scrollbar-gutter: stable; }
.gallery-viewer {
  --viewer-padding: clamp(8px, 1.5vw, 18px);
  position: fixed;
  inset: 0;
  width: fit-content;
  max-width: min(92vw, 1150px);
  max-height: 90dvh;
  margin: auto;
  padding: var(--viewer-padding);
  border: 0;
  border-radius: 24px;
  background: var(--wine);
  box-shadow: 0 20px 70px rgb(0 0 0 / 36%);
  overflow: visible;
}
.gallery-viewer::backdrop { background: rgb(32 7 8 / 86%); }
.gallery-viewer img {
  display: block;
  max-width: calc(min(92vw, 1150px) - 2 * var(--viewer-padding));
  max-height: calc(90dvh - 2 * var(--viewer-padding));
  border-radius: 15px;
  object-fit: contain;
}
.gallery-viewer-close {
  position: absolute;
  z-index: 1;
  top: calc(var(--viewer-padding) + 8px);
  right: calc(var(--viewer-padding) + 8px);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wine);
  color: var(--cream);
  font: 30px/1 system-ui, sans-serif;
  cursor: pointer;
}
.gallery-viewer-close:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }

[data-frame-effect] .gallery-frame:not(.is-revealed) > .gallery-motion {
  visibility: hidden;
}
[data-frame-effect="flip"] .is-revealed > .gallery-motion {
  animation: card-turn 740ms var(--frame-curve) var(--frame-delay) both;
}
@keyframes card-turn {
  from {
    opacity: 0;
    transform: perspective(760px) rotateY(calc(var(--frame-side) * 32deg)) rotateX(12deg) translateY(18px) scale(.88);
  }
  34% { opacity: 1; }
  to {
    opacity: 1;
    transform: perspective(760px) rotateY(0deg) rotateX(0deg) translateY(0) scale(1);
  }
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 20vh;
  min-height: 20dvh;
  padding: 16px 24px;
  border-radius: var(--corner-radius) var(--corner-radius) 0 0;
  background: var(--wine);
  color: var(--cream);
  text-align: center;
}
.contact h2 {
  margin: 0;
  white-space: pre-wrap;
  font: 400 clamp(24px, 4vw, 42px)/1.12 "LCT Mogi", sans-serif;
  font-variation-settings: "wdth" 700;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.contact-links a {
  display: inline-grid;
  place-items: center;
  min-width: 104px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 35px;
  background: var(--cream);
  color: var(--wine);
  font: 400 20px/1 "Bebas Neue", sans-serif;
  text-decoration: none;
}
@media (hover: hover) {
  .contact-links a:hover { background: var(--blue); }
}
.contact-links a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .gallery-motion { transition: none; }
  [data-frame-effect] .gallery-frame:not(.is-revealed) > .gallery-motion { visibility: visible; }
  [data-frame-effect="flip"] .is-revealed > .gallery-motion { animation: none; }
  .work[data-ink-bloom] .work-transition { display: none; }
  .work[data-ink-bloom] h2 { color: var(--cream); transition: none; }
  .work[data-title-bloom] h2 span { animation: none; clip-path: none; }
  .hero.is-animating .hero-letter {
    animation: none;
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}

