:root {
  --night: #1b1410;
  --wood: #7a5327;
  --wood-dark: #5b3a1b;
  --wood-light: #9a6a31;
  --gold: #d5b374;
  --gold-bright: #f1d28a;
  --parchment: #f1dfb8;
  --parchment-edge: #d9c294;
  --ink: #2e1b0f;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Cinzel", serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(255, 222, 160, 0.22), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(120, 150, 110, 0.25), transparent 40%),
    linear-gradient(180deg, #2b2416 0%, #1f1a11 40%, #15110b 100%);
  color: var(--ink);
  min-height: 100vh;
}

.bg-parallax {
  position: fixed;
  inset: -10% 0;
  background:
    radial-gradient(70% 60% at 20% 15%, rgba(110, 150, 110, 0.22), transparent 60%),
    radial-gradient(60% 50% at 80% 10%, rgba(255, 210, 150, 0.18), transparent 65%),
    radial-gradient(70% 60% at 50% 80%, rgba(80, 120, 90, 0.18), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
  transform: translateY(0);
  will-change: transform;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  /* soft mist to evoke a fantasy landscape */
  background:
    radial-gradient(60% 40% at 50% 10%, rgba(255, 245, 220, 0.18), transparent 70%),
    radial-gradient(50% 35% at 70% 25%, rgba(220, 230, 210, 0.14), transparent 65%),
    linear-gradient(180deg, rgba(18, 14, 9, 0.2), rgba(18, 14, 9, 0.6));
  pointer-events: none;
  z-index: 0;
}

html {
  scroll-behavior: smooth;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Crect width='160' height='160' fill='none'/%3E%3Ccircle cx='16' cy='20' r='1' fill='%23ffffff' fill-opacity='0.06'/%3E%3Ccircle cx='60' cy='50' r='1' fill='%23ffffff' fill-opacity='0.04'/%3E%3Ccircle cx='110' cy='90' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3Ccircle cx='130' cy='130' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.mosquito {
  position: fixed;
  width: 32px;
  height: 32px;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.3s ease-out;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) brightness(0.8);
  animation: mosquito-flap 0.1s infinite alternate;
}

@keyframes mosquito-flap {
  0% {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) brightness(0.8);
  }
  100% {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) brightness(0.9);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 1.8rem 4vw 0.6rem;
}

.mast {
  position: relative;
  margin: 0 auto;
  max-width: 1000px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 60%),
    linear-gradient(90deg, var(--wood-dark), var(--wood), var(--wood-light), var(--wood));
  border-radius: 18px 18px 32px 32px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 30px var(--shadow);
  animation: mast-float 6s ease-in-out infinite;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-family: "Comic Neue", "Cinzel", serif;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  color: var(--parchment);
  text-shadow:
    -2px -2px 0 rgba(45, 26, 15, 0.7),
    2px -2px 0 rgba(45, 26, 15, 0.7),
    -2px 2px 0 rgba(45, 26, 15, 0.7),
    2px 2px 0 rgba(45, 26, 15, 0.7),
    0 6px 10px rgba(0, 0, 0, 0.4);
  transform: rotate(-2deg);
  letter-spacing: 0.04em;
  padding: 0;
}

.menu {
  display: flex;
  gap: 0.8rem;
}

.tab {
  text-decoration: none;
  color: #2b1a0f;
  background: linear-gradient(180deg, #d8c091 0%, #c5a66a 100%);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tab.active {
  background: linear-gradient(180deg, #efe1b9 0%, #d6b97d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto 4rem;
  padding: 0 4vw 4rem;
}

.hero {
  margin-top: 1.2rem;
  border-radius: 18px;
  background: #1b1410;
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 18px 30px var(--shadow);
  overflow: hidden;
}

.hero-image {
  height: 240px;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.hero-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(1.35) contrast(1.12) brightness(1.05);
  transition: opacity 2.8s ease-in-out, transform 14s ease-in-out;
  opacity: 0;
  transform: scale(1.02);
  transform-origin: center;
  will-change: transform;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1.22);
}

.hero-slide.is-next {
  opacity: 0;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(60% 40% at 25% 20%, rgba(255, 214, 130, 0.28), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.6;
}

.reduced-motion .hero-slide {
  transition: opacity 0.6s ease-out, transform 6s ease-out;
}

.content {
  margin-top: 1.2rem;
}

.weather-strip {
  margin-top: 1.2rem;
}

.weather-card {
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(255, 225, 170, 0.25), transparent 45%),
    linear-gradient(180deg, #2b2416 0%, #1a150e 100%);
  border-radius: 10px;
  border: 6px solid #f8e7c4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 12px 18px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(241, 210, 138, 0.35);
  overflow: hidden;
  position: relative;
  min-height: 150px;
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(241, 210, 138, 0.4);
  border-radius: 6px;
  pointer-events: none;
}

.quote-strip {
  margin-top: 1.2rem;
}

.quote-card {
  background:
    radial-gradient(140% 140% at 10% 0%, rgba(255, 230, 180, 0.24), transparent 45%),
    linear-gradient(180deg, #2a2114 0%, #1b150d 100%);
  border-radius: 10px;
  border: 6px solid #f8e7c4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 18px rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(241, 210, 138, 0.35);
  padding: 1.6rem 2rem;
  position: relative;
  color: var(--parchment);
  min-height: 120px;
}

.quote-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(241, 210, 138, 0.4);
  border-radius: 6px;
  pointer-events: none;
}

.quote-text {
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.quote-author {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(241, 223, 184, 0.8);
}

.quote-text,
.quote-author {
  transition: opacity 0.2s ease-out;
}

.quote-text.fade-out,
.quote-author.fade-out {
  opacity: 0;
}

.quote-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
  justify-content: center;
}

button.quote-refresh,
button.quote-share {
  background: rgba(241, 210, 138, 0.15);
  border: 1px solid rgba(241, 210, 138, 0.5);
  color: var(--parchment);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

button.quote-refresh:hover,
button.quote-share:hover {
  background: rgba(241, 210, 138, 0.25);
  border-color: rgba(241, 210, 138, 0.8);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

button.quote-refresh:active,
button.quote-share:active {
  transform: translateY(0);
}

button.quote-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.paper {
  background:
    linear-gradient(180deg, #f6e6bf 0%, #f1dfb8 45%, #ead3a7 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='none'/%3E%3Ccircle cx='12' cy='18' r='1.4' fill='%238d6b3b' fill-opacity='0.16'/%3E%3Ccircle cx='60' cy='42' r='1.2' fill='%238d6b3b' fill-opacity='0.14'/%3E%3Ccircle cx='100' cy='86' r='1.2' fill='%238d6b3b' fill-opacity='0.14'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  border-radius: 10px;
  border: 1px solid var(--parchment-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 24px var(--shadow);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(255, 255, 255, 0.2), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Crect width='140' height='140' fill='none'/%3E%3Cpath d='M0 22h140' stroke='%23855f30' stroke-opacity='0.12' stroke-width='1'/%3E%3Cpath d='M0 70h140' stroke='%23855f30' stroke-opacity='0.08' stroke-width='1'/%3E%3Cpath d='M0 118h140' stroke='%23855f30' stroke-opacity='0.08' stroke-width='1'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}


.card {
  background: #2a2a2a;
  border-radius: 8px;
  border: 6px solid #f8e7c4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 16px rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(241, 210, 138, 0.35);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(241, 210, 138, 0.4);
  border-radius: 6px;
  pointer-events: none;
}

.card.video {
  aspect-ratio: 16 / 9;
}

.weatherwidget-io {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-poster {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  display: block;
  cursor: pointer;
  background: #1a1a1a center / cover no-repeat;
  position: relative;
  text-decoration: none;
}

.video-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}

.video-poster::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35), 0 0 18px rgba(241, 210, 138, 0.35);
  clip-path: polygon(35% 28%, 35% 72%, 72% 50%);
}

@keyframes mast-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.card.photo {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6)),
    url("images/theedge.png") center / cover;
  filter: grayscale(1) contrast(1.05);
}

.card.photo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(0, 0, 0, 0.35);
}


@media (max-width: 900px) {
  .mast {
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 600px) {
  .paper {
    padding: 1.4rem;
  }

  .tab {
    font-size: 0.7rem;
  }
}
