/*:root {
  --cream: #FFFDF7;
  --ink: #0D0D0D;
  --apricot: #FEE1C7;
  --muted: #4A463F;
  --hairline: #E4DDCE;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}*/

:root {

  color-scheme: light;

  --cream: #FFFDF7;
  --ink: #0D0D0D;

  --saffron: #D6A33A;
  --saffron-light: #F0D98D;

  --hairline: rgba(13, 13, 13, 0.14);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --grain-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 0 0 0 0 1 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");

  --cream-rgb: 255, 253, 247;
  --ink-rgb: 13, 13, 13;
  --muted: #4A463F;
  --secondary-text: #686158;
  --on-saffron: #0D0D0D;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --cream: #0D0D0D;
  --ink: #FFFDF7;
  --cream-rgb: 13, 13, 13;
  --ink-rgb: 255, 253, 247;

  --muted: rgba(255, 253, 247, 0.75);
  --secondary-text: rgba(255, 253, 247, 0.6);
  --hairline: rgba(255, 253, 247, 0.14);
}

/* Make the black logos visible in dark mode */
html[data-theme="dark"] .logo-black,
html[data-theme="dark"] .drawer-header .logo {
  filter: invert(1);
}

/* Keep the grain visible on dark backgrounds */
html[data-theme="dark"] body::after,
html[data-theme="dark"] .navbar::after {
  filter: invert(1);
}

.nav-links .H4[aria-current],
.drawer-links .H4[aria-current] {
  color: var(--saffron);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

/* Scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--saffron) var(--cream);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
    /* Create the vertical and horizontal intersecting grid lines */
  background-image:
    radial-gradient(
      circle,
      rgba(var(--ink-rgb), 0.09) 1px,
      transparent 1px
    );
  
  background-size: 40px 40px;
  color:var(--ink)
}

/* Subtle grain across the entire site */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;

  background-image: var(--grain-texture);
  background-repeat: repeat;
}

a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- CUSTOM CURSOR ---------- */
@media (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 1.5px;
  background-color: var(--cream);
  border: 1.5px solid var(--ink);
  opacity: 1;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.2s var(--ease),
    height 0.2s var(--ease),
    opacity 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

/* Smaller square over clickable elements */
#custom-cursor.cursor-hover {
  width: 13px;
  height: 13px;
  opacity: 1;
  background-color: rgba(var(--ink-rgb), 0.6);
  border-color: var(--cream);
}

/* Squeezed square over text */
#custom-cursor.cursor-text {
  width: 5px;
  height: 22px;
  opacity: 1;
  background-color: rgba(var(--ink-rgb), 0.6);
  border-color: var(--cream);
}

#custom-cursor.cursor-hidden {
  opacity: 0 !important;
}

/* ---------- COPY-EMAIL TOOLTIP & TOAST ---------- */
#copy-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  transform: none;
  background-color: var(--saffron);
  color: var(--on-saffron);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.2px;
  padding: 6px 14px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
  line-height: 1.4;
}

#copy-tooltip.visible {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  #copy-tooltip {
    display: none !important;
  }
}

#copy-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px) scale(0.92);
  background-color: var(--saffron);
  color: var(--on-saffron);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 550;
  padding: 8px 16px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
}

#copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- NAVBAR ---------- */
.navbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  background-color: var(--cream);
  color: var(--ink);
  height: 64px;
  padding-left: 40px;
  padding-right: 40px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--cream-rgb), 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  transition: box-shadow 0.4s var(--ease);
}

.navbar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--grain-texture);
  background-repeat: repeat;
  opacity: 0.04;
}

.nav-links {
  display: flex;
  align-items: center;
}

.navbar .H4 {
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.1px;
  text-decoration: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  cursor: pointer;
  padding: 22px 18px;
  position: relative;
}

.navbar .H4::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  height: 2px;

  background: var(--saffron);

  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.navbar .H4:hover {
  opacity: 0.65;
  text-decoration: none;
}

.navbar .H4:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: end;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover {
    color: var(--saffron);
  }

  .photo-item:hover img {
    transform: scale(1.035);
    filter: brightness(1.2);
  }
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

.theme-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--saffron);
  color: var(--on-saffron);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.2px;
  padding: 6px 14px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
  line-height: 1.4;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover::after {
    opacity: 1;
  }
}

.theme-toggle:focus-visible::after {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .theme-toggle::after {
    display: none;
  }
}

.theme-toggle.tooltip-dismissed::after {
  opacity: 0;
}

.theme-sun {
  display: none;
}

html[data-theme="dark"] .theme-moon {
  display: none;
}

html[data-theme="dark"] .theme-sun {
  display: inline;
}

.logo {
  height: 42px;
  width: auto;
  cursor: pointer;
}

.logo-hover {
  position: relative;
  display: inline-block;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-hover .logo {
  display: block;
  height: 32px;
  width: auto;
}

.logo-hover .logo-black {
  position: relative;
  opacity: 1;
  transition: opacity 2s var(--ease);
}

.logo-hover .logo-yellow {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 2s var(--ease);
}

.logo-hover:hover .logo-black {
  opacity: 0;
}

.logo-hover:hover .logo-yellow {
  opacity: 1;
}

.nav-cta {
  flex-shrink: 0;
}

/* ---------- HAMBURGER ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 210;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- MOBILE DRAWER ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  z-index: 190;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(320px, 82vw);
  background: rgba(var(--cream-rgb), 0.64);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 16px 24px 28px;
  border-left: 1px solid var(--hairline);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  z-index: 200;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.drawer-header .logo {
    height: 32px;
    filter: none;
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.drawer-links .H4 {
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  text-decoration: none;
}

.drawer-cta {
  margin-top: auto;
  width: 100%;
}

/* ---------- SECTION 1 / HERO ---------- */
.section1 {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 32px;
}

@property --hero-mx {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}

@property --hero-my {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 40%;
}

.hero-static {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: 0.3;
    mix-blend-mode: normal;

    pointer-events: none;
    z-index: 1;
}

@media (max-width: 768px) {
    .hero-static {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-static {
        display: none;
    }
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: calc(100dvh - 80px);

  text-align: center;
  color: #FFFDF7;

  position: relative;
  overflow: hidden;
  isolation: isolate;

  border-radius: 0;
  padding: 0;

  /*--hero-mx: 50%;
  --hero-my: 40%;*/

  background-color: #0D0D0D;

  background-image:
    linear-gradient(
      rgba(0, 0, 0, 0.85),
      rgba(0, 0, 0, 0.85)
    ),
    url("herobg6.webp");
  
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle 200px at var(--hero-mx) var(--hero-my),
      rgba(255, 253, 247, 0.08) 0%,
      rgba(255, 253, 247, 0.030) 35%,
      transparent 70%
    );

  opacity: var(--hero-glow-opacity);
  transition: opacity 0.35s ease;

  pointer-events: none;
  z-index: 2;
}


@media (hover: none), (pointer: coarse) {
  .hero::after {
    background:
      radial-gradient(
        circle 280px at 50% 40%,
        rgba(255, 253, 247, 0.10) 0%,
        rgba(254, 225, 199, 0.08) 22%,
        rgba(254, 225, 199, 0.03) 42%,
        transparent 68%
      );
  }
}

@media (max-width: 768px) {

    .hero::after {
        display: none;
    }

}

.herotext {
  width: 100%;
  max-width: 700px;

  margin: 0 auto;
  padding: 0 32px;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 24px;

  position: relative;
  z-index: 3;
}

.H1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  max-width: 650px;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.body-large {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 400;
  max-width: 650px;
  font-size: 19px;
  line-height: 1.55;
  color: rgba(255, 253, 247, 0.86);
  max-width: 560px;
}

.hero2 {
  container-type: inline-size;
  width: 100%;
  margin: 0;

  padding: 0 32px;

  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  box-sizing: border-box;
}

.big-title {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- SECTION 2 / WORK ---------- */
.section2 {
  display: flex;
  flex-direction: column;
  padding: 32px 32px 64px;
  gap: 32px;
}

.title-button {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  letter-spacing: -1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: var(--ink);
}

.H4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 21px;
  text-decoration: none;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* ---------- WORK CARDS ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;

  background: transparent;
  color: var(--ink);

  padding: 0;
  border: none;
  border-radius: 0;

  overflow: visible;

  cursor: pointer;
}

.card-image-wrap {
  position: relative;
  overflow: hidden;

  border-radius: 4px;
  aspect-ratio: 16 / 9;
}

.card-image-pan {
  width: 100%;
  height: 100%;
  transform: translate(
    calc(var(--px, 0) * 1px),
    calc(var(--py, 0) * 1px)
  );
  transition: transform 0.2s ease-out;
}

.card-image {
  width: 100%;
  height: 100%;

  object-fit: cover;
  border-radius: 0;
  display: block;

  transition:
    transform 0.7s var(--ease),
    filter 0.6s var(--ease);

  filter: saturate(0.94);
}

.card:hover .card-image {
  transform: scale(1.01);
  filter: saturate(1.05);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;

  padding: 0 2px;
}

.card .H4 {
  color: var(--ink);
  font-size: 18px;

  transition:
    color 0.3s var(--ease);
}

.card:hover .H4 {
  color: var(--saffron);
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 6px 10px;
}

.tag {
  display: inline-flex;
  align-items: center;

  padding: 0;

  border: none;
  border-radius: 0;
  background: transparent;

  color: rgba(var(--ink-rgb), 0.58);

  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;

  text-decoration: none;
}

.tag:not(:last-child)::after {
  content: '•';

  margin-left: 10px;

  color: var(--saffron);
}

/* ---------- EXPERIENCE ---------- */
/* ---------- EXPERIENCE ---------- */
.experience {
  padding: 24px 0 0px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
}

.experience .section-heading {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.experience-cv {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
  margin-left: auto;
}

.experience-cv:hover {
  color: var(--saffron);
}

.exp-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--saffron-light);
  transition: padding-left 0.35s var(--ease);
}

.exp-row:hover {
  padding-left: 8px;
}

.exp-row:last-child {
  border-bottom: none;
}

.exp-company {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink);
}

.exp-role {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
}

.exp-dates {
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
  white-space: nowrap;
  color: var(--secondary-text);
}

@media (max-width: 760px) {
  .experience {
    padding-top: 32px;
  }

  .experience .section-heading {
    font-size: 22px;
  }

  .exp-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .exp-row:hover {
  padding-left: 0;
}

  .exp-dates {
    margin-top: 3px;
    text-align: left;
    white-space: normal;
  }
}

/* ---------- FOOTER ---------- */
/* ---------- FOOTER ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 32px 32px 0;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
}

.footer-name {
  color: var(--secondary-text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--saffron);
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    margin: 16px 20px 0;
    padding: 36px 0;
    gap: 24px;
  }

  .footer-links {
    gap: 36px;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav-links,
  .nav-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    padding-left: 24px;
    padding-right: 20px;
  }
}


@media (max-width: 640px) {

  .section1 {
    padding: 0;
  }

  .section2 {
    padding: 20px 20px 40px;
  }

  .hero {
    width: 100%;
    height: calc(100dvh - 80px);
    min-height: 0;
    border-radius: 0;
    padding: 0;
  }

  .hero2 {
    padding: 0 20px;
  }
}

/* ---------- HERO FAIRY LIGHTS ---------- */

.hero-sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;

  z-index: 1;
}

.hero-sparkle {
  position: absolute;

  left: var(--x);
  bottom: -20px;

  width: var(--size);
  height: var(--size);

  border-radius: 50%;

  background: var(--saffron-light);

  box-shadow:
  0 0 5px rgba(214, 163, 58, 0.65),
  0 0 12px rgba(214, 163, 58, 0.22);

  opacity: 0;

  animation:
    sparkle-rise var(--duration) linear infinite;

  animation-delay: var(--delay);
}

@keyframes sparkle-rise {

  0% {
    transform:
      translate3d(0, 0, 0)
      scale(0.5);

    opacity: 0;
  }

  10% {
    opacity: var(--opacity);
  }

  35% {
    transform:
      translate3d(
        calc(var(--drift) * 0.35),
        -35vh,
        0
      )
      scale(1);

    opacity: var(--opacity);
  }

  75% {
    opacity: calc(var(--opacity) * 0.35);
  }

  100% {
    transform:
      translate3d(
        var(--drift),
        -95vh,
        0
      )
      scale(0.3);

    opacity: 0;
  }
}


/* Compact homepage introduction */
.homepage-intro {
  padding: 72px 32px 40px;
  color: var(--ink);
}

.homepage-intro .H1 {
  display: block;
  max-width: 850px;
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.8px;
  text-wrap: balance;
}

.homepage-intro .body-large {
  max-width: 850px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .homepage-intro {
    padding: 40px 20px 24px;
  }

  .homepage-intro .H1 {
    font-size: 28px;
    letter-spacing: -0.5px;
  }

  .homepage-intro .body-large {
    margin-top: 16px;
    font-size: 16px;
  }

  .homepage-intro .intro-break {
    display: none;
  }
}

/* Text selection */
::selection {
  color: var(--saffron);
  background-color: rgba(214, 163, 58, 0.25);
}

/*Nav and drawer email*/
.nav-email {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-email:hover {
  color: var(--saffron);
}

@media (max-width: 900px) {
  .nav-email {
    display: none;
  }
}

.drawer-email {
  display: block;
  margin-top: auto;
  padding-top: 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.drawer-email:hover {
  color: var(--saffron);
}


/* About page */
.about-page {
  box-sizing: border-box;
  width: 84%;
  max-width: 720px;
  margin: 0;
  margin-left: 8%;
  padding: 64px 24px;
}

.about-intro {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

.about-intro p {
  margin: 0 0 20px;
}

.about-intro p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .about-page {
    padding: 40px 20px;
    margin-left: 0;
    width: 100%;
  }
}

/* Snippets page */
.snippets-page {
  padding: 0 32px 64px;
}

.about-page.photo-intro {
  padding-bottom: 24px;
}

.photo-gallery {
  --columns: 8;
  --gap: 8px;
  position: relative;
}

.photo-item {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(var(--ink-rgb), 0.06);
  border: none;
  padding: 0;
}

.photo-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: transform 0.25s ease-in-out, filter 0.45s ease-in-out;
}

.photo-item.is-loaded img,
.photo-item.is-error img {
  opacity: 1;
}

.photo-item:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}

.photo-preview {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 48px 24px;
  border: none;
  background: transparent;
}

.photo-preview[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.photo-preview::backdrop {
  background: rgba(13, 13, 13, 0.88);
}

.photo-preview-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 52px);
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
  touch-action: pan-y pinch-zoom;
}

.photo-preview-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #FFFDF7;
  font-size: 30px;
  line-height: 1;
}

.photo-preview-close:focus-visible {
  outline: 2px solid var(--saffron);
}

.photo-preview-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
}

.photo-preview-controls .black-mid {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
}

@media (max-width: 1440px) {
  .photo-gallery {
    --columns: 6;
  }
}

@media (max-width: 1000px) {
  .photo-gallery {
    --columns: 4;
  }
}

@media (max-width: 640px) {
  .snippets-page {
    padding: 0 20px 40px;
  }

  .photo-gallery {
    --columns: 2;
    --gap: 8px;
  }

  .photo-item {
    border-radius: 2px;
  }

  .photo-preview .photo-preview-controls {
    display: none;
  }
}


/* Chess page */
.chess-puzzle {
  display: grid;
  --board-size: clamp(220px, calc(100dvh - 180px), 520px);
  grid-template-columns: minmax(0, var(--board-size)) minmax(240px, 1fr);
  align-items: stretch;
  gap: 32px;
  margin-top: 0;
}

#puzzle-status {
  margin-top: 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary-text);
}

#chess-board {
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
}

#chess-board cg-board {
  background-color: #FFFDF7;
  background-image: conic-gradient(
    #BDB7A5 25%,
    #FFFDF7 0 50%,
    #BDB7A5 0 75%,
    #FFFDF7 0
  );
  background-size: 25% 25%;
}

#chess-board square.last-move {
  background-color: rgba(214, 163, 58, 0.35);
}

.chess-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.chess-controls button {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.about-page.chess-page {
  max-width: 1040px;
  padding-top: 32px;
  padding-bottom: 24px;
}

.puzzle-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chess-board-column {
  min-width: 0;
  width: min(100%, var(--board-size));
}

#puzzle-result {
  margin-top: 24px;
}

@media (max-width: 800px) {
  .chess-puzzle {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .puzzle-navigation {
    margin-top: 24px;
    padding-top: 0;
  }
}

.puzzle-navigation {
  margin-top: auto;
  padding-top: 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  line-height: 1.6;
}

#puzzle-count {
  margin: 0 0 8px;
  color: var(--secondary-text);
}

#puzzle-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#puzzle-numbers button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

#puzzle-numbers button[aria-current="step"] {
  border-color: var(--saffron);
  color: var(--saffron);
}

#puzzle-numbers button:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

/* Legal moves: dots on empty squares */
#chess-board square.move-dest {
  background: radial-gradient(
    circle,
    rgba(13, 13, 13, 0.25) 19%,
    transparent 20%
  );
}

/* Legal captures: rings around occupied squares */
#chess-board square.move-dest.oc {
  background: radial-gradient(
    circle,
    transparent 60%,
    rgba(13, 13, 13, 0.25) 61%,
    rgba(13, 13, 13, 0.25) 70%,
    transparent 71%
  );
}