/* Common website styles. Standalone app designs keep their own stylesheets.
   The site-page root class enables the shared website foundations. */

/* Shared page foundations and reusable components. */
:root:where(.site-page) {
  color-scheme: light;
  --ink: #172b3b;
  --muted: #5f7180;
  --blue: #1674ad;
  --blue-dark: #0e4f79;
  --paper: #f5f8fb;
  --line: #dce6ed;
  --white: #fff;
}

:where(.site-page) * {
  box-sizing: border-box;
}

html:where(.site-page) {
  scroll-behavior: smooth;
}

:where(.site-page) body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}


:where(.site-page) body > * {
  flex-shrink: 0;
}


:where(.site-page) body > footer {
  margin-top: auto;
}


:where(.site-page) img {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.site-page) a {
  color: inherit;
}

:where(.site-page) a:focus-visible {
  outline: 3px solid #f0a94b;
  outline-offset: 4px;
}

:where(.site-page) .section-wrap,
:where(.site-page) .site-header {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

:where(.site-page) .site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

:where(.site-page) .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

:where(.site-page) .brand strong {
  font-weight: 700;
}

:where(.site-page) .brand-mark {
  width: 38px;
  height: 38px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 12px;
}

:where(.site-page) nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 3vw, 2.5rem);
}

:where(.site-page) nav a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

:where(.site-page) nav a:hover {
  color: var(--blue-dark);
}

:where(.site-page) .eyebrow,
:where(.site-page) .card-label {
  margin: 0 0 0.7rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:where(.site-page) h1,
:where(.site-page) h2,
:where(.site-page) h3,
:where(.site-page) p {
  margin-top: 0;
}

:where(.site-page) h1 {
  max-width: 620px;
  margin-bottom: 1.1rem;
  font-size: clamp(2.8rem, 5.4vw, 4.7rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

:where(.site-page) .button {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem 1.15rem;
  border-radius: 6px;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

:where(.site-page) .button:hover {
  background: var(--blue);
}

:where(.site-page) .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

:where(.site-page) .section-heading h2,
:where(.site-page) .about h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

:where(.site-page) .section-heading > p {
  max-width: 310px;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

:where(.site-page) .card-label {
  margin-bottom: 0.35rem;
  font-size: 0.67rem;
}

:where(.site-page) .text-link {
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

:where(.site-page) .text-link:hover {
  color: var(--blue);
}

.site-page a.link-underline-sweep {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0 1px;
  transition: background-size 250ms ease;
}


.site-page a.link-underline-sweep:is(:hover, :focus-visible) {
  background-size: 100% 1px;
}


/* Direction markers for text links. */
a:is(.link-external, .link-internal)::after {
  display: inline-block;
  margin-inline-start: 0.3em;
  text-decoration: none;
}

a.link-external::after {
  content: "↗" / "";
}

a.link-internal::after {
  content: "→" / "";
}


@media (prefers-reduced-motion: no-preference) {
  a.link-external:is(:hover, :focus-visible)::after {
    animation: github-arrow-sway 2s ease-in-out infinite;
  }

  a.link-internal:is(:hover, :focus-visible)::after {
    animation: internal-arrow-nudge 500ms ease-in-out;
  }
}


@keyframes internal-arrow-nudge {
  50% {
    transform: translateX(0.25em);
  }
}


:where(.site-page) .about {
  padding-block: 4.5rem;
  background: var(--paper);
}

:where(.site-page) .about-inner {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  align-items: start;
  gap: 4rem;
}

:where(.site-page) .about h2 {
  max-width: 520px;
}

:where(.site-page) .about-copy {
  color: var(--muted);
}

:where(.site-page) .about-copy p {
  margin-bottom: 1rem;
}

:where(.site-page) .about-copy .text-link {
  color: var(--blue-dark);
}

:where(.site-page) footer {
  border-top: 1px solid var(--line);
}

:where(.site-page) .footer-inner {
  min-height: 88px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

:where(.site-page) .footer-inner > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

:where(.site-page) .footer-brand {
  font-size: 0.88rem;
}

:where(.site-page) .footer-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

:where(.site-page) .work {
  padding-bottom: 5.5rem;
}

:where(.site-page) .video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  background: #172b3b;
}

:where(.site-page) .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

:where(.site-page) .video-link {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--blue-dark);
  font-size: 0.86rem;
  font-weight: 650;
  text-underline-offset: 0.2em;
}

:where(.site-page) .video-link:hover {
  color: var(--blue);
}

@media (max-width: 760px) {
  :where(.site-page) .section-wrap,
:where(.site-page) .site-header {
    width: min(100% - 36px, 600px);
  }
  :where(.site-page) .card-label {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
  :where(.site-page) .about-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  :where(.site-page) .work {
    padding-bottom: 4rem;
  }
}

@media (max-width: 520px) {
  :where(.site-page) .section-wrap,
:where(.site-page) .site-header {
    width: calc(100% - 32px);
  }
  :where(.site-page) .site-header {
    min-height: 72px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    padding-block: 0.75rem;
  }
  :where(.site-page) nav {
    gap: 1.2rem;
  }
  :where(.site-page) nav a {
    font-size: 0.82rem;
  }
  :where(.site-page) h1 {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }
  :where(.site-page) .section-heading {
    display: block;
  }
  :where(.site-page) .section-heading > p {
    margin-top: 0.9rem;
  }
  :where(.site-page) .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding-block: 1.3rem;
  }
}

:where(.site-page) .social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

:where(.site-page) .social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
}

:where(.site-page) .social-links img {
  width: 24px;
  height: 24px;
  opacity: 0.7;
}

:where(.site-page) body:not(.site-effects) .social-links a:is(:hover, :focus-visible) img {
  transform: translateY(-3px);
  opacity: 1;
}

/* Reusable text documents and highlighted notices. */
:where(.site-page) .document-page .heading {
  min-height: 118px;
  display: flex;
  align-items: center;
}

:where(.site-page) .document-page h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 2.8rem);
}

:where(.site-page) .document-page h2 {
  margin-block: 1.6em 0.7em;
  color: var(--blue-dark);
  font-size: 1.6rem;
  line-height: 1.25;
}

:where(.site-page) .document-page main {
  padding-block: 2.5rem 5rem;
}

:where(.site-page) .document-page p:where(:not(.footer-inner > p)) {
  margin-bottom: 1.1em;
}

:where(.site-page) .ribbon {
  padding-block: 0.8rem;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 1.25rem;
}

:where(.site-page) .document-page .ribbon h1 {
  max-width: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: normal;
}

:where(.site-page) .document-intro {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
}

:where(.site-page) .document-intro img {
  flex: none;
  width: min(31%, 240px);
}

:where(.site-page) .document-intro > div {
  min-width: 0;
}

:where(.site-page) .notice {
  padding: 1.25em 1.5em;
  border-left: 4px solid var(--blue);
  background: var(--paper);
  color: var(--ink);
}

:where(.site-page) .document-page footer:not(.site-footer) {
  padding-block: 1rem;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}

:where(.site-page) .document-page footer:not(.site-footer) p {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  :where(.site-page) .document-page .heading {
    min-height: 90px;
  }
  :where(.site-page) .document-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  :where(.site-page) .document-intro img {
    align-self: center;
    width: min(48%, 190px);
  }
}

:where(.site-page) .contact-hero,
:where(.site-page) .about-hero {
  padding-block: clamp(4rem, 8vw, 7rem);
  background: linear-gradient(120deg, var(--paper), #e6f1f7);
}

:where(.site-page) .contact-hero h1 {
  max-width: 820px;
}

:where(.site-page) .contact-lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.12rem;
}

:where(.site-page) .contact-hero .button {
  margin-top: 0.5rem;
}

:where(.site-page) .contact-social {
  padding-block: 4.5rem 5.5rem;
}

:where(.site-page) .contact-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
}

:where(.site-page) .contact-links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

:where(.site-page) body:not(.site-effects) .contact-links a:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: var(--paper);
}

:where(.site-page) .contact-links img {
  width: 32px;
  height: 32px;
  opacity: 0.75;
}

:where(.site-page) .contact-links a::after {
  margin-inline-start: auto;
  color: var(--muted);
}

@media (max-width: 600px) {
  :where(.site-page) .contact-links {
    grid-template-columns: 1fr;
  }
  :where(.site-page) .contact-social {
    padding-block: 3rem 4rem;
  }
}

:where(.site-page) .document-heading {
  justify-content: space-between;
  gap: 1rem;
}

:where(.site-page) .document-heading h1 a {
  color: inherit;
  text-decoration: none;
}

:where(.site-page) .sitemap-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 4rem 5rem;
}

:where(.site-page) .sitemap-content h2 {
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

:where(.site-page) .sitemap-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.site-page) .sitemap-content li + li {
  margin-top: 0.6rem;
}

@media (max-width: 700px) {
  :where(.site-page) .sitemap-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 3rem;
  }
}

:where(.site-page) .project-section {
  padding-block: var(--project-section-padding, 3.5rem);
  border-top: 1px solid var(--line, #dce4e9);
  scroll-margin-top: 2rem;
}

:where(.site-page) .project-heading {
  max-width: 860px;
  margin-bottom: 2.5rem;
}

:where(.site-page) .project-heading h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

:where(.site-page) .project-heading p:not(.eyebrow),
:where(.site-page) .gallery-intro p:not(.eyebrow) {
  margin-top: 0.8rem;
  color: var(--muted);
}

/* Shared project content and gallery introductions. */
:where(.site-page) .project-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

:where(.site-page) .content-block {
  min-width: 0;
}

:where(.site-page) .content-block--text {
  max-width: 860px;
  color: var(--muted);
}

:where(.site-page) .content-block--text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  :where(.site-page) .project-content {
    gap: 2rem;
  }
}

:where(.site-page) .gallery-intro {
  max-width: 800px;
}

:where(.site-page) .gallery-intro h3 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

:where(.site-page) .hero-background-art {
  position: absolute;
  left: var(--hero-art-left, 70%);
  top: var(--hero-art-top, 0);
  transform: translateX(-50%);
  width: var(--hero-art-width, auto);
  max-width: none;
  height: var(--hero-art-height, 100%);
  object-fit: contain;
  opacity: 0.1;
  pointer-events: none;
}

:where(.site-page) .hero-with-art {
  position: relative;
  overflow: hidden;
}

:where(.site-page) .hero-with-art > .section-wrap {
  position: relative;
}

:where(.site-page) .hero-with-art > .section-wrap > :not(.hero-background-art) {
  position: relative;
}


:where(.site-page) .hero.hero-with-art > :not(.hero-background-art) {
  position: relative;
}


/* Shared scroll-driven movement for selected hero backgrounds. */
@keyframes hero-parallax {
  from {
    translate: 0 0;
  }

  to {
    translate: 0 40vh;
  }
}


@supports (animation-timeline: scroll(root block)) and (animation-range: 0px 100vh) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-with-art .hero-parallax {
      animation: hero-parallax 1s linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 100vh;
    }
  }
}


/* One shadow preset for transparent images and rounded card frames. */
:root {
  --shadow: 0 8px 10px rgb(13 45 67 / 20%);
  --image-shadow: drop-shadow(var(--shadow));
}

.app-artwork,
.image-shadow {
  filter: var(--image-shadow);
}

/* Shared footer for the main website pages. */
footer.site-footer {
  padding: 0;
  color: var(--ink);
  background: var(--white);
  text-align: start;
}


.site-footer .footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}


.site-footer .footer-brand {
  justify-self: start;
}


.site-footer .sitemap-menu {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}


.site-footer .sitemap-menu:hover {
  background: var(--paper);
}


@media (max-width: 760px) {
  .site-footer .footer-inner {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 0;
  }


  .site-footer .footer-brand {
    flex-shrink: 0;
    margin-right: 0.5rem;
    white-space: nowrap;
  }


  .site-footer .social-links {
    flex: 0 1 220px;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
    gap: 0;
  }


  .site-footer .social-links a {
    flex: 1 1 44px;
    min-width: 0;
  }
}


@media (max-width: 400px) {
  .site-footer .footer-brand strong {
    display: none;
  }


  .site-footer .sitemap-menu {
    flex-basis: 32px;
    width: 32px;
  }
}


/* Shared hover interactions. App pages retain their own movement styles. */
.site-effects :is(.virtual-preview a, .work-card:not(:has(.virtual-preview)), .contact-links a, .social-links a, .hero-icon img) {
  position: relative;
  transition: transform 0.2s ease-out;
}

.site-effects .virtual-preview a {
  display: block;
  border-radius: 7px;
}

.site-effects .social-links a {
  border-radius: 6px;
}

/* SVG assets contain their own colours; hover reveals them. */
.social-links img {
  filter: grayscale(1);
  transition: transform 200ms ease, opacity 200ms ease, filter 200ms ease;
}

.social-links a:is(:hover, :focus-visible) img {
  filter: grayscale(0);
  opacity: 1;
}


.site-effects .virtual-preview a img {
  border-radius: inherit;
}

.site-effects:not(.app-grid-effects-only) :is(.virtual-preview a, .work-card:not(:has(.virtual-preview)), .contact-links a, .social-links a):is(:hover, :focus-visible),
.site-effects:not(.app-grid-effects-only) .hero-icon:is(:hover, :focus-visible) img {
  transform: scale(1.045);
  z-index: 1;
}

.site-effects:not(.app-grid-effects-only) :is(.virtual-preview a, .work-card:not(:has(.virtual-preview)), .contact-links a, .social-links a):is(:hover, :focus-visible) {
  filter: var(--image-shadow);
}


.section-nav {
  padding-block: 1.5rem;
}


.section-nav + .intro-grid {
  border-top: 1px solid var(--line);
}


/* Keep the shared navigation readable when all menu items wrap. */
@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    padding-block: 1rem;
    gap: 1rem;
  }
}


/* Shared menu link stays beside the brand on mobile. */
.menu-header nav {
  margin-left: auto;
  align-items: center;
}


.menu-header nav a {
  position: relative;
  text-align: center;
  transition: color 250ms ease, font-weight 250ms ease;
}


/* Reserve the width of the bold label without adding a visible line. */
.menu-header nav a [data-label]::after {
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  white-space: nowrap;
  font-weight: 700;
  content: attr(data-label) / "";
}


.menu-header nav a::after {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 250ms ease;
}


.menu-header nav a:is(:hover, :focus-visible) {
  font-weight: 700;
}


.menu-header nav a:is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}


.menu-header .sitemap-menu {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}


.menu-header .sitemap-menu:hover {
  background: var(--paper);
}


@media (max-width: 760px) {
  .site-header.menu-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 0.55rem 1rem;
  }

  .menu-header .brand {
    white-space: nowrap;
  }

  .menu-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
  }

  .menu-header .sitemap-menu {
    grid-column: 2;
    grid-row: 1;
  }
}


/* Realtime gallery previews use one rounded frame and one hover shadow. */
.studio-grid figure > :is(a, button) {
  position: relative;
  display: block;
  border-radius: 6px;
  line-height: 0;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.studio-grid figure > :is(a, button):is(:hover, :focus-visible) {
  transform: scale(1.045);
  box-shadow: var(--shadow);
  z-index: 1;
}

.studio-grid figure > :is(a, button) > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}


/* Native gallery controls preserve the page position when images close. */
.studio-grid figure > button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.studio-grid button:focus-visible,
.lightbox button:focus-visible {
  outline: 3px solid #f0a94b;
  outline-offset: 4px;
}


.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 3rem 4vw;
  background: rgb(9 19 28 / 94%);
}

.lightbox:popover-open {
  display: grid;
  place-items: center;
}

.lightbox button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}


.lightbox button:not(.lightbox-image) {
  cursor: pointer;
}


.lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.lightbox-content {
  position: relative;
  max-width: 100%;
  color: white;
  text-align: center;
}

.lightbox-content img {
  border-radius: 6px;
  max-width: 92vw;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-content a {
  color: white;
}

.lightbox-image {
  display: block;
  cursor: zoom-out;
}


.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  font-size: clamp(0.65rem, 2vw, 0.9rem);
  flex-wrap: wrap;
}

.lightbox-caption > * {
  opacity: 0.5;
}

.lightbox-caption button {
  text-decoration: underline;
}


.lightbox-caption :is(a, button) {
  transition: opacity 0.2s ease;
}

.lightbox-caption :is(a, button):is(:hover, :focus-visible) {
  opacity: 1;
}


/* Homepage layout and animations. */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: 3rem;
  padding: clamp(3.5rem, 8vw, 7rem) max(24px, calc((100vw - 1120px) / 2));
  background: linear-gradient(120deg, #f5f8fb 0%, #edf5fa 65%, #e6f1f7 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 590px;
}

.hero-text {
  max-width: 550px;
  margin-bottom: 1.8rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 340px;
}

.hero-icon {
  position: absolute;
  display: block;
  width: 34%;
  line-height: 0;
  overflow: visible;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
}

.hero-icon img {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transition: transform 400ms ease;
}

body:not(.site-effects) .hero-icon:is(:hover, :focus-visible) img {
  transform: scale(1.07);
}

.hero-icon-signee {
  top: 15%;
  left: 16%;
  animation-name: float-signee;
  animation-duration: 36s;
  animation-delay: -8s;
}

.hero-icon-split {
  top: 8%;
  right: 16%;
  animation-name: float-split;
  animation-duration: 42s;
  animation-delay: -22s;
}

.hero-icon-convert {
  right: 30%;
  bottom: 5%;
  animation-name: float-convert;
  animation-duration: 48s;
  animation-delay: -34s;
}

@keyframes float-signee {
  0%, 100% {
    transform: translate(0, 0) rotate(-2deg);
  }
  33% {
    transform: translate(14px, -36px) rotate(1deg);
  }
  66% {
    transform: translate(-10px, -16px) rotate(-1deg);
  }
}

@keyframes float-split {
  0%, 100% {
    transform: translate(0, 0) rotate(2deg);
  }
  40% {
    transform: translate(-14px, 16px) rotate(-1deg);
  }
  75% {
    transform: translate(10px, -20px) rotate(1deg);
  }
}

@keyframes float-convert {
  0%, 100% {
    transform: translate(0, 0) rotate(-1deg);
  }
  35% {
    transform: translate(-10px, -36px) rotate(2deg);
  }
  70% {
    transform: translate(14px, -16px) rotate(-2deg);
  }
}

.apps {
  padding-block: 5.5rem 2rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

/* App presentation cards: shared by the homepage and the app catalogue. */
.app-card {
  min-width: 0;
  border-radius: 10px;
}

.app-card > .card-image {
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 200ms ease-out;
}

.app-card > .card-image:is(:hover, :focus-visible) {
  transform: scale(1.045);
  z-index: 1;
}

.app-card > .card-image :is(.app-artwork, .image-shadow) {
  filter: none;
}

.card-image {
  border-radius: 10px;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  text-decoration: none;
}

.card-image img {
  border-radius: 10px;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-copy {
  padding: 1.4rem 1.5rem 1.6rem;
}

.card-copy h3 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

.card-copy h3 a, .github-box h3 a {
  text-decoration: none;
}

.card-copy h3 a:hover, .github-box h3 a:hover {
  color: var(--blue);
}

.card-copy > p:not(.card-label) {
  min-height: 5.2em;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.work-card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.work-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.work-card > p:not(.card-label) {
  min-height: 3.2em;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.github {
  padding-block: 1.5rem 5rem;
}

.github .section-heading > .text-link {
  flex: none;
  margin-bottom: 0.35rem;
}

.github-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

/* GitHub project boxes: logo, project link and animated direction arrow. */
.github-box {
  min-width: 0;
  transition: background-color 100ms ease;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.github-box:is(:hover, :focus-within) {
  background-color: var(--white);
}

.github-box h3 a {
  overflow-wrap: anywhere;
  text-underline-offset: 0.18em;
}

.github-box h3 a:is(:hover, :focus-visible) {
  text-decoration: underline;
}

.github-arrow {
  display: inline-block;
  transform-origin: center;
}

.github-box:is(:hover, :focus-within) .github-arrow {
  animation: github-arrow-sway 2s ease-in-out infinite;
}

@keyframes github-arrow-sway {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}

@keyframes github-arrow-steps {
  0%, 100% { transform: rotate(-12deg); }
  33.333% { transform: rotate(0deg); }
  66.667% { transform: rotate(12deg); }
}

.github-box > img {
  width: 32px;
  height: 32px;
  margin-bottom: 1.15rem;
}

.github-box h3 {
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.github-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: 0;
    padding: 4rem 18px 3rem;
  }
  .hero-copy {
    width: min(100% - 18px, 600px);
    margin-inline: auto;
  }
  .hero-art {
    width: min(100% - 36px, 480px);
    min-height: 280px;
    margin-inline: auto;
  }
  .apps {
    padding-block: 4rem 2rem;
  }
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }
  .card-copy {
    padding: 0.9rem 0.4rem 1rem;
    overflow-wrap: anywhere;
  }
  .card-copy h3 {
    font-size: clamp(1rem, 3vw, 1.25rem);
  }
  .card-copy > p:not(.card-label) {
    min-height: 0;
    font-size: 0.82rem;
  }
  .github-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-top: 3rem;
  }
  .hero-art {
    min-height: 235px;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
}

.virtual-preview {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1rem;
  margin-block: 1.2rem;
}

.virtual-preview img {
  width: 100%;
  height: auto;
  border-radius: 7px;
}


@media (prefers-reduced-motion: reduce) {
  .github-box:is(:hover, :focus-within) .github-arrow {
    animation: github-arrow-steps 2s steps(1, end) infinite;
  }

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


/* Shared portfolio layouts, galleries and image previews. */
.virtual-hero {
  padding-block: 4.5rem;
  background: var(--hero-background, linear-gradient(120deg, #f5f8fb, #e6f1f7));
}

.virtual-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.2rem;
}

.virtual-hero p:last-child {
  max-width: 900px;
  margin-bottom: 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1rem;
  padding-block: 2rem 3.5rem;
}

.intro-card {
  padding: 1.5rem;
  border: 1px solid var(--line, #dce4e9);
  border-radius: 8px;
  background: #fff;
}

.intro-card h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  letter-spacing: -0.035em;
}

.intro-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.intro-card-wide {
  grid-column: 1 / -1;
}

.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.showcase .section-heading {
  margin-bottom: 0;
}

.showcase .section-heading p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns, 3), minmax(0, 1fr));
  gap: var(--gallery-gap, 1.5rem);
  scroll-margin-top: 2rem;
}

.studio-grid figure {
  margin: 0;
  min-width: 0;
}

.studio-grid figcaption {
  margin-top: 0.6rem;
  font-size: var(--gallery-caption-size, 0.85rem);
  color: var(--muted);
  overflow-wrap: var(--gallery-caption-wrap, normal);
}

@media (max-width: 760px) {
  .showcase {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .studio-grid {
    grid-template-columns: repeat(var(--gallery-mobile-columns, 3), minmax(0, 1fr));
    gap: var(--gallery-mobile-gap, 0.65rem);
  }
  .studio-grid figcaption {
    font-size: var(--gallery-mobile-caption-size, 0.7rem);
  }
  .virtual-hero {
    padding-block: 3rem;
  }
  .intro-grid {
    grid-template-columns: 1fr;
    padding-block: 1.5rem 2.5rem;
  }
  .intro-card-wide {
    grid-column: auto;
  }
  .project-section--compact-mobile {
    --project-section-padding: 2.5rem;
  }
}


.image-preview {
  display: block;
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

.image-preview:focus-visible {
  outline: 3px solid #f0a94b;
  outline-offset: 4px;
}


/* Archive galleries use four columns on desktop and two on mobile. */
.studio-grid--archive {
  --gallery-columns: 4;
  --gallery-caption-wrap: anywhere;
  --gallery-mobile-columns: 2;
  --gallery-mobile-gap: 1.25rem 0.8rem;
  --gallery-mobile-caption-size: 0.75rem;
}


/* Application catalogue. */
.apps-hero {
  position: relative;
  overflow: hidden;
  padding-block: 4.5rem;
  background: linear-gradient(120deg, #f5f8fb, #e6f1f7);
}

.apps-hero p:not(.eyebrow) {
  max-width: 900px;
  color: var(--muted);
  font-size: 1.2rem;
}

.apps-hero p:last-child {
  margin-bottom: 0;
}

.app-subsection {
  margin-top: 3.5rem;
}

.app-subsection > .gallery-intro {
  margin-bottom: 2rem;
}


/* Automatic theme is opt-in: standalone application pages retain their palettes. */
@media (prefers-color-scheme: dark) {
  :root.auto-theme {
    color-scheme: dark;
    --ink: #edf3f8;
    --muted: #acbdcb;
    --blue: #80c8f2;
    --blue-dark: #a4d9f7;
    --paper: #192735;
    --line: #3c5061;
    --white: #101923;
    --button-text: #101923;
    --shadow: 0 8px 18px rgb(0 0 0 / 40%);
  }


  .auto-theme :is(.hero, .contact-hero, .about-hero, .apps-hero) {
    background: linear-gradient(120deg, #162330, #213748);
  }


  .auto-theme .virtual-hero {
    background: var(--hero-background, linear-gradient(120deg, #162330, #213748));
  }


  .auto-theme .intro-card {
    background: var(--paper);
  }


  .auto-theme :is(.button, .ribbon) {
    color: var(--button-text);
  }


  .auto-theme .sitemap-menu img {
    filter: brightness(0) invert(1);
  }


  .auto-theme :is(.social-links, .contact-links) img {
    filter: grayscale(1) brightness(0) invert(1);
    opacity: 0.85;
  }


  .auto-theme :is(.social-links, .contact-links) a:is(:hover, :focus-visible) img {
    filter: none;
    opacity: 1;
  }

}


/* Embedded artwork keeps its original light rendering context and transparency.
   The surrounding page still follows the system appearance. */
.auto-theme :is(img, object, svg) {
  color-scheme: only light;
}
