:root {
  --blue-900: #304d78;
  --blue-700: #4e70a4;
  --blue-500: #7090bd;
  --white: #fff;
  --text: rgba(255, 255, 255, 0.98);
  --muted: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.48);
  --glass-top: rgba(255, 255, 255, 0.15);
  --glass-bottom: rgba(184, 210, 244, 0.07);
  --glass-stroke: rgba(255, 255, 255, 0.46);
  --glass-stroke-soft: rgba(255, 255, 255, 0.19);
  --shadow: 0 24px 70px rgba(24, 45, 76, 0.18);
  --radius: 22px;
  --radius-small: 999px;
  --shell: 1320px;
  --parallax-x: 0px;
  --parallax-y: 0px;
  --pointer-px: 50vw;
  --pointer-py: 20vh;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--blue-700);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  background: rgba(255, 197, 193, 0.7);
  color: var(--blue-900);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  translate: 0 -160%;
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--blue-900);
  font-weight: 650;
  transition: translate 180ms ease;
}

.skip-link:focus {
  translate: 0;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background: var(--blue-700);
}

.scene__image {
  position: absolute;
  inset: -20px;
  background-image: url("./assets/sakura-frame.png");
  background-position: 50% 0%;
  background-repeat: no-repeat;
  background-size: max(100vw, 1160px) auto;
  filter: saturate(0.97) contrast(0.98);
  backface-visibility: hidden;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.03);
  will-change: transform;
}

.scene__wash {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    rgba(55, 82, 121, 0.04) 0%,
    rgba(62, 91, 134, 0.07) 42%,
    rgba(52, 78, 116, 0.42) 100%
  );
}

.scene__wash::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 60rem;
  height: 60rem;
  content: "";
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.08),
    transparent 30rem
  );
  pointer-events: none;
  transform: translate3d(
    calc(var(--pointer-px) - 50%),
    calc(var(--pointer-py) - 50%),
    0
  );
  will-change: transform;
}

.scene__grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.shell {
  width: min(calc(100% - 64px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 118px;
}

.wordmark {
  justify-self: start;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.glass {
  position: relative;
  overflow: hidden;
  contain: paint;
  border: 1px solid var(--glass-stroke);
  background:
    linear-gradient(135deg, var(--glass-top), var(--glass-bottom)),
    rgba(79, 111, 159, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(124, 158, 205, 0.12),
    var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  backdrop-filter: blur(18px) saturate(1.24);
}

.glass::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: radial-gradient(
    480px circle at var(--card-x, 20%) var(--card-y, 0%),
    rgba(255, 255, 255, 0.18),
    transparent 45%
  );
  opacity: var(--shine, 0.72);
  pointer-events: none;
  transition: opacity 240ms ease;
}

.glass > * {
  position: relative;
  z-index: 1;
}

.nav-pill {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-color: rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-small);
  background: rgba(58, 85, 129, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.19),
    0 18px 42px rgba(29, 50, 84, 0.16);
}

.nav-pill a {
  padding: 11px 17px;
  border-radius: var(--radius-small);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.94rem;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-pill a:not(.nav-pill__cta):hover,
.nav-pill a:not(.nav-pill__cta):focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-pill .nav-pill__cta {
  padding-inline: 22px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(37, 58, 92, 0.14);
  color: #1c2b40;
}

.nav-pill .nav-pill__cta:hover,
.nav-pill .nav-pill__cta:focus-visible {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  display: flex;
  min-height: 440px;
  align-items: flex-end;
  padding: 100px 24px 24px;
}

.hero__copy {
  max-width: 780px;
}

.hero h1 {
  max-width: 640px;
  margin: 0 0 22px;
  font-size: clamp(4rem, 4.8vw, 4.85rem);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 0.93;
  text-wrap: balance;
}

.hero h1 span {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 300;
}

.hero__intro {
  margin: 0;
  color: rgba(255, 255, 255, 0.77);
  font-size: 1rem;
  line-height: 1.5;
}

.contact-card path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 142px 132px 80px;
  gap: 10px;
  padding: 10px 0 40px;
  scroll-margin-top: 24px;
}

.bento-card {
  border-radius: var(--radius);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transform-style: preserve-3d;
  transition:
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease,
    background-color 220ms ease;
  will-change: transform;
  backface-visibility: hidden;
}

.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.65);
  --shine: 1;
}

.work-card {
  grid-column: 1 / span 5;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
}

.bento-card h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.2vw, 2.1rem);
  font-weight: 420;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.ghost-button {
  width: fit-content;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius-small);
  font-size: 0.88rem;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: #fff;
  color: var(--blue-900);
}

.identity-card {
  grid-column: 6 / span 3;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(148, 181, 224, 0.06)),
    rgba(70, 100, 146, 0.13);
}

.monogram {
  display: block;
  width: 179px;
  height: 146px;
  place-self: center;
  overflow: visible;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.18))
    drop-shadow(0 10px 20px rgba(30, 52, 86, 0.1));
  pointer-events: none;
  shape-rendering: geometricPrecision;
}

.monogram__stroke {
  vector-effect: non-scaling-stroke;
}

.now-card,
.about-card {
  grid-column: 9 / span 4;
  padding: 25px 28px;
}

.now-card {
  grid-row: 1;
}

.now-card p,
.about-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.about-card {
  grid-row: 2;
}

.contact-card {
  grid-column: 6 / span 7;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 34px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

.contact-trigger,
.contact-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: inherit;
  width: 100%;
  padding: inherit;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.contact-trigger {
  cursor: pointer;
  transition:
    opacity 260ms ease,
    filter 420ms ease,
    transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact-trigger[hidden] {
  display: none;
}

.contact-mask {
  display: inline-block;
  color: rgba(255, 255, 255, 0.7);
  filter: blur(4.8px);
  letter-spacing: 0.015em;
  opacity: 0.82;
  user-select: none;
  transition:
    filter 300ms ease,
    opacity 300ms ease;
}

.contact-trigger:hover .contact-mask,
.contact-trigger:focus-visible .contact-mask {
  filter: blur(4px);
  opacity: 0.96;
}

.contact-card.is-challenging .contact-trigger {
  pointer-events: none;
  opacity: 0.12;
  filter: blur(5px);
  transform: scale(0.985);
}

.contact-turnstile {
  position: absolute;
  inset: 5px 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  transition:
    opacity 260ms ease,
    transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact-turnstile[hidden] {
  display: none;
}

.contact-card.is-challenging .contact-turnstile {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contact-turnstile > * {
  max-width: 100%;
}

.contact-result {
  pointer-events: none;
  opacity: 0;
  filter: blur(8px);
  clip-path: inset(0 100% 0 0 round var(--radius));
  transform: translateY(8px);
  transition:
    opacity 360ms ease,
    filter 560ms ease,
    clip-path 680ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact-result.is-visible {
  pointer-events: auto;
  opacity: 1;
  filter: blur(0);
  clip-path: inset(0 0 0 0 round var(--radius));
  transform: translateY(0);
}

.contact-card.is-revealed::after {
  position: absolute;
  inset: -80% auto -80% -26%;
  z-index: 2;
  width: 22%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
  transform: rotate(14deg) translateX(-220%);
  animation: contact-sheen 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.contact-result .mail-icon path {
  stroke-dasharray: 54;
  stroke-dashoffset: 54;
  animation: draw-envelope 620ms 120ms ease-out forwards;
}

.contact-noscript {
  color: var(--muted);
  font-size: 0.88rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes contact-sheen {
  to {
    transform: rotate(14deg) translateX(720%);
  }
}

@keyframes draw-envelope {
  to {
    stroke-dashoffset: 0;
  }
}

.mail-icon {
  width: 25px;
  flex: 0 0 auto;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 800ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bento-card[data-reveal] {
  transform: perspective(900px) translateY(24px) scale(0.985);
}

.bento-card[data-reveal].is-visible {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) translateY(0) scale(1);
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.96);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .shell {
    width: min(calc(100% - 40px), var(--shell));
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-pill {
    justify-self: end;
  }

  .nav-pill a:not(.nav-pill__cta) {
    display: none;
  }

  .hero {
    min-height: 500px;
    padding-inline: 8px;
  }

  .hero h1 {
    max-width: 700px;
  }

  .bento {
    grid-template-rows: 300px 180px 80px;
  }

  .work-card {
    grid-column: 1 / span 8;
    grid-row: 1;
  }

  .identity-card {
    grid-column: 9 / span 4;
    grid-row: 1;
  }

  .now-card {
    grid-column: 1 / span 6;
    grid-row: 2;
  }

  .about-card {
    grid-column: 7 / span 6;
    grid-row: 2;
  }

  .contact-card {
    grid-column: 1 / span 12;
    grid-row: 3;
  }
}

@media (max-width: 680px) {
  :root {
    --radius: 19px;
  }

  .scene__image {
    inset: -12px;
    background-position: 50% 0%;
    background-size: 1040px auto;
    transform: translate3d(var(--parallax-x), var(--parallax-y), 0);
  }

  .scene__wash {
    background: linear-gradient(
      to bottom,
      rgba(55, 82, 121, 0.02),
      rgba(56, 83, 125, 0.24) 48%,
      rgba(47, 72, 110, 0.6) 100%
    );
  }

  .shell {
    width: calc(100% - 28px);
  }

  .site-header {
    min-height: 92px;
  }

  .wordmark {
    font-size: 1.08rem;
  }

  .nav-pill {
    padding: 5px;
  }

  .nav-pill .nav-pill__cta {
    padding: 9px 15px;
    font-size: 0.82rem;
  }

  .hero {
    min-height: 610px;
    align-items: flex-end;
    padding: 180px 2px 46px;
  }

  .hero h1 {
    margin-block: 16px 19px;
    font-size: clamp(3.35rem, 16vw, 5.4rem);
    line-height: 0.93;
  }

  .hero__intro {
    max-width: 92%;
    font-size: 0.96rem;
  }

  .bento {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
  }

  .bento-card {
    min-height: 160px;
  }

  .work-card {
    min-height: 360px;
    padding: 26px 22px;
  }

  .identity-card {
    min-height: 260px;
  }

  .now-card,
  .about-card {
    padding: 26px 22px;
  }

  .contact-card {
    min-height: 100px;
    padding: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .scene__image,
  .bento-card {
    transform: none !important;
  }

  .contact-result,
  .contact-turnstile,
  .contact-trigger {
    transform: none !important;
  }

  .contact-card.is-revealed::after {
    display: none;
  }

  .contact-result .mail-icon path {
    stroke-dashoffset: 0;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .glass {
    background: rgba(79, 111, 159, 0.82);
  }
}
