/* ==========================================================================
   HERRE STUDIO — COMPONENTS.CSS  v2
   01. Custom Cursor         09. Menu Item Composition
   02. Header / Nav Wrapper  10. Selected-Projects Header
   03. Menu Button (H)       11. Image Hover Preview
   04. Intro Letters (ERRE)  12. Menu Intro Container
   05. Intro Keyframes       13. Tabs — Desktop
   06. Menu Page             14. Tabs — Mobile
   07. Menu List             15. List Components
   08. Menu Header           16. Scroll Watcher
                             17. Theme Switch
                             18. Scrolling Ticker
                             19. Overlay
   ========================================================================== */


/* --------------------------------------------------------------------------
   01. CUSTOM CURSOR
   -------------------------------------------------------------------------- */
#cursor {
  position: fixed;
  /* Sits above all menu / tab content */
  z-index: var(--z-cursor);
  width: 15px;
  height: 15px;
  background-color: var(--text-primary);
  border-radius: 50%;
  /* Never captures mouse events */
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition:
    transform var(--dur-fast) ease,
    background-color var(--dur-fast) ease;
  will-change: left, top;
}

#cursor.variant-hover {
  transform: translate(-50%, -50%) scale(1.5);
  background-color: var(--accent-red);
}

#cursor.variant-click {
  transform: translate(-50%, -50%) scale(0.8);
  background-color: #ffffff;
}


/* --------------------------------------------------------------------------
   02. HEADER / NAVIGATION WRAPPER
   -------------------------------------------------------------------------- */
.h-menu {
  position: relative;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  z-index: var(--z-nav);
  overflow: hidden;
  /* Default: all children non-interactive until explicitly enabled */
  pointer-events: none;
}

/* Fixed positioning variant — applied on both pages */
.h-m2 {
  position: fixed;
}


/* --------------------------------------------------------------------------
   03. MENU BUTTON  (the "H" letter)
   -------------------------------------------------------------------------- */
#menuButton {
  position: absolute;
  left: 0;
  border: none;
  outline: none;
  width: 21.5vw;
  height: 100vh;
  height: 100dvh;           /* dynamic viewport fallback */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-size: 30.5vw;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 0.71;
  padding-block: var(--sp-md);
  background-color: transparent;
  transition:
    background-color var(--dur-slow) ease-in-out,
    color var(--dur-slow) ease-in-out;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* Isolate stacking context so ::after glow stays local */
  isolation: isolate;
  pointer-events: auto;
}

/* Subtle white glow pulse */
#menuButton::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  animation: gentleGlow 3.2s ease-in-out infinite;
}

@keyframes gentleGlow {
  0%, 100% { box-shadow: 0 0 0   rgba(255, 255, 255, 0); }
  50%       { box-shadow: 0 0 45px rgba(255, 255, 255, 0.18); }
}

#menuButton:hover {
  background-color: var(--accent-red);
  color: #fafafa;
}

#menuButton:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: -4px;
}


/* --------------------------------------------------------------------------
   04. HERRE INTRO LETTERS  (E, R, R, E)
   -------------------------------------------------------------------------- */
.h-menu > .e,
.h-menu > .r1,
.h-menu > .r2,
.h-menu > .e2 {
  position: absolute;
  width: 19.99vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-size: 30vw;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 0.8;
  padding-block: var(--sp-md);
  transition: color var(--dur-slow) ease-in-out;
  user-select: none;
}

.h {
  left: 0;
  animation: transform-to-square var(--dur-intro) ease-in-out 1s forwards;
  pointer-events: auto;
  z-index: calc(var(--z-nav) + 1000);
}

.e  { left: 21.5vw; text-indent: -25px; border-left: 0.5px solid var(--border-light); animation: slide-out var(--dur-intro) var(--ease-smooth) 0.8s forwards; }
.r1 { left: 40vw;   text-indent: -10px; border-left: 0.5px solid var(--border-light); animation: slide-out var(--dur-intro) var(--ease-smooth) 0.6s forwards; }
.r2 { left: 60vw;   text-indent: -10px; border-left: 0.5px solid var(--border-light); animation: slide-out var(--dur-intro) var(--ease-smooth) 0.4s forwards; }
.e2 { left: 80vw;   text-indent: -10px; border-left: 0.5px solid var(--border-light); animation: slide-out var(--dur-intro) var(--ease-smooth) 0.2s forwards; }


/* --------------------------------------------------------------------------
   05. INTRO KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes slide-out {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; visibility: hidden; }
}

@keyframes transform-to-square {
  0% {
    transform: translateY(0);
    font-size: 30.5vw;
    width: 21.5vw;
    height: 100vh;
  }
  100% {
    transform: translateY(calc(100dvh - var(--sidebar-w)));
    font-size: 3.5rem;
    width: var(--sidebar-w);
    height: var(--sidebar-w);
    background-color: rgba(250, 250, 250, 0.1);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.3); }
}


/* --------------------------------------------------------------------------
   06. MENU PAGE
   -------------------------------------------------------------------------- */
.menu-page {
  position: fixed;
  inset: 0;                             /* top/right/bottom/left: 0 */
  width: 100%;
  display: flex;
  align-items: flex-start;
  opacity: 0;
  visibility: hidden;
  z-index: var(--z-menu);
  pointer-events: none;                 /* none when closed */
  padding-block: var(--sidebar-w);
  background-color: var(--bg-primary);
  transition:
    opacity var(--dur-mid) ease-in-out,
    background-color var(--dur-slow) ease-in-out;
}

.menu-page.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* --------------------------------------------------------------------------
   07. MENU LIST
   -------------------------------------------------------------------------- */
.menu-list {
  width: 50vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  transform: translateX(-100%);
  color: var(--text-primary);
  overflow: hidden;
  overflow-y: auto;
  position: relative;
  padding-left: var(--sidebar-w);
  z-index: calc(var(--z-menu) + 100);
  transition: opacity var(--dur-mid) ease;
  pointer-events: auto;
  /* Hide scrollbar — both axes */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-list::-webkit-scrollbar {
  display: none;
}

.menu-list.active {
  transform: translateX(0);
}

.menu-list li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.menu-list a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  cursor: default;
  pointer-events: auto;
  transition:
    color var(--dur-slow) ease-in-out,
    padding-left var(--dur-slow) ease-in-out,
    box-shadow var(--dur-slow) ease-in-out,
    background-color var(--dur-slow) ease-in-out;
}

.menu-list a:hover {
  box-shadow: inset 0 -1px 0 var(--text-primary);
  padding-left: var(--sp-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.menu-list a:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   08. MENU HEADER
   -------------------------------------------------------------------------- */
.menu-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 100%;
  padding-block: var(--sp-xl);
  pointer-events: none;
}

.menu-header-l {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
}

.menu-header-s {
  margin-left: auto;
  font-size: var(--fs-xs);
  padding-inline: var(--sp-xs);
}


/* --------------------------------------------------------------------------
   09. MENU ITEM COMPOSITION
   -------------------------------------------------------------------------- */
.menu-i {
  display: flex;
  align-items: baseline;
}

.numeration {
  font-size: var(--fs-numeral);
  line-height: 0.9;
  text-indent: -4.9px;
  flex-shrink: 0;
}

.menu-voice {
  padding-inline: var(--sp-xl);
  font-weight: var(--fw-light);
  font-size: var(--fs-h3);
}

.details {
  margin-left: auto;
  font-size: var(--fs-tiny);
  color: transparent;
  transition: color var(--dur-slow) ease-in-out;
  white-space: nowrap;
}

li:hover .details {
  color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   10. SELECTED PROJECTS HEADER
   -------------------------------------------------------------------------- */
.selected-projects {
  position: absolute;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  top: 50px;
  margin-left: var(--sidebar-w);
  height: 30px;
  width: calc(50vw - var(--sidebar-w));
  color: var(--text-dim);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  z-index: calc(var(--z-menu) + 100);
  line-height: 1.6rem;
  pointer-events: auto;
}

.selected-projects .about-link {
  color: var(--text-dim);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  padding-left: var(--sp-2xl);
  transition: color var(--dur-mid);
}

.selected-projects .about-link:hover {
  color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   11. IMAGE HOVER PREVIEW  (desktop — right panel)
   -------------------------------------------------------------------------- */
.image-display {
  position: fixed;
  top: 0;
  right: 0;
  width: 40vw;
  max-height: 100vh;
  max-height: 100dvh;
  pointer-events: none;
  opacity: 0;
  transform: translateX(20px);
  z-index: calc(var(--z-menu) + 1000);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.image-display img {
  width: 40vw;
  height: 100vh;
  height: 100dvh;
  object-fit: cover;
  object-position: center;
}


/* --------------------------------------------------------------------------
   12. MENU INTRO CONTAINER  (right column wrapper)
   -------------------------------------------------------------------------- */
.menu-intro {
  display: flex;
  flex-direction: column;
  width: 50vw;
  height: 100%;
  pointer-events: none;
  transition:
    transform var(--dur-mid) ease-in-out,
    opacity var(--dur-mid) ease-in-out;
}


/* --------------------------------------------------------------------------
   13. TABS — DESKTOP  (.container-herre)
   -------------------------------------------------------------------------- */
.container-herre input[type="radio"] {
  /* Hidden inputs — controlled via labels */
  display: none;
}

.container-herre {
  width: calc(40vw - var(--sidebar-w));
  overflow: hidden;
  pointer-events: auto;
  position: absolute;
  right: var(--sidebar-w);
  top: 50px;
  z-index: calc(var(--z-menu) + 100);
}

/* Dim menu list when hovering the about panel */
.container-herre:hover ~ .menu-list {
  opacity: 0.25;
  transition: opacity var(--dur-mid) ease;
}

.tabs-herre {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  white-space: nowrap;
  display: grid;
  grid-template-columns: repeat(4, 25%);
  grid-template-rows: 25px 1fr;
  margin-left: var(--sidebar-w);
}

.tabs-herre label {
  display: inline-block;
  position: relative;
  color: var(--text-dim);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  cursor: default;
  line-height: 1.6rem;
  transition: color var(--dur-mid) ease;
}

.tabs-herre label:hover {
  color: var(--text-primary);
}

/* Underline indicator — grows on hover */
.tabs-herre label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width var(--dur-mid) ease;
}

.tabs-herre label:hover::after {
  width: 100%;
}

/* Active tab: red underline */
input[name="tabs"]:checked + label {
  color: var(--text-secondary);
  position: relative;
}

input[name="tabs"]:checked + label::after {
  width: 100%;
  background: var(--accent-red);
}

/* Tab content grid area */
.content-herre {
  grid-column: span 4;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--fs-sm);
  line-height: 1.4em;
}

/* Individual tab panel */
.container-herre .tab-herre {
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  position: absolute;
  height: fit-content;
  border-bottom: 1px solid var(--text-primary);
  padding-top: var(--sp-md);
  padding-bottom: var(--sp-lg);
  text-align: right;
  background-color: var(--bg-primary);
  transition:
    opacity var(--dur-mid) ease,
    transform var(--dur-mid) ease,
    visibility var(--dur-mid) ease,
    background-color var(--dur-slow) ease;
}

/* Active panel states — one per tab */
#tab-1:checked ~ .content-herre .tab-herre:nth-of-type(1),
#tab-2:checked ~ .content-herre .tab-herre:nth-of-type(2),
#tab-3:checked ~ .content-herre .tab-herre:nth-of-type(3),
#tab-4:checked ~ .content-herre .tab-herre:nth-of-type(4) {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  position: relative;
}


/* --------------------------------------------------------------------------
   14. TABS — MOBILE  (.container-herre-m)
   -------------------------------------------------------------------------- */
.container-herre-m input[type="radio"] {
  display: none;
}

.container-herre-m {
  width: 100%;
  overflow: hidden;
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 50px;
  z-index: var(--z-overlay);
}

.tabs-herre-m {
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  white-space: nowrap;
  display: grid;
  grid-template-columns: repeat(4, 25%);
  grid-template-rows: 25px 1fr;
  margin-inline: var(--sp-xs);
}

.tabs-herre-m label {
  display: inline-block;
  position: relative;
  color: var(--text-dim);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  cursor: default;
  line-height: 1.6rem;
  text-align: center;
  transition: color var(--dur-mid) ease;
}

.tabs-herre-m label:hover {
  color: var(--text-primary);
}

.tabs-herre-m label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width var(--dur-mid) ease;
}

.tabs-herre-m label:hover::after {
  width: 100%;
}

.container-herre-m .tab-herre {
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  position: absolute;
  min-height: 80vh;
  max-width: 100%;
  padding-top: var(--sp-lg);
  padding-bottom: var(--sp-xl);
  padding-inline: var(--sp-lg);
  font-size: var(--fs-sm);
  text-align: right;
  background-color: var(--bg-primary);
  transition:
    opacity var(--dur-mid) ease,
    transform var(--dur-mid) ease,
    visibility var(--dur-mid) ease,
    background-color var(--dur-slow) ease;
}

#tab-1m:checked ~ .content-herre .tab-herre:nth-of-type(1),
#tab-2m:checked ~ .content-herre .tab-herre:nth-of-type(2),
#tab-3m:checked ~ .content-herre .tab-herre:nth-of-type(3),
#tab-4m:checked ~ .content-herre .tab-herre:nth-of-type(4) {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  position: relative;
}

/* Mobile tab info paragraph — allow natural wrapping */
.m-tab-info {
  height: auto;
  max-width: 100%;
  white-space: normal;
}


/* --------------------------------------------------------------------------
   15. LIST COMPONENTS — Works & Specs
   -------------------------------------------------------------------------- */

/* Linked works list */
.list-works-a {
  padding-top: 0;
  padding-bottom: var(--sp-md);
  padding-left: var(--sp-lg);
  text-align: right;
  font-size: var(--fs-sm);
  font-weight: var(--fw-light);
  width: 100%;
}

.list-works-a li {
  white-space: nowrap;
  line-height: 1.5;
  position: relative;
  transition: opacity var(--dur-mid) ease-in-out;
}

.list-works-a li:hover {
  border-bottom: 0.5px solid var(--text-dim);
}

/* Dim siblings on hover — progressive focus */
.list-works-a:has(li:hover) li:not(:hover) {
  opacity: 0.25;
}

.list-works-a li:hover::before {
  content: '•';
  font-size: 1.2em;
  position: absolute;
  left: -1em;
  top: 50%;
  transform: translateY(-50%);
}

.list-works-a li a {
  color: var(--text-secondary);
  transition: color var(--dur-mid) ease-in-out;
}

/* Row layout inside a list item */
.proj-i {
  display: flex;
  align-items: center;
  width: 100%;
}

.proj-name {
  margin-left: auto;
}

/* Spec list (non-linked) */
.proj-spec {
  width: 100%;
  padding-top: 0;
  padding-bottom: var(--sp-md);
  padding-left: var(--sp-lg);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-light);
}

.proj-spec li {
  line-height: 1.5;
  position: relative;
  transition: opacity var(--dur-mid) ease-in-out;
}

.proj-spec li:hover {
  border-bottom: 0.5px solid var(--text-dim);
}

.proj-spec:has(li:hover) li:not(:hover) {
  opacity: 0.25;
}

.proj-spec li:hover::before {
  content: '•';
  font-size: 1.2em;
  position: absolute;
  left: -1em;
  top: 50%;
  transform: translateY(-50%);
}

/* Sub-heading within lists */
.p-text {
  padding-top: var(--sp-md);
  padding-bottom: var(--sp-2xs);
  font-weight: var(--fw-bold);
}


/* --------------------------------------------------------------------------
   16. SCROLL WATCHER  (menu progress bar, left column)
   -------------------------------------------------------------------------- */
.scroll-watcher {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 0;                            /* animated via JS */
  background-color: var(--text-primary);
  pointer-events: auto;
  transition: background-color var(--dur-slow) ease-in-out;
}


/* --------------------------------------------------------------------------
   17. THEME SWITCH
   -------------------------------------------------------------------------- */
.switch {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  height: var(--sidebar-w);
  width: var(--sidebar-w);
  pointer-events: auto;
  z-index: calc(var(--z-menu) + 100);
  transition: background-color var(--dur-slow) ease-in-out;
}

.switch:hover {
  background-color: var(--text-primary);
}

.switch input[type="checkbox"] {
  /* Hidden — controlled via label */
  display: none;
}

.theme-text {
  display: inline;
  z-index: calc(var(--z-menu) + 100);
  color: var(--text-dim);
  font-size: var(--fs-tiny);
  letter-spacing: 0.05em;
  transition:
    color var(--dur-slow) ease,
    transform var(--dur-mid) ease;
}

.theme-text:hover {
  animation: pulse 3s infinite;
}

#themeToggle:not(:checked) ~ .theme-text::before {
  content: "dark";
  font-size: var(--fs-tiny);
}

#themeToggle:checked ~ .theme-text::before {
  content: "light";
  font-size: var(--fs-tiny);
}


/* --------------------------------------------------------------------------
   18. SCROLLING TICKER  (bottom bar — shown when menu is open)
   Anchored with dvh + env(safe-area-inset-bottom) for mobile Safari
   -------------------------------------------------------------------------- */
.scrolling-header {
  position: fixed;
  bottom: 0;
  /* Respect iOS home indicator / notch */
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  width: 100%;
  height: var(--sidebar-w);
  overflow: hidden;
  z-index: calc(var(--z-menu) + 100);
  /* Hidden until menu opens */
  display: none;
}

.scrolling-header.active {
  display: flex;
  align-items: center;
}

.scrolling-text {
  display: flex;
  white-space: nowrap;
  padding-top: 36px;
  animation: scroll-text 60s linear infinite;
}

.scrolling-text:hover {
  animation-play-state: paused;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.scrolling-text a {
  color: var(--text-secondary);
  font-weight: var(--fw-light);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  padding: var(--sp-md);
  transition: color var(--dur-slow) ease-in-out;
  /* Ticker links are decorative only */
  pointer-events: none;
}

@keyframes scroll-text {
  from { transform: translateX(30%); }
  to   { transform: translateX(-50%); }
}


/* --------------------------------------------------------------------------
   19. OVERLAY  (full-screen dimmer behind the menu)
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background-color: #050505;
  display: none;
  pointer-events: auto;
  /* Use svh so overlay doesn't shift with dynamic chrome */
  height: 100svh;
  transition: background-color 0.4s ease;
}

.overlay.active {
  display: block;
}
