/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
:root {
  --bg: #2f463b;
  --shadow: #321e02;
  --sheen: #ffedc2;
  --timing-ease: cubic-bezier(0.6, 0.0, 0.1, 1);
}

html {
  height: -webkit-fill-available;
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100%;
  background-color: var(--bg);
  overflow: hidden;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #eff4c3;
}

.top-corner {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 20;
}

.date {
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  color: #eff4c3;
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

@font-face {
  font-family: 'DSEG7';
  src: url('assets/fonts/DSEG7Classic-Bold.woff2') format('woff2');
  font-weight: bold;
}

.ascii-clock {
  font-family: 'DSEG7', monospace;
  font-size: 36px;
  color: #eff4c3;
  margin: 0;
  letter-spacing: 2px;
}

.dash-row {
  position: fixed;
  top: 6rem;
  left: 0;
  right: 0;
  border-bottom: 1px dashed var(--dash-color, #334d40);
  z-index: 20;
  pointer-events: none;
}

.dash-col {
  position: fixed;
  top: 0;
  left: 15vw;
  bottom: 0;
  border-right: 1px dashed var(--dash-color, #334d40);
  z-index: 20;
  pointer-events: none;
}

.dash-row.hidden,
.dash-col.hidden {
  display: none;
}

a {
  color: #eff4c3;
  text-decoration: none;
  border-bottom: 1px dotted rgba(239, 244, 195, 0.4);
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: #eff4c3;
}

/* ── Layout ── */
main {
  position: relative;
  z-index: 20;
  display: flex;
  height: 100%;
  overflow: hidden;
}

.column-left {
  position: absolute;
  top: calc(6rem + 16px);
  left: calc(15vw + 2rem);
  cursor: grab;
  user-select: none;
  z-index: 25;
}

.column-left.dragging {
  cursor: grabbing;
}

.column-left h1 {
  font-family: 'EB Garamond', serif;
  font-weight: 400;
  font-size: 32px;
  margin: 0;
}

.column-left p {
  margin: 0;
  padding-top: 1.5rem;
}

.splitter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  flex-shrink: 0;
  background: #eff4c3;
  border-left: 1px solid #eff4c3;
  border-right: 1px solid #eff4c3;
  cursor: col-resize;
  user-select: none;
  transition: background 0.3s;
}

.splitter:hover {
  background: #eff4c3;
}

.splitter div {
  writing-mode: vertical-lr;
  opacity: 0.25;
  letter-spacing: 4px;
  font-size: 10px;
}

.column-right {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  border-left: 1px dotted rgba(239, 244, 195, 0.2);
  padding: 6rem 1.5rem 3rem 1.5rem;
}

.column-right section {
  margin-bottom: 2.5rem;
}

.section-header {
  font-size: 14px;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.section-item {
  margin-bottom: 0.6rem;
}

.section-item a {
  font-size: 15px;
}

.item-desc {
  display: block;
  font-size: 13px;
  opacity: 0.45;
  margin-top: 2px;
}

.note {
  font-size: 13px;
  opacity: 0.45;
  margin: 0;
}

.ascii-art pre {
  font-family: monospace;
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.2;
  white-space: pre;
  margin: 0;
  transition: opacity 0.5s;
}

.ascii-art:hover pre {
  opacity: 0.5;
}

/* ── Scrollbar ── */
.column-left::-webkit-scrollbar,
.column-right::-webkit-scrollbar {
  width: 6px;
}

.column-left::-webkit-scrollbar-thumb,
.column-right::-webkit-scrollbar-thumb {
  background: rgba(239, 244, 195, 0.15);
  border-radius: 3px;
}

/* ── Experience ── */
.exp-toggle {
  margin-top: 2.5rem;
  background: #eff4c3;
  border: 1.5px solid rgba(239, 244, 195, 0.25);
  border-radius: 0;
  color: var(--bg);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.exp-toggle:hover {
}

.exp-panel {
  display: none;
  margin-top: 1.25rem;
}

.exp-panel.open {
  display: block;
}

.exp-panel p {
  margin-bottom: 0.6rem;
}

.exp-dates {
  opacity: 0.5;
  font-size: 0.85em;
}

/* ── Color controls ── */
.controls {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  font-family: monospace;
  font-size: 12px;
  color: rgba(239, 244, 195, 0.4);
}

.controls .group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.controls .hex {
  font-size: 14px;
  letter-spacing: 0.05em;
  user-select: all;
  cursor: pointer;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-row label {
  width: 14px;
  text-align: right;
  flex-shrink: 0;
}

.slider-row input[type="range"] {
  flex: 1;
  max-width: 140px;
  accent-color: rgba(239, 244, 195, 0.3);
  height: 3px;
}

.slider-row .val {
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Saved colors ── */
.saved-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.saved-swatch {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(239, 244, 195, 0.2);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}

.saved-swatch:hover {
  transform: scale(1.2);
}

.saved-swatch .remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  background: #1a1a1a;
  color: #eff4c3;
  border-radius: 50%;
  display: none;
  cursor: pointer;
}

.saved-swatch:hover .remove {
  display: block;
}

.save-btn {
  background: none;
  border: 1px solid rgba(239, 244, 195, 0.2);
  color: rgba(239, 244, 195, 0.4);
  font-family: monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.2s, color 0.2s;
}

.save-btn:hover {
  border-color: rgba(239, 244, 195, 0.5);
  color: rgba(239, 244, 195, 0.7);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  body {
    overflow: auto;
    height: auto;
  }

  .column-left {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding: calc(3rem + 16px) 1.5rem 4rem calc(1.5rem + 16px);
  }

  .column-left h1 {
    font-size: 24px;
  }

  .dash-row {
    top: 3rem;
  }

  .dash-col {
    left: 1.5rem;
  }

  .column-left p {
    font-size: 13px;
  }

  .birds {
    width: 250px;
    height: 350px;
    right: 0;
    bottom: -20px;
  }

  .controls {
    display: none;
  }
}

/* ── Effects container ── */
.effects {
  position: fixed;
  top: -env(safe-area-inset-top);
  left: 0;
  width: 100%;
  height: calc(100dvh + env(safe-area-inset-top));
}

/* ── Birds ── */
.birds {
  position: absolute;
  bottom: -40px;
  right: 5vw;
  width: 500px;
  height: 700px;
  background: url(assets/birds.svg) no-repeat center;
  background-size: contain;
  opacity: 0.12;
  filter: blur(1.5px);
  animation: bird-drift 10s ease-in-out infinite;
}

@keyframes bird-drift {
  0%   { transform: translate(0, 0)       scale(1)    rotate(0deg); }
  25%  { transform: translate(8px, -12px)  scale(1.02) rotate(0.5deg); }
  50%  { transform: translate(-5px, -20px) scale(0.98) rotate(-0.3deg); }
  75%  { transform: translate(10px, -8px)  scale(1.01) rotate(0.4deg); }
  100% { transform: translate(0, 0)        scale(1)    rotate(0deg); }
}

/* ── Golden sheen ── */
#sheen {
  position: absolute;
  background: linear-gradient(209deg, var(--sheen), var(--sheen) 10%, transparent);
  height: 100dvh;
  width: 100%;
  opacity: 0.2;
}

/* ── Blinds + shadow elements ── */
.elements {
  height: 100vh;
  height: -webkit-fill-available;
  position: fixed;
  top: -140px;
  left: 0;
  right: auto;
  width: 110%;
  opacity: 0.18;
  overflow: hidden;
  pointer-events: none;
  filter: contrast(70%) blur(4px);
}

/* ── Branch ── */
#branch {
  position: absolute;
  background-size: cover;
  background-repeat: no-repeat;
  top: 20px;
  right: -80px;
  width: 950px;
  height: 850px;
  background-image: url(assets/leaves/branch.webp);
  filter: url(#wind) blur(2px);
  animation: billow 8s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes billow {
  0%   { transform: perspective(400px) rotateX(0deg)  rotateY(0deg)  scale(1)    rotate(161deg); }
  25%  { transform: perspective(380px) rotateX(1deg)  rotateY(2deg)  scale(1.02) rotate(161deg); }
  50%  { transform: perspective(400px) rotateX(-4deg) rotateY(-2deg) scale(0.97) rotate(161deg); }
  75%  { transform: perspective(420px) rotateX(1deg)  rotateY(-1deg) scale(1.04) rotate(161deg); }
  100% { transform: perspective(400px) rotateX(0deg)  rotateY(0deg)  scale(1)    rotate(161deg); }
}

/* ── Leaves ── */
.leaves {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.leaf-wrapper {
  position: absolute;
  will-change: transform;
  overflow: visible;
  opacity: 0.8;
  backface-visibility: hidden;
}

.leaf-1, .leaf-2, .leaf-3, .leaf-4 {
  width: 200px;
  height: 200px;
  background-size: contain;
  background-repeat: no-repeat;
  transform-origin: center;
}

.leaf-1 {
  background-image: url(assets/leaves/leaf-1.webp);
  animation: falling1 8s linear infinite;
}
.leaf-2 {
  background-image: url(assets/leaves/leaf-2.webp);
  animation: falling2 9s linear infinite;
}
.leaf-3 {
  background-image: url(assets/leaves/leaf-3.webp);
  animation: falling3 10s linear infinite;
}
.leaf-4 {
  background-image: url(assets/leaves/leaf-4.webp);
  animation: falling4 11s linear infinite;
}

@keyframes falling1 {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);       opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate3d(-300px, 200vh, 0) rotate(140deg); opacity: 0; }
}
@keyframes falling2 {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);       opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate3d(-550px, 200vh, 0) rotate(200deg); opacity: 0; }
}
@keyframes falling3 {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);       opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate3d(-180px, 200vh, 0) rotate(220deg); opacity: 0; }
}
@keyframes falling4 {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);       opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate3d(-400px, 200vh, 0) rotate(180deg); opacity: 0; }
}

/* Shutters container */
#blinds .shutter,
#blinds .bar {
  background-color: var(--shadow);
}

#blinds > .shutters {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 12px;
  transform-origin: top right;
  transform-style: preserve-3d;
  transform: matrix3d(
    0.7500, -0.0625, 0.0000, 0.0008,
    0.0000,  1.0000, 0.0000, 0.0000,
    0.0000,  0.0000, 1.0000, 0.0000,
    0.0000,  0.0000, 0.0000, 1.0000
  );
}

.shutter {
  width: 100%;
  height: 80px;
}

/* Vertical bar */
#blinds > .vertical {
  top: 0;
  position: absolute;
  height: 100%;
  width: 140%;
  opacity: 0.8;
  display: flex;
  justify-content: space-around;
}

.vertical > .bar {
  width: 12px;
}

/* ── Progressive blur ── */
#progressive-blur {
  position: absolute;
  height: 100vh;
  width: 100vw;
}

#progressive-blur > div {
  position: absolute;
  height: 100vh;
  width: 100vw;
  inset: 0;
  -webkit-backdrop-filter: blur(var(--blur-amount));
  backdrop-filter: blur(var(--blur-amount));
  -webkit-mask-image: linear-gradient(252deg, transparent, transparent var(--stop1), #c6c6c6 var(--stop2), #c6c6c6);
  mask-image: linear-gradient(252deg, transparent, transparent var(--stop1), #c6c6c6 var(--stop2), #c6c6c6);
}

#progressive-blur > div:nth-child(1) {
  --blur-amount: 4px;
  --stop1: 0%;
  --stop2: 0%;
}

#progressive-blur > div:nth-child(2) {
  --blur-amount: 12px;
  --stop1: 20%;
  --stop2: 60%;
}

#progressive-blur > div:nth-child(3) {
  --blur-amount: 24px;
  --stop1: 0%;
  --stop2: 90%;
}

#progressive-blur > div:nth-child(4) {
  --blur-amount: 60px;
  --stop1: 40%;
  --stop2: 80%;
}

/* ── Film grain noise ── */
.noise {
  height: 100dvh;
  width: 100vw;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  opacity: 0.75;
  pointer-events: none;
}

.noise::before {
  animation: grain 1s steps(2) infinite;
  background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/5c/Image_gaussian_noise_example.png);
  content: "";
  height: calc(100% + 20rem);
  left: -10rem;
  opacity: 0.12;
  pointer-events: none;
  position: fixed;
  top: -10rem;
  width: calc(100% + 20rem);
  filter: brightness(120%) sepia(50%);
}

@keyframes grain {
  0%  { transform: translate3d(0, 2rem, 0); }
  10% { transform: translate3d(-1rem, -2rem, 0); }
  20% { transform: translate3d(-4rem, 1rem, 0); }
  30% { transform: translate3d(4.5rem, -4.5rem, 0); }
  40% { transform: translate3d(-1rem, 3.5rem, 0); }
  50% { transform: translate3d(-4.5rem, -2rem, 0); }
  60% { transform: translate3d(1rem, 3rem, 0); }
  70% { transform: translate3d(3.5rem, -4rem, 0); }
  80% { transform: translate3d(-4.5rem, 0.5rem, 0); }
  90% { transform: translate3d(3rem, -2.5rem, 0); }
  to  { transform: translate3d(-3.5rem, 0, 0); }
}
