/*
Theme Name: Two Spectacles
Theme URI: https://twospectacles.design
Author: Walter
Author URI: https://twospectacles.design
Description: A beautiful, scroll-driven portfolio theme featuring a pinned, interactive card folder stack, exact style reproduction, custom cursor telemetry, and highly optimized transitions.
Version: 1.0.0
License: Apache License 2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0
Tags: dark, one-column, portfolio, interactive, scroll-driven
Text Domain: two-spectacles
*/

/* Core styles copy of Two Spectacles */
html, body {
  margin: 0;
  padding: 0;
  background-color: #0E0B08; /* match --porcelain */
}

/* Add admin bar spacing if logged in to prevent cutting off sticky panel */
.admin-bar .stack-pin-inner {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .stack-pin-inner {
    top: 46px;
  }
}

.ts-root {
  --porcelain: #0E0B08;
  --paper: #1B1611;
  --ink: #F3EEE4;
  --brass: #D6A73C;
  --slate: #9C9184;
  --line: #2E2820;
  --max: 1180px;

  background: var(--porcelain);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.ts-root * {
  box-sizing: border-box;
}
.ts-root a {
  color: inherit;
}
.ts-root ::selection {
  background: var(--brass);
  color: var(--paper);
}
.ts-root :focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.ts-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 40px;
}
.ts-mono {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}
.ts-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

/* NAV */
.ts-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 11, 8, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.ts-nav .ts-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.ts-nav-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.ts-nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
}
.ts-nav-links a {
  text-decoration: none;
  color: var(--slate);
  position: relative;
  padding-bottom: 3px;
}
.ts-nav-links a:hover {
  color: var(--ink);
}

/* HERO */
.ts-hero {
  position: relative;
  padding: 150px 0 120px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 15% 0%, rgba(214, 167, 60, 0.14), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 20%, rgba(214, 167, 60, 0.08), transparent 55%);
}
.ts-hero-inner {
  position: relative;
}
.ts-hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(56px, 10vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}
.ts-hero h1 .role {
  display: block;
  color: var(--slate);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 4.2vw, 52px);
  margin-top: 10px;
}
.ts-hero-statement {
  max-width: 520px;
  margin-top: 44px;
  font-size: 18px;
  color: var(--slate);
  border-left: 2px solid var(--brass);
  padding-left: 20px;
}
.ts-hero-meta {
  margin-top: 56px;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.ts-hero-meta div {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--slate);
}
.ts-hero-meta strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 4px;
}

.ts-inspector {
  position: absolute;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--brass);
  opacity: 0;
  transition: opacity .2s ease;
  white-space: nowrap;
  z-index: 5;
}
.ts-inspector.show {
  opacity: 0.85;
}
.ts-inspector .dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  top: -2px;
  left: -2px;
}
@media (max-width: 720px) {
  .ts-inspector {
    display: none;
  }
}

/* SECTIONS */
.ts-section {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
#work {
  padding-top: 0;
  padding-bottom: 0;
}
.ts-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.ts-section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 48px);
  letter-spacing: -0.01em;
  margin: 0;
}

.ts-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.ts-reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .ts-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* WORK: pinned scroll folder stack */
.stack-pin-wrapper {
  position: relative;
  height: calc(var(--stack-vh, 4) * 100vh);
}
.stack-pin-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  width: 100%;
}
.stack-left h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
  margin-top: 14px;
  max-width: 12ch;
}
.stack-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--brass);
  margin-top: 28px;
}
.stack-cards {
  position: relative;
  height: 440px;
  justify-self: center;
  width: 100%;
  max-width: 340px;
}
.folder-card {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
  transform: translate(0,0) rotate(0deg);
  cursor: pointer;
}
.folder-card:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
.folder-card::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 22px;
  width: 64px;
  height: 20px;
  background: var(--fc);
  border-radius: 6px 6px 0 0;
}
.folder-card-tab {
  align-self: flex-start;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--fc);
  border: 1px solid var(--fc);
  padding: 3px 9px;
  border-radius: 999px;
}
.folder-card-image-container {
  width: 100%;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}
.folder-card-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}
.folder-card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 10, 9, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}
.folder-card-hover-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: rgba(27, 22, 17, 0.95);
  border: 1px solid var(--brass);
  padding: 6px 14px;
  border-radius: 999px;
  transform: translateY(8px);
  transition: transform 0.3s ease;
}
.folder-card:hover .folder-card-hover-overlay {
  opacity: 1;
}
.folder-card:hover .folder-card-hover-text {
  transform: translateY(0);
}
.folder-card:hover .folder-card-img {
  transform: scale(1.05);
}
.folder-card-body h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}
.folder-card-body p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--slate);
  margin: 0;
}

@media (max-width: 820px) {
  .stack-pin-wrapper {
    height: calc(var(--stack-vh, 4) * 100vh);
  }
  .stack-pin-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
  }
  .stack-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
    align-content: center;
    justify-items: center;
  }
  .stack-cards {
    height: 300px;
    max-width: 260px;
    margin: 0 auto;
  }
  .stack-left h3 {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    font-size: 26px;
    margin-top: 6px;
  }
  .stack-count {
    margin-top: 14px;
  }
  .folder-card-body h4 {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stack-pin-wrapper {
    height: auto;
  }
  .stack-pin-inner {
    position: static;
    height: auto;
    padding: 60px 0;
  }
  .folder-card {
    position: relative;
    margin-bottom: 16px;
  }
  .stack-cards {
    height: auto;
  }
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 40px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--slate);
}

/* PROJECT DETAIL PAGE */
.back-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--slate);
  transition: color .2s ease;
}
.back-link:hover {
  color: var(--brass);
}

.detail-section {
  display: none; /* Controlled by active selection classes/JS */
}

.ts-root.detail-active .ts-hero,
.ts-root.detail-active .ts-section#work {
  display: none;
}

.ts-root.detail-active .detail-section {
  display: block;
}

.detail-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.01em;
  margin: 14px 0 6px;
}
.detail-client {
  color: var(--slate);
  font-size: 13px;
}
.detail-desc {
  color: var(--slate);
  font-size: 16px;
  max-width: 60ch;
  margin-top: 18px;
}

.placeholder-block {
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: linear-gradient(155deg, #1E1912, #141009);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}
.placeholder-label {
  color: var(--slate);
  font-size: 12px;
}

.detail-video {
  margin-top: 44px;
  aspect-ratio: 16/9;
  width: 100%;
}
.play-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  color: var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.detail-image-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: start;
}
.detail-image {
  aspect-ratio: 4/3;
}

@media (min-width: 641px) {
  .detail-image-grid.has-both {
    grid-template-columns: 1.5fr 1fr;
  }
  .detail-image-grid.has-only-desktop {
    grid-template-columns: 1fr;
  }
  .detail-image-grid.has-only-mobile {
    grid-template-columns: 1fr;
    display: flex;
    justify-content: center;
  }
}

@media (min-width: 850px) {
  .detail-image-grid.has-both {
    grid-template-columns: 1fr 256px;
  }
}

@media (min-width: 641px) {
  .device-mockup {
    background: #0f0c08;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    height: 520px;
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .mockup-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: #141009;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
  
  .mockup-viewport::-webkit-scrollbar {
    width: 6px;
  }
  .mockup-viewport::-webkit-scrollbar-track {
    background: transparent;
  }
  .mockup-viewport::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
  }
  .mockup-viewport:hover::-webkit-scrollbar-thumb {
    background: var(--brass);
  }

  .mockup-viewport img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    cursor: zoom-in;
    transition: filter 0.3s ease;
  }
  .mockup-viewport img:hover {
    filter: brightness(1.05);
  }

  .desktop-mockup .mockup-header {
    height: 36px;
    background: #19140d;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
  }
  .desktop-mockup .mockup-dots {
    display: flex;
    gap: 6px;
    position: absolute;
    left: 16px;
  }
  .desktop-mockup .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
  }
  .desktop-mockup .dot.close { background: #ff5f56; }
  .desktop-mockup .dot.minimize { background: #ffbd2e; }
  .desktop-mockup .dot.expand { background: #27c93f; }
  
  .desktop-mockup .mockup-address-bar {
    margin: 0 auto;
    background: #0f0c08;
    border: 1px solid var(--line);
    border-radius: 4px;
    width: 60%;
    height: 22px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--slate);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
  }

  .mobile-mockup {
    background: transparent;
    border: none;
    box-shadow: none;
    align-items: flex-end;
    justify-content: center;
  }
  
  .mobile-mockup .phone-frame {
    width: 256px;
    height: 100%;
    background: #000;
    border: 10px solid #1c1710;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 0 0 auto;
  }

  .mobile-mockup .phone-speaker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 18px;
    background: #1c1710;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
  }
  
  .mobile-mockup .phone-home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
  }

  .mobile-mockup .mockup-viewport {
    height: 100%;
    border-radius: 30px;
  }
}

@media (max-width: 640px) {
  .detail-image-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .device-mockup {
    background: #141009 !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    height: 320px !important;
    display: block !important;
    position: relative !important;
  }
  .device-mockup .mockup-viewport {
    height: 100% !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
  }
  .device-mockup .mockup-viewport img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    cursor: zoom-in !important;
    object-fit: cover !important;
    object-position: top !important;
  }
  .desktop-mockup .mockup-header, 
  .mobile-mockup .phone-speaker, 
  .mobile-mockup .phone-home-indicator {
    display: none !important;
  }
  .mobile-mockup .phone-frame {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: block !important;
  }
}

.detail-live-link {
  margin-top: 40px;
  font-size: 14px;
  display: inline-block;
}

/* CONTACT */
.ts-contact {
  padding-top: 100px;
  padding-bottom: 130px;
}
.ts-contact h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.01em;
  max-width: 14ch;
  margin: 0;
}
.ts-contact-email {
  display: inline-block;
  margin-top: 36px;
  font-size: 22px;
  text-decoration: none;
  border-bottom: 2px solid var(--brass);
  padding-bottom: 2px;
  transition: opacity .2s ease;
}
.ts-contact-email:hover {
  opacity: 0.7;
}
.ts-contact-row {
  margin-top: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.ts-socials {
  display: flex;
  gap: 28px;
  list-style: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  margin: 0;
  padding: 0;
}
.ts-socials a {
  text-decoration: none;
  color: var(--slate);
}
.ts-socials a:hover {
  color: var(--brass);
}

.ts-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 600px) {
  .ts-wrap {
    padding: 0 22px;
  }
  .ts-nav-links {
    gap: 18px;
  }
  .ts-section {
    padding: 70px 0;
  }
  .ts-hero {
    padding: 110px 0 80px;
  }
}

/* INTERACTIVE LIGHTBOX & HOVER EFFECTS */
.detail-image, .device-mockup .mockup-viewport {
  position: relative;
  cursor: pointer;
}
.detail-video {
  position: relative;
  cursor: default;
}
.detail-image img, .device-mockup img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}
.detail-video img {
  transition: none;
}
.detail-image:not(.placeholder-block):hover img, .device-mockup:not(.placeholder-block) .mockup-viewport:hover img {
  filter: brightness(1.1);
}
.detail-image:not(.placeholder-block):hover img {
  transform: scale(1.02);
}

.detail-image:not(.placeholder-block)::after, .device-mockup:not(.placeholder-block) .mockup-viewport::after {
  content: 'Click to view full';
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(14, 11, 7, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  color: var(--slate);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 10;
}
.detail-image:not(.placeholder-block):hover::after, .device-mockup:not(.placeholder-block) .mockup-viewport:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* LIGHTBOX OVERLAY */
.ts-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 11, 7, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 80px 20px 40px;
  box-sizing: border-box;
}
.ts-lightbox.active {
  opacity: 1;
  visibility: visible;
}
.ts-lightbox-close {
  position: fixed;
  top: 30px;
  right: 40px;
  background: rgba(20, 16, 9, 0.8);
  border: 1px solid var(--line);
  color: var(--slate);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 10002;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  font-weight: 300;
}
.ts-lightbox-close:hover {
  color: var(--brass);
  background: #141009;
  transform: scale(1.05);
}
.ts-lightbox-content {
  position: relative;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ts-lightbox.active .ts-lightbox-content {
  transform: translateY(0);
}
.ts-lightbox-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  background: #141009;
}

/* Custom dimensions based on screen types */
.ts-lightbox.lightbox-mobile .ts-lightbox-content {
  max-width: 420px;
}
.ts-lightbox.lightbox-mobile .ts-lightbox-image {
  max-height: none;
}
.ts-lightbox:not(.lightbox-mobile) .ts-lightbox-image {
  max-height: 82vh;
  width: auto;
}
.ts-lightbox-caption {
  margin-top: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--slate);
  text-align: center;
  letter-spacing: 0.05em;
}

