/* lossless.dev - Pastoral Romantic / Blobitecture Design */

/* CSS Custom Properties Registration */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@property --scroll-y {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.2vw, 1.25rem);
  line-height: 1.72;
  letter-spacing: 0.005em;
  color: #2a2a24;
  background: linear-gradient(
    180deg,
    #f0ede4 0%,
    #f0ede4 15%,
    #e8c4a0 30%,
    #6a8a6a 45%,
    #1a2a1a 55%,
    #1a2a1a 65%,
    #6a8a6a 75%,
    #e8c4a0 88%,
    #f0ede4 100%
  );
  background-size: 100% 500vh;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== NAVIGATION ===== */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  transition: background 0.4s ease;
}

.nav-bar.scrolled {
  background: rgba(240, 237, 228, 0.85);
  backdrop-filter: blur(12px);
}

.nav-bar.dark {
  background: rgba(26, 42, 26, 0.85);
}

.nav-domain {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: #2a2a24;
  text-transform: lowercase;
  transition: color 0.4s ease;
}

.nav-bar.dark .nav-domain {
  color: #f0ede4;
}

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #2a2a24;
  transition: color 0.4s ease;
  padding: 0.25rem;
}

.nav-bar.dark .nav-toggle {
  color: #f0ede4;
}

/* Nav Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 800;
  background: rgba(240, 237, 228, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.nav-overlay-content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #2a2a24;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.nav-link:hover {
  color: #c9a84c;
  transform: translateX(0.5rem);
}

/* ===== SECTIONS ===== */
.section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== PARALLAX LAYERS ===== */
.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.parallax-near {
  z-index: 3;
  pointer-events: auto;
}

.parallax-mid {
  z-index: 2;
}

.parallax-far {
  z-index: 1;
}

/* ===== BLOB MORPHING ===== */
@keyframes blobMorph1 {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 56% 44% / 64% 28% 72% 36%; }
  50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
  75% { border-radius: 42% 58% 44% 56% / 36% 72% 28% 64%; }
}

@keyframes blobMorph2 {
  0%, 100% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
  25% { border-radius: 44% 56% 42% 58% / 36% 64% 28% 72%; }
  50% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  75% { border-radius: 56% 44% 58% 42% / 72% 36% 64% 28%; }
}

@keyframes blobAgitate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.03); }
  50% { transform: scale(0.97); }
  75% { transform: scale(1.05); }
}

.blob {
  position: absolute;
  animation: blobMorph1 var(--morph-duration, 20s) ease-in-out infinite;
}

/* Origin blobs */
.blob-1 {
  width: 70vw;
  height: 60vh;
  top: -10%;
  left: -15%;
  background: radial-gradient(ellipse at 40% 40%, rgba(106, 138, 106, 0.06), rgba(201, 168, 76, 0.04), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 20s;
  animation-duration: var(--morph-duration);
}

.blob-2 {
  width: 50vw;
  height: 50vh;
  bottom: -5%;
  right: -10%;
  background: radial-gradient(ellipse at 60% 50%, rgba(176, 94, 58, 0.05), rgba(232, 196, 160, 0.04), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 18s;
  animation-duration: var(--morph-duration);
}

.blob-3 {
  width: 40vw;
  height: 35vh;
  top: 20%;
  right: 10%;
  background: radial-gradient(ellipse at 50% 50%, rgba(58, 107, 140, 0.08), rgba(106, 138, 106, 0.05), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 22s;
  animation-duration: var(--morph-duration);
  animation-delay: -5s;
}

/* Transmission blobs */
.blob-4 {
  width: 65vw;
  height: 55vh;
  top: 5%;
  left: -20%;
  background: radial-gradient(ellipse at 30% 60%, rgba(201, 168, 76, 0.05), rgba(106, 138, 106, 0.04), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 15s;
  animation-duration: var(--morph-duration);
}

.blob-5 {
  width: 55vw;
  height: 45vh;
  bottom: 0;
  right: -15%;
  background: radial-gradient(ellipse at 70% 40%, rgba(58, 107, 140, 0.06), rgba(232, 196, 160, 0.04), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 17s;
  animation-duration: var(--morph-duration);
  animation-delay: -3s;
}

.blob-6 {
  width: 35vw;
  height: 30vh;
  top: 30%;
  left: 15%;
  background: radial-gradient(ellipse at 50% 50%, rgba(176, 94, 58, 0.08), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 16s;
  animation-duration: var(--morph-duration);
  animation-delay: -8s;
}

/* Noise Gate blobs */
.blob-7 {
  width: 60vw;
  height: 50vh;
  top: -10%;
  right: -20%;
  background: radial-gradient(ellipse at 50% 50%, rgba(176, 94, 58, 0.08), rgba(201, 168, 76, 0.04), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 6s;
  animation-duration: var(--morph-duration);
}

.blob-8 {
  width: 55vw;
  height: 45vh;
  bottom: -5%;
  left: -15%;
  background: radial-gradient(ellipse at 40% 60%, rgba(58, 107, 140, 0.06), rgba(106, 138, 106, 0.04), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 7s;
  animation-duration: var(--morph-duration);
  animation-delay: -2s;
}

.blob-9 {
  width: 40vw;
  height: 35vh;
  top: 25%;
  left: 30%;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.1), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 5s;
  animation-duration: var(--morph-duration);
  animation-delay: -1s;
}

.blob-agitated {
  animation: blobMorph1 var(--morph-duration, 6s) ease-in-out infinite,
             blobAgitate 3s ease-in-out infinite;
}

/* Reconstruction blobs */
.blob-10 {
  width: 60vw;
  height: 50vh;
  top: 5%;
  left: -10%;
  background: radial-gradient(ellipse at 40% 40%, rgba(106, 138, 106, 0.06), rgba(232, 196, 160, 0.05), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 12s;
  animation-duration: var(--morph-duration);
}

.blob-11 {
  width: 50vw;
  height: 40vh;
  bottom: 10%;
  right: -10%;
  background: radial-gradient(ellipse at 60% 50%, rgba(201, 168, 76, 0.05), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 14s;
  animation-duration: var(--morph-duration);
  animation-delay: -4s;
}

/* Arrival blobs */
.blob-12 {
  width: 80vw;
  height: 70vh;
  top: -20%;
  left: -20%;
  background: radial-gradient(ellipse at 50% 50%, rgba(106, 138, 106, 0.05), rgba(232, 196, 160, 0.04), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 25s;
  animation-duration: var(--morph-duration);
}

.blob-13 {
  width: 60vw;
  height: 55vh;
  bottom: -10%;
  right: -15%;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.04), rgba(58, 107, 140, 0.03), transparent 70%);
  animation-name: blobMorph2;
  --morph-duration: 22s;
  animation-duration: var(--morph-duration);
  animation-delay: -7s;
}

.blob-14 {
  width: 45vw;
  height: 40vh;
  top: 15%;
  right: 5%;
  background: radial-gradient(ellipse at 50% 50%, rgba(176, 94, 58, 0.06), transparent 70%);
  animation-name: blobMorph1;
  --morph-duration: 20s;
  animation-duration: var(--morph-duration);
  animation-delay: -10s;
}

/* ===== TYPOGRAPHY ===== */
.headline {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

h1.headline {
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
}

h2.headline {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
}

h3.headline {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
}

.dm-mono {
  font-family: 'DM Mono', monospace;
  font-weight: 400;
  font-size: clamp(0.72rem, 0.85vw, 0.85rem);
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

p {
  max-width: 38em;
}

/* Headline reveal animation */
.headline-reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.headline-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SECTION-SPECIFIC STYLES ===== */

/* Origin */
.section-origin {
  background: transparent;
}

.origin-content {
  text-align: center;
  padding: 2rem;
}

.origin-subtitle {
  margin-top: 2rem;
  color: #7a7a6e;
}

/* Transmission */
.section-transmission {
  background: transparent;
}

.transmission-content {
  padding: clamp(2rem, 5vw, 6rem);
  width: 100%;
  max-width: 900px;
}

.text-block {
  margin-bottom: 3rem;
}

.text-block p {
  margin-top: 1rem;
  color: #2a2a24;
}

.text-left {
  width: 60%;
  text-align: left;
}

.text-right {
  width: 55%;
  margin-left: auto;
  text-align: left;
}

/* Waveforms */
.waveform {
  position: absolute;
  width: 100%;
  bottom: 5%;
  left: 0;
  height: 15vh;
  z-index: 2;
}

.waveform-inline {
  position: relative;
  width: 100%;
  height: 8vh;
  margin: 2rem 0;
}

.wave-path {
  stroke: rgba(58, 107, 140, 0.4);
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 0.1s linear;
}

.wave-path-echo {
  stroke: rgba(58, 107, 140, 0.2);
}

/* Signal SVG styles */
.signal-svg .wave-path,
.signal-svg .signal-clean {
  stroke: #3a6b8c;
}

.signal-gate {
  stroke: #c9a84c;
}

.signal-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  fill: #c9a84c;
  letter-spacing: 0.1em;
}

/* Noise Gate */
.section-noise-gate {
  background: transparent;
  color: #f0ede4;
}

.section-noise-gate .headline {
  color: #f0ede4;
}

.section-noise-gate p {
  color: rgba(240, 237, 228, 0.85);
}

.noise-gate-content {
  max-width: 580px;
  padding: clamp(2rem, 5vw, 4rem);
  width: 100%;
}

/* Signal Container - Border Animate */
.signal-container {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 2rem;
  border: 1px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image:
    linear-gradient(rgba(26, 42, 26, 0.9), rgba(26, 42, 26, 0.9)),
    linear-gradient(var(--border-angle), #c9a84c, #3a6b8c, #b05e3a, #c9a84c);
  animation: borderRotate 4s linear infinite;
}

.signal-container-fast {
  animation: borderRotate 2s linear infinite;
}

@keyframes borderRotate {
  to { --border-angle: 360deg; }
}

.noise-gate-label {
  color: #c9a84c;
  display: block;
  text-align: center;
}

.signal-diagram {
  margin: 2rem 0;
  text-align: center;
}

.signal-svg {
  width: 100%;
  max-width: 500px;
}

/* Noise Gate hue-rotate */
.section-noise-gate.active-hue {
  filter: hue-rotate(var(--hue-shift, 0deg));
}

/* Reconstruction */
.section-reconstruction {
  background: transparent;
}

.reconstruction-content {
  text-align: center;
  padding: clamp(3rem, 5vw, 6rem);
}

.card-float {
  position: absolute;
  padding: clamp(2rem, 3vw, 3rem);
  background: rgba(240, 237, 228, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  max-width: 340px;
}

.card-float p {
  margin-top: 0.8rem;
  font-size: 0.95em;
  color: #2a2a24;
}

.card-float-1 {
  top: 20%;
  left: 8%;
}

.card-float-2 {
  bottom: 20%;
  right: 8%;
}

/* Seed Pods */
.seed-pod {
  position: relative;
  width: 80px;
  height: 100px;
  margin: 2rem auto;
}

.seed-inner {
  position: absolute;
  width: 40px;
  height: 50px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 40%, rgba(201, 168, 76, 0.3), rgba(106, 138, 106, 0.2), transparent);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.seed-outer {
  position: absolute;
  width: 65px;
  height: 80px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 1px solid rgba(106, 138, 106, 0.2);
  animation: blobMorph1 12s ease-in-out infinite;
}

/* Glyphs */
.glyph-transition {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.glyph-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 76, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: glyphPulse 4s ease-in-out infinite;
}

.glyph-inner-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(58, 107, 140, 0.5);
}

@keyframes glyphPulse {
  0%, 100% { border-color: rgba(201, 168, 76, 0.4); }
  33% { border-color: rgba(58, 107, 140, 0.5); }
  66% { border-color: rgba(176, 94, 58, 0.4); }
}

/* Arrival */
.section-arrival {
  background: transparent;
}

.arrival-content {
  text-align: center;
  padding: 2rem;
}

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

.arrival-domain-wrapper {
  animation: arrivalBreathe 8s ease-in-out infinite;
}

.arrival-domain {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(4rem, 10vw, 7rem);
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(135deg, #e8c4a0, #c9a84c, #3a6b8c, #6a8a6a);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.arrival-statement {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.72;
  color: #2a2a24;
  margin-top: 2rem;
}

.arrival-label {
  display: block;
  margin-top: 3rem;
  color: #7a7a6e;
}

/* ===== SECTION CONTENT ===== */
.section-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ===== SVG FILTERS ===== */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .text-left, .text-right {
    width: 90%;
    margin-left: 0;
  }

  .card-float {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 1rem auto;
    max-width: 90%;
  }

  .card-float-1, .card-float-2 {
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .parallax-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 2rem;
  }

  .nav-bar {
    padding: 1rem 1.2rem;
  }
}
