/* 
   26_DSTNC WORKSHOPS ("DSTNCT werks") Design System Variables & Core Styles
   Faithful to the Gunther Werks Look - Pure Monochrome (Black, White & Slate Grey)
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Montserrat:wght@800;900&display=swap');

:root {
  /* Color Palette - White Editorial floor + Detailing Green accent */
  --bg-white: #FFFFFF;           /* Crisp white primary floor */
  --bg-light-gray: #F7F7F7;      /* Off-white secondary */
  --bg-dark-grey: #161616;       /* Slate-grey dark sections */
  --bg-dark-card: #222222;       /* Slate-grey card bg */

  /* Hairline Borders */
  --border-light: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.08);
  
  /* Accents */
  --accent-mono: #0E422F;        /* Deep Detailing Green accent */
  --accent-chrome: #E0E0E0;      /* Metallic Silver */
  --accent-red: #0E422F;         /* Explicit green accent helper */
  --accent-on-dark: #176B4D;     /* Legible green for small accents on dark sections */

  /* Typography Settings - Luxury Editorial */
  --font-primary: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  --font-technical: 'JetBrains Mono', monospace;

  /* Spacing & Transitions */
  --padding-pill: 0.9rem 2.8rem;
  --transition-default: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base Body Styles */
body {
  background-color: var(--bg-white);
  color: #111111;
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Analogue Grain Texture Overlay (Gunther Werks Signature) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04; /* Increased to 4% for tactile grit */
  pointer-events: none;
  z-index: 9999;
}

/* 1. Theme Configurations (Unified Dark Theme Tones) */

/* White Section */
.theme-light {
  background-color: var(--bg-white);
  color: #111111;
  --text-main: #111111;
  --text-sub: #444444;
  --text-lbl: #777777;
  --border-line: var(--border-light);
  --btn-stroke: var(--accent-red);
  --btn-hover-text: #FFFFFF;
  --btn-hover-bg: var(--accent-red);
  --accent-color: var(--accent-red);
}

/* Off-white Section */
.theme-light-gray {
  background-color: var(--bg-light-gray);
  color: #111111;
  --text-main: #111111;
  --text-sub: #444444;
  --text-lbl: #777777;
  --border-line: var(--border-light);
  --btn-stroke: var(--accent-red);
  --btn-hover-text: #FFFFFF;
  --btn-hover-bg: var(--accent-red);
  --accent-color: var(--accent-red);
}

/* Dark Grey Alternative Section */
.theme-dark-grey {
  background-color: var(--bg-dark-grey);
  color: #FFFFFF;
  --text-main: #FFFFFF;
  --text-sub: #E0E0E0;
  --text-lbl: #707070;
  --border-line: var(--border-dark);
  --btn-stroke: var(--accent-on-dark);
  --btn-hover-text: #FFFFFF;
  --btn-hover-bg: var(--accent-on-dark);
  --accent-color: var(--accent-on-dark);
}

/* Typography Scale - Regular Weight Gill Sans (Elegant) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.15em;
  margin: 0 0 1rem 0;
  line-height: 1.1;
  color: var(--text-main);
}

h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.3rem);
}

h2 {
  font-size: clamp(1.85rem, 4.1vw, 2.9rem);
}

h3 {
  font-size: clamp(1.22rem, 2.2vw, 1.8rem);
}

/* Monospace Labels & Specs */
.technical-label {
  font-family: var(--font-technical);
  font-size: 11px;
  color: var(--text-lbl);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 400;
  margin-bottom: 0.75rem;
  display: block;
}

/* Accent monochrome label option */
.technical-label.label-accent {
  color: var(--accent-color);
}

.spec-value {
  font-family: var(--font-technical);
  font-size: 12px;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

/* Scroll-Driven Character Reveal Styles */
.reveal-text {
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
}

.reveal-text span {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}

.reveal-text.active span {
  transform: translateY(0);
  opacity: 1;
}

/* Premium SVG Border CTA Button (Gunther Werks style) */
.cta-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--padding-pill);
  font-family: var(--font-primary);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  color: var(--text-main);
  border: none;
  cursor: pointer;
  align-self: flex-start;
  transition: color 0.4s ease;
  outline: none;
}

.cta-pill .cta-stroke {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  pointer-events: none;
}

.cta-pill .cta-stroke rect {
  stroke: var(--btn-stroke);
  stroke-width: 1px;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke 0.4s ease;
  rx: 9999px;
}

.cta-pill:hover {
  color: var(--btn-hover-text);
}

.cta-pill:hover .cta-stroke rect {
  stroke: var(--btn-hover-bg);
  fill: var(--btn-hover-bg);
  animation: cta-stroke-draw 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Secondary CTA Style: Filled by default, Outlined on hover */
.cta-pill.cta-pill--filled {
  background: transparent;
  color: var(--btn-hover-text);
}

.cta-pill.cta-pill--filled .cta-stroke rect {
  stroke: var(--btn-stroke);
  fill: var(--btn-stroke);
}

.cta-pill.cta-pill--filled:hover {
  color: var(--text-main);
  background: transparent;
}

.cta-pill.cta-pill--filled:hover .cta-stroke rect {
  stroke: var(--btn-stroke);
  fill: transparent;
}

@keyframes cta-stroke-draw {
  0% {
    stroke-dashoffset: 440;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.cta-text {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-text svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.cta-pill:hover .cta-text svg {
  transform: translateX(4px);
}

/* Custom Cursor Follower with Detailing Green Accent */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-mono); /* Detailing Green */
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  mix-blend-mode: normal; /* Make red stand out */
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1), height 0.4s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease, border 0.4s ease;
  will-change: transform;
}

.custom-cursor.is-hovering {
  width: 32px;
  height: 32px;
  background-color: rgba(14, 66, 47, 0.15); /* Transparent green hover bubble */
  border: 1px solid var(--accent-mono);
}

@media (max-width: 768px), (hover: none) {
  .custom-cursor {
    display: none !important;
  }
}

/* Navigation Overlay Glass Header (Centered layout) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5rem;
  background-color: rgba(255, 255, 255, 0.7); /* Light glass over white hero */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  z-index: 999;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4vw;
  transition: background-color 0.4s ease, border-bottom 0.4s ease;
  color: #111111;
}

.site-header.is-scrolled,
.site-header.header-dark {
  background-color: rgba(18, 18, 18, 0.9);
  border-bottom: 1px solid var(--border-dark);
  color: #FFFFFF;
}

.site-header .hamburger-line {
  background-color: #111111; /* Dark lines on light header */
}

.site-header.is-scrolled .hamburger-line,
.site-header.header-dark .hamburger-line {
  background-color: #FFFFFF;
}

.site-header .hamburger-label,
.site-header.is-scrolled .hamburger-label,
.site-header.header-dark .hamburger-label,
.site-header.is-scrolled .nav-links a,
.site-header.header-dark .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

.site-header.is-scrolled .nav-links a:hover,
.site-header.header-dark .nav-links a:hover {
  color: #FFFFFF;
}

/* Centered Logo SVG Container */
.header-logo-container {
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111111; /* Dark logo on light header; flips white on dark sections */
  transition: color 0.4s ease;
}

.header-logo-container svg {
  height: 100%;
  width: auto;
  display: block;
}

.site-header.is-scrolled .header-logo-container,
.site-header.header-dark .header-logo-container {
  color: #FFFFFF;
}

/* ── Page-Transition Curtain ──
   The curtain lives in static HTML and an inline <head> script adds .dw-loading
   to <html> BEFORE first paint, so a fresh page is covered in red instantly —
   no flash of the bare section before JS runs. Classes drive everything:
     .dw-loading   : covered (resting cover, set pre-paint)
     .dw-revealing : swipe the cover OFF to reveal the loaded page
     .dw-leaving   : swipe the cover ON before navigating away
   Curtain is oversized (140% wide) so the -8deg skew still covers fully. */
.page-transition-curtain {
  position: fixed;
  inset: -150px -20%;            /* 140% wide so the skew never leaves a gap */
  background-color: var(--accent-mono); /* Deep Detailing Green #0E422F */
  z-index: 10001;
  transform: skewX(-8deg) translate3d(120%, 0, 0); /* resting: fully off-screen right */
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Covered state, applied at first paint via the inline head script */
html.dw-loading .page-transition-curtain {
  transform: skewX(-8deg) translate3d(0, 0, 0);
}

/* Reveal the incoming page: covered -> off-screen right */
html.dw-revealing .page-transition-curtain {
  animation: dw-curtain-reveal 0.6s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

/* Cover before leaving: off-screen left -> covered */
html.dw-leaving .page-transition-curtain {
  animation: dw-curtain-cover 0.55s cubic-bezier(0.7, 0, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes dw-curtain-cover {
  from { transform: skewX(-8deg) translate3d(-120%, 0, 0); }
  to   { transform: skewX(-8deg) translate3d(0, 0, 0); }
}

@keyframes dw-curtain-reveal {
  from { transform: skewX(-8deg) translate3d(0, 0, 0); }
  to   { transform: skewX(-8deg) translate3d(120%, 0, 0); }
}

.curtain-logo-container {
  transform: skewX(8deg); /* Un-skew the logo so it renders straight */
  width: 240px;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
  display: flex;
  align-items: center;
  justify-content: center;
}

.curtain-logo-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Logo visible while covered/leaving, fades as the page is revealed */
html.dw-loading .curtain-logo-container,
html.dw-leaving .curtain-logo-container { opacity: 1; }
html.dw-revealing .curtain-logo-container { opacity: 0; }
