/* MOTION — one set of timings for the whole site.
   soft:   colour, fades, anything that just changes
   settle: things that move and come to rest (opening, lifting, hovering)
   enter:  walking through a doorway (speeds up as you go in) */
:root {
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --ease-settle: cubic-bezier(.2, .7, .1, 1);
  --ease-enter: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: 180ms;
  --dur-med: 420ms;
  --dur-slow: 760ms;
  --mint: rgb(152, 216, 188);
  --purple: rgb(167, 106, 169);
}

/* BASE */
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}
body {
  box-sizing: border-box;
}
ul, li, p, a, h1, h2, h3, h4, h5, h6 { color: inherit; }
h1, h2, h3, h4, h5, h6, p, li, b, .content {
  transition: color var(--theme-dur) var(--theme-ease);
}
a {
  transition: color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}

/* TYPOGRAPHY */
* { font-family: "IBM Plex Mono", monospace; }
h1 { font-size: 1.2rem; font-weight: 500; margin-block: 0; line-height: 30px; }
h2 { font-size: 1rem; font-weight: 500; margin-block: 0; }
h3 { font-size: 1rem; font-weight: 400; margin: 13px 0; }
h4 { font-size: 1rem; }
h5 { font-size: 1rem; }
h6 { font-weight: 400; }
p  { font-size: 0.9rem; font-weight: 200;}
b { font-weight: 500; }

/* IMAGES & MEDIA */
img { width: 100%; height: 100%; }
.flex-item img { object-fit: contain; aspect-ratio: 1 / 1; }
.project.flex-item img { object-fit: contain; aspect-ratio: 0 !important; }
.smallproject.flex-item img { object-fit: contain; aspect-ratio: 0 !important; }
.small.flex-item img { object-fit: contain; aspect-ratio: 1.5; }
.logo img, .brand img, img[src$="logo.png"], .flex-item img {
  transition: filter var(--theme-dur) var(--theme-ease),
              opacity .15s var(--theme-ease);
}
.logo svg, .brand svg {
  transition: fill var(--theme-dur) var(--theme-ease),
              stroke var(--theme-dur) var(--theme-ease);
}
.video-container {
  display: flex; justify-content: center; align-items: center;
  width: 100%; height: 100%; border: none; outline: none; box-shadow: none;
  object-fit: contain; aspect-ratio: 1 / 1;
}

/* GRID LAYOUTS */
.container-lg, .container-md, .container-ms {
  display: grid;
  padding: 40px;
  grid-template-columns: 50px 2.1fr 1fr;
  grid-template-rows: 1fr;
  grid-column-gap: 55px;
  grid-row-gap: 0;
  justify-items: stretch;
  align-items: start;
  height: auto;
  position: relative;
}
.container-sm {
  display: grid;
  padding: 20px;
  grid-template-rows: 44px 1fr;
  row-gap: 50px;
  justify-items: stretch;
  height: calc(100vh - 80px);
}

/* About page variants */
.container-lg.abt, .container-md.abt, .container-ms.abt { grid-template-columns: 50px 342px 1fr; }
.container-sm.abt { grid-template-rows: 44px 300px 1.5fr; }

/* STICKY ITEMS */
.item1, .item4, .item7 {
  position: sticky; top: 40px; height: fit-content; display: flex; flex-direction: column;
  min-height: calc(100vh - 80px);
}

.item8 {
    top: 40px;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.item1 { z-index: 10; }
.item4 { z-index: 90; }
.item7 { z-index: 100; }
.item2 { position: relative; z-index: 1; }

/* FLEX LAYOUT */
.flex-container, .flex-container-lg {
  display: flex; flex-wrap: wrap; width: 100%; margin: 5px auto 0; position: relative; z-index: 1;
}

.container-sm .flex-container { margin-top: 0; }

.flex-item {
  position: relative; width: 100%; height: 100%; padding: 25px; box-sizing: border-box;
  z-index: 2;
  --hover-pad: 30px;   /* the padding the picture shrinks to on hover */
}

.small.flex-item {
  position: relative; width: 100%; height: 100%; padding: 0; box-sizing: border-box;
  z-index: 2;
  --hover-pad: 20px;
}
.project.flex-item { --hover-pad: 25px; }

.flex-item a { position: relative; z-index: 3; display: block; }
.flex-item img { position: relative; z-index: 2; }
/* script.js turns --hover-pad into --hover-scale for each card's size */
.flex-item > span > a {
  transform-origin: center;
  transition: transform var(--dur-med) var(--ease-settle);
}
.flex-item:hover > span > a,
.flex-item:focus-within > span > a { transform: scale(var(--hover-scale, 1)); }

/* CORNER DOTS */
.flex-item::before, .flex-item::after, .flex-item > span::before, .flex-item > span::after {
  content: ''; position: absolute; width: 6px; height: 6px; border: 1px solid; border-radius: 50%;
  transition: background-color var(--dur-med) var(--ease-soft), border-color var(--dur-med) var(--ease-soft),
              border-width var(--dur-med) var(--ease-settle);
  pointer-events: none; z-index: 1;
}
@media (min-width: 768px) {
  .project.flex-item::before,
  .project.flex-item::after,
  .project.flex-item > span::before,
  .project.flex-item > span::after { background: #0f0e0e; border: 3px solid #0f0e0e; }

  .flex-item:not(.project):hover::before,
  .flex-item:not(.project):hover::after,
  .flex-item:not(.project):hover > span::before,
  .flex-item:not(.project):hover > span::after { background: #0f0e0e; border: 3px solid #0f0e0e; }

  .small.flex-item:hover::before,
  .small.flex-item:hover::after,
  .small.flex-item:hover > span::before,
  .small.flex-item:hover > span::after {
    width: 6px !important; height: 6px !important; border: 1px solid !important; background: white !important;
  }
}
.smalldot.small.flex-item::before,
.smalldot.small.flex-item::after,
.smalldot.small.flex-item > span::before,
.smalldot.small.flex-item > span::after { background: #0f0e0e; border: 1px solid #0f0e0e; }

.flex-item::before { top: 0; left: 0; transform: translate(-50%, -50%); }
.flex-item::after { top: 0; right: 0; transform: translate(50%, -50%); }
.flex-item > span::before { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.flex-item > span::after { bottom: 0; right: 0; transform: translate(50%, 50%); }

/* NAV */
nav ul { list-style: none; margin: 0; padding: 0; overflow: auto; }
nav ul li a {
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-soft),
              color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}
nav ul li a.active {
  text-decoration: underline; text-underline-offset: 3px; opacity: 1;
}
nav ul li a:not(.active):hover ~ li a.active { opacity: 0; }
nav ul li a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* MOBILE NAV WRAPPER + OVERLAY + BURGER */
.phone-nav { display: flex; justify-content: space-between; align-items: center; width: 100%; position: relative; }
.menu-overlay {
  position: fixed; inset: 0; background: white; z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease,
              background-color var(--theme-dur) var(--theme-ease);
  pointer-events: none;
}
.menu-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.menu-content { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.menu-content ul { list-style: none; padding: 0; margin: 0; text-align: center; }
.menu-content li { margin: 2rem 0; }
.menu-content a { text-decoration: none; color: #0f0e0e; font-size: 1.5rem; position: relative; cursor: pointer; }
.menu-content a:hover, .menu-content a.active { text-decoration: underline; text-underline-offset: 8px; }

.burger-menu {
  position: relative; z-index: 1002; color: #0f0e0e; background: none; border: 0;
  width: 35px; height: 35px; padding: 0; cursor: pointer;
}
.burger-menu:focus { outline: none; }
.burger-menu span {
  position: absolute; left: 0; width: 35px; height: 2px; background: currentColor;
  transition: transform .3s ease, top .3s ease; pointer-events: none;
}
.burger-menu span:nth-child(1){ top: 2px; }
.burger-menu span:nth-child(2){ top: 20px; }
.burger-menu.active span:nth-child(1){ transform: rotate(45deg); top: 11px; }
.burger-menu.active span:nth-child(2){ transform: rotate(-45deg); top: 11px; }

/* PROJECT DETAILS TOGGLE */
.project-details { margin-top: auto; position: relative; }
.toggle-button {
  background: none; border: none; padding: 0; font: inherit; font-size: .85rem; display: flex; align-items: center; color: #0f0e0e; gap: 4px; cursor: pointer;
  transition: color var(--theme-dur) var(--theme-ease);
}
.symbol { position: relative; width: 12px; height: 12px; margin-right: 2px; pointer-events: none; }
.symbol::before, .symbol::after {
  content: ''; position: absolute; background: #0f0e0e;
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              background-color var(--theme-dur) var(--theme-ease);
  transform-origin: center; pointer-events: none;
}
.symbol::before { width: 12px; height: 1.5px; top: 50%; left: 0; transform: translateY(-50%); }
.symbol::after  { width: 1.5px; height: 12px; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(0); }
.toggle-button.active .symbol::after { transform: translate(-50%,-50%) rotate(-90deg); }

/* Filter panel: no built-in height/opacity transitions (JS handles it) */
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;                 /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;   /* theme colors handled elsewhere */
  transition: background-color var(--theme-dur) var(--theme-ease);
}

/* open state (opacity only; height is driven by JS) */
.details-content.active{ opacity: 1; }


/* Theme animation should only tween colors, not opacity/height */
.theme-anim .details-content {
  transition: background-color 300ms cubic-bezier(.4,0,.2,1);
}

/* Make filter rows flex containers */
.details-content p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  transform: translateY(20px);
  opacity: 0;
  transition: transform var(--dur-med) var(--ease-settle),
              opacity var(--dur-med) var(--ease-soft);
  margin: 12px 0;
  line-height: 1.4;
}

/* Remove the separate margin for filter-chips container */
.details-content.active p { transform: translateY(0); opacity: 1; }
.details-content.active p:nth-child(1){ transition-delay: 60ms; }
.details-content.active p:nth-child(2){ transition-delay: 120ms; }
.details-content.active p:nth-child(3){ transition-delay: 180ms; }

/* Let the labels and chips transition their own colors instead of layering
   color transitions on the filter row and its parent panel. */
html.theme-anim body.work-page .details-content > p {
  transition: transform var(--dur-med) var(--ease-settle),
              opacity var(--dur-med) var(--ease-soft);
}

/* BUTTONS & FILTERS (single source of truth) */
.details-content button, .filter-chip {
  background: transparent; color: #0f0e0e; font: inherit;
  transition: all .2s ease; font-size: inherit; border: 0; padding: 2px 6px; cursor: pointer; 
}
.details-content button:hover, .filter-chip:hover { background: rgb(152, 216, 188); }
.details-content button.active, .filter-chip.active {
  background: #0f0e0e; color: white; border: 0;
}
.filter-chips { display: contents;  }
.details-content .filter-chip { margin: 0; border-radius: 0;}

/* PROJECT NAVIGATION */
.project-navigation {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  margin-top: auto; z-index: 1000; position: relative;
}
.nav-prev, .nav-next {
  display: flex; align-items: center; text-decoration: none; color: #0f0e0e;
  transition: opacity .3s ease, color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
  margin: -12px; cursor: pointer; position: relative; z-index: 1001;
  padding: 8px 12px; border-radius: 0;
}

.project.flex-item img { position: relative; z-index: 2; }
.project.flex-item { position: relative; z-index: 1; }



/* CURSOR (desktop only shows custom cursor; touch keeps native) */
a, button, input, textarea, select, [role="button"],
.flex-item a, .flex-item img, .burger-menu, .toggle-button, .filter-chip, .theme-button { cursor: pointer !important; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea, select, [role="button"],
  .flex-item a, .flex-item img, .burger-menu, .toggle-button, .filter-chip, .theme-button { cursor: none !important; }


  .cursor-ring {
    /* keep your existing rules */
    transform: translate(-50%, -50%);
    will-change: left, top;              /* was: transform */
    transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out;
  }

  /* click feedback (adds a subtle press) */
  .cursor-ring.clicking {
    transform: translate(-50%, -50%) scale(0.92);
  }
  .cursor-ring.enlarge { width: 32px; height: 32px; }
}
@media (hover: none) and (pointer: coarse) {
  body { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* SCROLL INDICATOR */
@keyframes bouncing { 0%{bottom:0} 50%{bottom:8px} 100%{bottom:0} }
.scroll { animation: bouncing 2s infinite ease-in-out; position: relative; width: 40px; margin-top: auto; transition: opacity .3s ease-out; opacity: 1; }

/* DEFAULT: hide all containers; enable via MQs */
.container-lg, .container-md, .container-ms, .container-sm { display: none; }

/* Large (≥1475px) */
@media (min-width: 1475px) {
  .container-lg { display: grid; }
  .flex-item { flex: 0 0 33.3%; }
  .project.flex-item { flex: 100%; width: 100%; flex-direction: column;align-items: center; }
}

/* Medium (1060–1474px) */
@media (min-width: 1060px) and (max-width: 1474px) {
  .container-md { display: grid; }
  .flex-item { flex: 0 0 50%; }
  .project.flex-item { flex: 0 0 100%; width: 100%; flex-direction: column; align-items: center;}
}

/* Medium-Small (768–1059px) */
@media (min-width: 768px) and (max-width: 1059px) {
  .container-ms { display: grid; }
  .flex-item { flex: 0 0 100%; }
  .project.flex-item { width: 100%; flex-direction: column; align-items: center; }
}

/* Small (≤767px) */
@media (max-width: 767px) {
  .container-sm {
    display: grid;
    padding: 107px 15px 15px;
    grid-template-rows: auto;
    height: auto;
    min-height: calc(100vh - 167px);
  }
  .container-sm.abt { grid-template-rows: auto; }
  .container-sm.abt .item6 {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 167px);
  }
  .container-sm.abt .item6 > .project-details { margin-top: auto; }
  .container-sm.abt .item6 > p:last-child { margin-bottom: 0; }
  .small.flex-item { flex: 1 1 100%; padding: 20px;}

  .item1, .item7 { position: relative; width: 100%; z-index: 1000; pointer-events: none; }
  .container-sm > .item7 {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 20px;
    box-sizing: border-box;
    background: #ffffff00;
    z-index: 1001;
  }
  
  .item1 nav, .item1 nav *,
.item7 .phone-nav, .item7 .phone-nav *,
.menu-overlay, .menu-overlay *,
.theme-button {
  pointer-events: auto;
  font-weight: 400;
}


  .container-sm .project-navigation { position: static !important; background: none; }

  .project-navigation .nav-prev, .project-navigation .nav-next {
    position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 500; background: transparent; border: 0; padding: 10px; line-height: 1; -webkit-tap-highlight-color: transparent;
  }
  .project-navigation .nav-prev { left: 16px; }
  .project-navigation .nav-next { right: 16px; }

  .phone-nav.is-open .menu-overlay { opacity: 1; visibility: visible; pointer-events: auto; z-index: 1000; }
}

/* Custom cursor base (required) */
.cursor-dot {
  width: 4px;
  height: 4px;
  background: #0f0e0e;
  border-radius: 0;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s,
              background-color var(--theme-dur) var(--theme-ease);
}

.cursor-ring {
  width: 10px;
  height: 10px;
  border: 1px solid #0f0e0e;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out,
              border-color var(--theme-dur) var(--theme-ease);
}




/* Force cursor to stay visible across modes */

/* === Cursor always visible === */
.cursor-dot,
.cursor-ring {
  filter: none !important;        /* never inherit inversion */
  mix-blend-mode: normal !important;
}

/* Light mode cursor (default) */
.cursor-dot {
  background: #0f0e0e;
}
.cursor-ring {
  border-color: #0f0e0e;
}

/* Night mode cursor (force white for contrast) */
.night-mode .cursor-dot {
  background: #fff;
}
.night-mode .cursor-ring {
  border-color: #fff;
}/* === NIGHT MODE (explicit opposites, no global invert) === */
.night-mode {
  background-color: #0f0e0e;
  color: #fff;
}

/* Text, headings, links */
.night-mode h1, .night-mode h2, .night-mode h3,
.night-mode h4, .night-mode h5, .night-mode h6,
.night-mode p,  .night-mode li,  .night-mode a {
  color: #fff;
}

/* Logo (adjust selector to your actual logo class/ID) */
.night-mode .logo img,
.night-mode .brand img {
  filter: invert(1) contrast(1.1) !important;
}
.night-mode .logo svg,
.night-mode .brand svg {
  fill: #fff;
  stroke: #fff;
}

/* Filter chips + buttons */
.night-mode .details-content button,
.night-mode .filter-chip {
  background: transparent;
  color: #fff;
  border: 0;
}
.night-mode .details-content button:hover,
.night-mode .filter-chip:hover {
  background: rgb(167, 106, 169);
}
.night-mode .details-content button.active,
.night-mode .filter-chip.active {
  background: #fff;
  color: #0f0e0e;
  border: 0;
}

/* Corner dots */
/* === NIGHT MODE corner dots (inverted from light mode) === */
.night-mode .flex-item::before,
.night-mode .flex-item::after,
.night-mode .flex-item > span::before,
.night-mode .flex-item > span::after {
  background: transparent;   /* transparent like light mode */
  border: 1px solid #fff;    /* white outline instead of #0f0e0e */
}

@media (min-width: 768px) {
  .night-mode .flex-item:not(.project):hover::before,
  .night-mode .flex-item:not(.project):hover::after,
  .night-mode .flex-item:not(.project):hover > span::before,
  .night-mode .flex-item:not(.project):hover > span::after {
    background: #fff;        /* filled white on hover */
    border: 3px solid #fff;  /* thicker white border */
  }
}

@media (min-width: 768px) {
  .flex-container-lg.single-column > .flex-item,
  .flex-container.single-column > .flex-item {
    flex: 0 0 100%;
    height: auto;
    padding: 20px;
  }
  .flex-container-lg.single-column > .flex-item,
  .flex-container.single-column > .flex-item { --hover-pad: 25px; }

  .flex-container-lg.single-column > .flex-item > span,
  .flex-container.single-column > .flex-item > span {
    display: block;
    aspect-ratio: 1.5;
  }
  .flex-container-lg.single-column > .flex-item > span > a,
  .flex-container.single-column > .flex-item > span > a {
    height: 100%;
  }
  .flex-container-lg.single-column > .flex-item img,
  .flex-container.single-column > .flex-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

@media (max-width: 767px) {
  .flex-container-lg.single-column > .flex-item,
  .flex-container.single-column > .flex-item {
    flex: 0 0 100%;
    height: auto;
    padding: 20px;
  }
  .flex-container-lg.single-column > .flex-item img,
  .flex-container.single-column > .flex-item img {
    height: auto;
    aspect-ratio: 1.5;
  }
  .flex-container-lg.single-column > .flex-item,
  .flex-container.single-column > .flex-item { --hover-pad: 30px; }
}

.night-mode .project.flex-item::before,
.night-mode .project.flex-item::after,
.night-mode .project.flex-item > span::before,
.night-mode .project.flex-item > span::after {
  background: #fff;
  border: 3px solid #fff;
}

  /* Small card hover: opposite (#0f0e0e fill with thin white outline) */
  .night-mode .small.flex-item:hover::before,
  .night-mode .small.flex-item:hover::after,
  .night-mode .small.flex-item:hover > span::before,
  .night-mode .small.flex-item:hover > span::after {
    background: #ffffff;
    border: 1px solid #fff;
    width: 6px !important;
    height: 6px !important;
  }


  /* Night mode for small filled dots */
.night-mode .smalldot.small.flex-item::before,
.night-mode .smalldot.small.flex-item::after,
.night-mode .smalldot.small.flex-item > span::before,
.night-mode .smalldot.small.flex-item > span::after {
  background: #fff;   /* filled (inverse of light’s #0f0e0e) */
  border: 1px solid #fff;
}

/* (Optional) keep the hover identical in night mode */
@media (min-width: 768px) {
  .night-mode .smalldot.small.flex-item:hover::before,
  .night-mode .smalldot.small.flex-item:hover::after,
  .night-mode .smalldot.small.flex-item:hover > span::before,
  .night-mode .smalldot.small.flex-item:hover > span::after {
    background: #fff;
    border: 1px solid #fff;
  }
}


/* Mobile menu: dark theme */
.night-mode .menu-overlay {
  background: #0f0e0e;
 /* helps iOS/UI controls pick dark styling */
}

/* Make overlay links readable in dark */
.night-mode .menu-content a {
  color: #fff;
}

/* Keep the hover/active underline visible in dark */


.night-mode img.logo,
.night-mode .logo img,
.night-mode .brand img,
.night-mode img[src$="logo.png"] {
  filter: invert(1) contrast(1.1) brightness(1.1) !important;
}
element.style {
    background-color: #0f0e0e;
    color-scheme: dark;
}


/* Burger menu */
.night-mode .burger-menu { color: #fff; }

/* Media stays normal */
.night-mode img,
.night-mode iframe,
.night-mode video {
  filter: none !important;
}

/* Cursor */
.night-mode .cursor-dot {
  background: #fff !important;
}
.night-mode .cursor-ring {
  border-color: #fff !important;
}


/* Ensure burger is always clickable above overlay */
.burger-menu { z-index: 1002; pointer-events: auto; }

/* Overlay sits under burger and only captures clicks when open */
.menu-overlay {
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.menu-overlay.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Don’t let wrapper block taps on mobile */
.item7, .item1 { pointer-events: none; }
.item7 .phone-nav, .item7 .phone-nav * ,
.item1 nav, .item1 nav * ,
.menu-overlay, .menu-overlay * { pointer-events: auto; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}
.project.flex-item iframe,
.flex-container iframe,
.video-container iframe {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;   /* 🔹 force square shape */
  height: auto;          /* lets the aspect-ratio control height */
  background: transparent;
  border: none;
}
/* default (mobile) */
.project-nav-slot {
  margin-top: 0;
  padding-top: 0;
}

/* tablets/desktop only */
@media (min-width: 768px) {
  .project-nav-slot {
    margin-top: auto;
    padding-top: 1rem;
  }
}
/* Light mode (guard): force #0f0e0e text */
:root:not(.night-mode) body,
:root:not(.night-mode) h1,
:root:not(.night-mode) h2,
:root:not(.night-mode) h3,
:root:not(.night-mode) h4,
:root:not(.night-mode) h5,
:root:not(.night-mode) h6,
:root:not(.night-mode) p,
:root:not(.night-mode) li,
:root:not(.night-mode) a {
  color: #0f0e0e;
}

/* Optional: light-mode nav overlay text */
:root:not(.night-mode) .menu-content a { color: #0f0e0e; }
/* Filter reset button */
.details-content .filter-reset {
  display: none;                /* only shown when there are active chips */
  margin-left: 6px;
  font: inherit;
  font-size: .75rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.details-content .filter-reset.show { display: inline-block; }

/* Night mode color match */
.night-mode .filter-reset {
  color: #fff;
  border-color: #fff;
}
/* Night mode: invert filter toggle + plus/close bars */
.night-mode .toggle-button { 
  color: #fff; 
}
.night-mode .symbol::before,
.night-mode .symbol::after {
  background: #fff;
}
/* Place reset beside the Filter toggle */
.project-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reset button base */
.filter-reset-all{
  display: none;               /* shown only when there are active chips */
  padding: 0;
  font: inherit;
  font-size: .9rem;
  border: none;
  background: transparent;
  line-height: 1.2;
  font-weight: 300;
  color: #787575;
  cursor: pointer;
  opacity: .5;                 /* 50% by default */
  transition: opacity .2s ease, color .2s ease, border-color .2s ease, background-color .2s ease;
}
.filter-reset-all.show{ display: inline-flex; }
.filter-reset-all:hover,
.filter-reset-all:focus{ opacity: 1; } /* 100% on hover/focus */

/* Light mode colour = #0f0e0e (inherits from surrounding text) */
:root:not(.night-mode) .filter-reset-all{ color: #0f0e0e; }

/* Night mode colour = white */
.night-mode .filter-reset-all{ color: #fff; }

/* ===== Unified theme transition ===== */
:root {
  --theme-dur: 300ms;
  --theme-ease: var(--ease-soft);
}

/* Only transition when JS adds .theme-anim to <html> */
.theme-anim,
.theme-anim body,
.theme-anim .container-lg,
.theme-anim .container-md,
.theme-anim .container-ms,
.theme-anim .container-sm,
.theme-anim .flex-container,
.theme-anim .flex-container-lg,
.theme-anim .item1,
.theme-anim .item2,
.theme-anim .item4,
.theme-anim .item7 {
  transition: background-color var(--theme-dur) var(--theme-ease),
              color var(--theme-dur) var(--theme-ease);
}

/* Text & links everywhere (nav, content, filter labels, etc.) */
.theme-anim h1, .theme-anim h2, .theme-anim h3, .theme-anim h4, .theme-anim h5, .theme-anim h6,
.theme-anim p, .theme-anim li, .theme-anim a, .theme-anim b,
.theme-anim .content, .theme-anim nav a {
  transition: color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}

/* Filter UI (toggle, panel, chips, reset, prev/next, burger, overlay links) */
.theme-anim .project-details,
.theme-anim .toggle-button,
.theme-anim .filter-chip,
.theme-anim .filter-reset-all,
.theme-anim .theme-button,
.theme-anim .nav-prev, .theme-anim .nav-next,
.theme-anim .burger-menu,
.theme-anim .menu-content a {
  transition: color var(--theme-dur) var(--theme-ease),
              background-color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease),
              text-decoration-color var(--theme-dur) var(--theme-ease);
}

/* Corner dots & +/× icon bars */
.symbol::before, .symbol::after { background: currentColor; } /* follow text color */
.theme-anim .flex-item::before,
.theme-anim .flex-item::after,
.theme-anim .flex-item > span::before,
.theme-anim .flex-item > span::after,
.theme-anim .symbol::before,
.theme-anim .symbol::after {
  transition: background-color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease);
}

/* Images that change CSS filter (logo, gallery if you filter) */
.theme-anim .logo img,
.theme-anim .brand img,
.theme-anim img[src$="logo.png"],
.theme-anim .flex-item img {
  transition: filter var(--theme-dur) var(--theme-ease),
              opacity .15s var(--theme-ease);
}

/* Mobile overlay should also fade its bg between themes */
.theme-anim .menu-overlay {
  transition: opacity .3s ease, visibility .3s ease,
              background-color var(--theme-dur) var(--theme-ease);
}

/* Optional: cursor color swap */
.theme-anim .cursor-dot,
.theme-anim .cursor-ring {
  transition: background-color var(--theme-dur) var(--theme-ease),
              border-color var(--theme-dur) var(--theme-ease),
              opacity .15s var(--theme-ease);
}

/* Reduced motion respects user setting */
@media (prefers-reduced-motion: reduce) {
  .theme-anim, .theme-anim * {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
/* --- Stop the panel/chips from animating while theme flips --- */
.no-panel-anim .details-content,
.no-panel-anim .details-content * {
  transition: none !important;
}

/* Make chips/buttons use the same timing as the gallery (no 'all') */
.details-content button,
.filter-chip {
  transition:
    color 300ms cubic-bezier(.4,0,.2,1),
    background-color 300ms cubic-bezier(.4,0,.2,1),
    border-color 300ms cubic-bezier(.4,0,.2,1);
    border-radius: 0;
}

/* Tone down the repaint triggers inside the panel during theme change */
.details-content {
  /* remove heavy isolation that can cause a flash on color swap */
  contain: none;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  will-change: background-color, color, border-color;
}
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;          /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;
}
.details-content.active{ opacity: 1; }
/* Make the panel overlay properly and receive clicks */
.project-details { position: relative; }
.project-details .details-content { z-index: 1500; pointer-events: auto; }

/* Filter panel base: JS controls height; no CSS height animation */
.details-content{
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  height: 0;          /* closed */
  overflow: hidden;
  opacity: 0;
  background: transparent;
}
.details-content.active{ opacity: 1; }
/* ensure cursor ring always animates on index too */
.cursor-ring {
  transition: opacity .15s, width .2s, height .2s, transform 120ms ease-out !important;
  transform: translate(-50%, -50%); /* base */
}
.cursor-ring.enlarge { width: 32px; height: 32px; }
/* Portfolio mode: hide the whole filter UI (toggle + panel + reset) */


/* =========================================================
   OMMOLETTE CLOCK (about page)
   ========================================================= */
:root { --oc-width: 255px; }       /* clock size on desktop */

.ommo-clock {
  --oc-glass: rgba(255, 255, 255, 0.44);   /* Figma: white fill 44% */
  position: fixed;
  right: 40px;
  bottom: calc(40px + 0.9rem);   /* page padding + the © line's margin */
  width: var(--oc-width);
  aspect-ratio: 265 / 415;
  container-type: inline-size;
  pointer-events: none;                    /* never blocks clicks or the cursor */
  z-index: 5;
}
.ommo-clock > * { position: absolute; display: block; margin: 0; }
.ommo-clock img { height: auto; }          /* overrides the global img height: 100% */

/* Crown: 65 x 59, centred above the oval */
.ommo-clock .oc-crown { left: calc(100% * 100 / 265); top: 0; width: calc(100% * 65 / 265); }

/* Frosted glass inside the oval (inset 4 units, hidden under the ring) */
.ommo-clock .oc-glass {
  left:   calc(100% * 4 / 265);
  top:    calc(100% * 60 / 415);
  width:  calc(100% * 257 / 265);
  height: calc(100% * 351 / 415);
  border-radius: 50%;
  background: var(--oc-glass);
  -webkit-backdrop-filter: blur(var(--oc-blur, 4.7px));
          backdrop-filter: blur(var(--oc-blur, 4.7px));
}

/* Face: 265 x 359, starts 56 units down */
.ommo-clock .oc-face { left: 0; top: calc(100% * 56 / 415); width: 100%; }

/* AM / PM label in the small dial */
.ommo-clock .oc-ampm {
  left: 0; width: 100%;
  top: calc(100% * 343 / 415);
  text-align: center;
  font-family: "Gowun Batang", Georgia, serif;
  font-weight: 700;
  font-size: calc(100cqw * 11 / 265);   /* smaller, so the full time fits */
  line-height: 1;
  color: #000;
}

/* Hands — each one's pivot ring sits on the face pivot (132.5, 235.5) */
.ommo-clock .oc-hand { will-change: transform; }
.ommo-clock .oc-minute {   /* 20 x 120, pivot at (9.64, 113.57) */
  width: calc(100% * 20 / 265);
  left:  calc(100% * (132.5 - 9.64) / 265);
  top:   calc(100% * (235.5 - 113.57) / 415);
  transform-origin: calc(100% * 9.64 / 20) calc(100% * 113.57 / 120);
}
.ommo-clock .oc-hour {     /* 26 x 67, pivot at (12.60, 60.58) */
  width: calc(100% * 26 / 265);
  left:  calc(100% * (132.5 - 12.60) / 265);
  top:   calc(100% * (235.5 - 60.58) / 415);
  transform-origin: calc(100% * 12.60 / 26) calc(100% * 60.58 / 67);
}

/* Night mode: white linework, dark glass */
.night-mode .ommo-clock { --oc-glass: rgba(15, 14, 14, 0.44); }
.night-mode .ommo-clock img { filter: invert(1) !important; }
.night-mode .ommo-clock .oc-ampm { color: #fff; }

/* Phones: the clock sits at the bottom right of the page,
   level with the "Made with love" line */
@media (max-width: 767px) {
  /* Mobile: shrinks gradually from 220px (at 767px wide)
     to 170px (at 375px wide), never smaller than 150px */
  :root { --oc-width: clamp(150px, 122px + 12.76vw, 220px); }

  body:has(.ommo-clock) {        /* only pages with the clock */
    position: relative;
    height: auto;                /* body ends where the page content ends */
  }
  .ommo-clock {
    position: absolute;
    right: 15px;
    bottom: 15px;                /* matches the page's bottom padding */
  }
  .container-sm.abt .item6 > p:has(+ .project-details) {
    margin-bottom: calc(var(--oc-width) * 415 / 265 - 1.5rem);
  }
}

/* =====================================================================
   SMOOTH SCROLL (Lenis) — rules from lenis.css
   ===================================================================== */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* =====================================================================
   PAGE TRANSITIONS — pages cross-fade into each other; the nav and the
   music player stay put while everything else changes.
   (Browsers without View Transitions just change page normally.)
   ===================================================================== */
@view-transition { navigation: auto; }
.item1 nav, .item7 .phone-nav { view-transition-name: site-nav; }
/* phones: with the menu open the whole screen is the menu, so it cross-fades with the page instead of shrinking into the header */
.item7 .phone-nav.is-open { view-transition-name: none; }
.room-player { view-transition-name: music-player; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}
/* the old page clears quickly so the two pages' text doesn't overlap for long */
::view-transition-old(root) { animation-duration: 200ms; }
/* the clicked Work picture growing into its project page (javascript/hero.js) */
::view-transition-group(project-hero) {
  animation-duration: 620ms;
  animation-timing-function: cubic-bezier(.2, .7, .1, 1);
}
::view-transition-old(project-hero),
::view-transition-new(project-hero) {
  height: 100%;
  object-fit: contain;
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}
::view-transition-image-pair(project-hero) { isolation: isolate; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .flex-item > span > a { transition: none; }
}

/* the cursor ring steps aside while it's a name bubble (javascript/cursor-label.js) */
.cursor-ring.label-on { opacity: 0 !important; }

/* Keyboard focus looks like hover */
.flex-item:not(.small):focus-within::before,
.flex-item:not(.small):focus-within::after,
.flex-item:not(.small):focus-within > span::before,
.flex-item:not(.small):focus-within > span::after { border-width: 3px; background: currentColor; }
.flex-item a:focus-visible { outline: none; }

/* =====================================================================
   THEME TOGGLE: the current theme's button is highlighted straight from the
   page's night/light class, so it's right from the very first frame instead
   of jumping across once the script runs.
   ===================================================================== */
:root:not(.night-mode) .details-content .theme-button[data-theme="light"] { background: #0f0e0e; color: #fff; }
.night-mode .details-content .theme-button[data-theme="night"] { background: #fff; color: #0f0e0e; }
/* nothing in the panel animates while the page sets itself up */
.no-panel-anim .symbol::before,
.no-panel-anim .symbol::after,
.no-panel-anim .toggle-button { transition: none !important; }