/* ─── Nunito ────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/Nunito-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 400;
  src: url('/fonts/Nunito-Italic.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/Nunito-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 700;
  src: url('/fonts/Nunito-BoldItalic.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  src: url('/fonts/Nunito-ExtraBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 800;
  src: url('/fonts/Nunito-ExtraBoldItalic.ttf') format('truetype');
}

/* ─── Raleway ───────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/Raleway-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Raleway';
  font-style: italic;
  font-weight: 400;
  src: url('/fonts/Raleway-Italic.ttf') format('truetype');
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/Raleway-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Raleway';
  font-style: italic;
  font-weight: 700;
  src: url('/fonts/Raleway-BoldItalic.ttf') format('truetype');
}
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 800;
  src: url('/fonts/Raleway-ExtraBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Raleway';
  font-style: italic;
  font-weight: 800;
  src: url('/fonts/Raleway-ExtraBoldItalic.ttf') format('truetype');
}

/* ─── Root Variables ────────────────────────────────────────────────── */
:root {
  /* Border */
  --border-radius: 0;
  --border-width: 0.75px;

  /* Bullet Color */
  --bullet-color: #ffffff;

  /* Base Colors */
  --color-bg-accent: #333333;
  --color-bg-body: #ffffff;
  --color-bg-surface: #ffffff;
  --color-border: #333333;
  --color-heading: #111111;
  --color-link: #333333;
  --color-link-hover: #111111;
  --color-selection-bg: #333333;
  --color-text-base: #333333;

  /* Decorative Gradient */
  --gradient-stripes: repeating-linear-gradient(
    45deg,
    var(--palette-color-1) 0 20px,
    var(--palette-color-2) 20px 40px,
    var(--palette-color-3) 40px 60px,
    var(--palette-color-4) 60px 80px,
    var(--palette-color-5) 80px 100px,
    var(--palette-color-6) 100px 120px,
    var(--palette-color-7) 120px 140px,
    var(--palette-color-8) 140px 160px
  );

  /* Layout & Spacing */
  --max-width: 100vw;
  --scroll-height-mobile: 300px;
  --space-xl: 3.5rem;
  --space-lg: 3rem;
  --space-md: 2rem;
  --space-sm: 1.5rem;

  /* Scrollbar */
  --scrollbar-thumb: #ffffff;
  --scrollbar-track: transparent;

  /* Text Outline */
  --text-outline:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));

  /* Typography */
  --font-family-base: 'Nunito', sans-serif;
  --font-family-heading: 'Raleway', sans-serif;
  --font-size-base: 1rem;
  --font-size-lg: 1.5rem;
  --font-size-md: 1.25rem;
  --font-size-xl: 2rem;
  --font-style-italic: italic;
  --font-weight-bold: 700;
  --font-weight-regular: 400;
  --line-height-normal: 1.4;
  --line-height-snug: 1.3;
  --line-height-tight: 1.1;

  /* Palette */
  --palette-color-1: #ffbcc7;
  --palette-color-2: #ffe8c1;
  --palette-color-3: #ffff99;
  --palette-color-4: #cbf8c2;
  --palette-color-5: #b0e8f9;
  --palette-color-6: #ccc8fd;
  --palette-color-7: #efc4f3;
  --palette-color-8: #ffdaff;

  /* Transitions */
  --transition: 0.5s ease-in-out;
}

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

/* ─── Base Styles ───────────────────────────────────────────────────── */
html, body {
  background: url(/images/clouds.png),
              linear-gradient(to bottom, #9CF, #87CEEB, #DDA0DD, #FFB6C1);
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: var(--color-text-base);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-regular);
  height: 100%;
  letter-spacing: 1px;
  line-height: var(--line-height-normal);
  word-spacing: 5px;
}

/* ─── Typography ─────────────────────────────────────────────────────── */
/* Emoji Inline & Header Fix */
header {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

h1 {
  font-size: var(--font-size-xl);
}

header .emoji {
  filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
  font-size: 2rem;
  line-height: 1;
  vertical-align: middle;
  -webkit-filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-feature-settings: 'smcp' 1;
  font-family: var(--font-family-heading);
  font-variant-caps: small-caps;
  letter-spacing: 3px;
  line-height: var(--line-height-tight);
  text-align: center;
  filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
}

h2 {
  font-size: 1.75rem;
  padding-bottom: 2.25px;
}

h3 {
  font-size: var(--font-size-lg);
  padding-bottom: 1.75px;
}

h4 {
  line-height: var(--line-height-normal);
}

h5, h6 {
  font-size: var(--font-size-md);
}

@supports ((-webkit-background-clip: text) and (-webkit-text-fill-color: transparent)) {
  h1, h2, h3 {
    background: var(--gradient-stripes);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Paragraphs and Inline Text */
p {
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-sm);
}

b, strong {
  font-feature-settings: 'smcp' 1;
  font-variant-caps: small-caps;
  font-weight: var(--font-weight-bold);
}

i, em {
  font-style: var(--font-style-italic);
}

a {
  color: var(--color-link);
  display: inline-block;
  font-feature-settings: 'smcp' 1;
  font-variant-caps: small-caps;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-link-hover);
}

/* ─── Selection & Scrollbar ──────────────────────────────────────────── */
::selection {
  background: var(--color-selection-bg);
  color: var(--color-text-base);
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--color-bg-surface);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  display: flex;
  gap: var(--space-xl);
  height: 100vh;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: var(--space-xl);
}

.column-wrapper {
  background: var(--color-bg-accent);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-sm);
}

.left,
.right {
  flex: 1;
}

.middle {
  flex: 2;
}

.column {
  background-color: var(--color-bg-surface);
  background-image: url("images/starbg.png");
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  height: 100%;
  overflow-y: auto;
  padding: var(--space-sm);
}

/* ─── Navigation ───────────────────────────────────────────────────────── */
nav[aria-label="Main Navigation"] a {
  color: #fcfcfc;
  display: block;
  filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
  letter-spacing: 3px;
  text-decoration: none;
}

nav[aria-label="Main Navigation"] a:hover {
  text-decoration: none;
}

nav[aria-label="Main Navigation"] .toggle-btn {
  font-size: var(--font-size-md);
}

/* ─── Tables ───────────────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  margin-bottom: var(--space-sm);
  width: 100%;
}

th {
  background: var(--gradient-stripes);
  color: #ffffff;
  font-feature-settings: 'smcp' 1;
  font-size: var(--font-size-md);
  font-variant-caps: small-caps;
  font-weight: var(--font-weight-bold);
  letter-spacing: 1px;
  text-shadow:
    0.75px   0       0 var(--color-border),
   -0.75px   0       0 var(--color-border),
    0       0.75px   0 var(--color-border),
    0      -0.75px   0 var(--color-border);
}

th,
td {
  border: var(--border-width) solid var(--color-border);
  padding: var(--space-sm);
  text-align: left;
}

/* ─── Lists ────────────────────────────────────────────────────────────── */
ol {
  list-style-type: decimal;
  margin-bottom: calc(-1 * var(--space-sm));
  margin-top: var(--space-sm);
  padding-left: 0;
}

ol li {
  margin-bottom: var(--space-sm);
  margin-left: 2rem;
}

ol li::marker {
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: bold;
}

ul {
  margin-bottom: calc(-1 * var(--space-sm));
  margin-top: var(--space-sm);
}

ul li {
  list-style-type: none;
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
  position: relative;
}

ul li::before {
  color: var(--bullet-color);
  content: "★";
  filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
  font-weight: 800;
  left: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* ─── Star HR & Bullets ───────────────────────────────────────────────── */
.star-hr {
  align-items: center;
  border: none;
  display: flex;
  height: 1rem;
  justify-content: space-between;
  margin: calc(var(--space-sm) / 2) 0;
  transition: var(--transition);
}

.star-hr span {
  filter:
    drop-shadow(0.75px   0       0 var(--color-border))
    drop-shadow(-0.75px  0       0 var(--color-border))
    drop-shadow(0        0.75px  0 var(--color-border))
    drop-shadow(0       -0.75px  0 var(--color-border));
  font-size: 1rem;
  line-height: 1;
  flex: none;
}

.star-color-1 { color: var(--palette-color-1); }
.star-color-2 { color: var(--palette-color-2); }
.star-color-3 { color: var(--palette-color-3); }
.star-color-4 { color: var(--palette-color-4); }
.star-color-5 { color: var(--palette-color-5); }
.star-color-6 { color: var(--palette-color-6); }
.star-color-7 { color: var(--palette-color-7); }
.star-color-8 { color: var(--palette-color-8); }

/* ─── Decorative Header Stripes ───────────────────────────────────────── */
.striped-column {
  background: var(--gradient-stripes);
}

/* ─── Guestbook Visibility & Transitions ──────────────────────────────── */
.guestbook {
  display: none;
  opacity: 0;
  position: relative;
  transition: var(--transition);
}

.guestbook.visible {
  display: block;
  opacity: 1;
}

#main-content.fade-in {
  opacity: 1;
  pointer-events: auto;
  transition: var(--transition);
}

#main-content.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

/* ─── Guestbook Message ───────────────────────────────────────────────── */
.guestbook-message {
  background: var(--color-bg-surface);
  border-radius: var(--border-radius);
  color: var(--color-text-base);
  display: none;
  left: 50%;
  opacity: 0;
  padding: 1rem;
  position: absolute;
  top: 1rem;
  transform: translateX(-50%);
  transition: var(--transition);
  z-index: 10;
}

/* ─── Guestbook Form ──────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

#guestbook-form {
  display: flex;
  flex-direction: column;
}

#guestbook-form button {
  background: var(--palette-color-5);
  border: var(--border-width) solid var(--color-border);
  cursor: help;
  font-size: 16px;
  font-variant: small-caps;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
  padding: 0.5rem 0;
  text-align: center;
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
}

#guestbook-form button:active {
  box-shadow: inset 2px 2px 2px var(--color-border);
  transform: translateY(1px);
  transition: var(--transition);
}

#guestbook-form button:hover {
  background: var(--palette-color-5);
}

#guestbook-form input,
#guestbook-form textarea {
  background: var(--gradient-stripes);
  border: var(--border-width) solid var(--color-border);
  max-width: 100%;
  padding: 0.5rem;
}

#guestbook-form textarea {
  margin: calc(var(--space-sm) / 2) 0;
}

/* ─── Guestbook Text ───────────────────────────────────────────────────── */
.guestbook-text {
  text-align: justify;
}

.guestbook-text a {
  cursor: help;
  font-variant: small-caps;
  font-weight: 900;
  text-shadow: none;
}

/* ─── Guestbook Entries ───────────────────────────────────────────────── */
.guestbook-entry {
  animation: fadeInUp 0.5s ease forwards;
  background: var(--color-bg-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  margin-top: var(--space-sm);
  opacity: 0;
  padding: calc(var(--space-sm) / 2);
}

.guestbook-entry[class*="star-color-"] {
  color: var(--color-text-base) !important;
}

.guestbook-entry.star-color-1 { background: var(--palette-color-1) !important; }
.guestbook-entry.star-color-2 { background: var(--palette-color-2) !important; }
.guestbook-entry.star-color-3 { background: var(--palette-color-3) !important; }
.guestbook-entry.star-color-4 { background: var(--palette-color-4) !important; }
.guestbook-entry.star-color-5 { background: var(--palette-color-5) !important; }
.guestbook-entry.star-color-6 { background: var(--palette-color-6) !important; }
.guestbook-entry.star-color-7 { background: var(--palette-color-7) !important; }
.guestbook-entry.star-color-8 { background: var(--palette-color-8) !important; }

/* ─── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive Layout ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  header,
  footer {
    display: inline-block;
    flex: none;
    height: auto;
    position: static;
    text-align: center;
    width: 100%;
  }

  header h1,
  footer h1 {
    display: inline;
    font-size: var(--font-size-xl);
  }

  nav[aria-label="Main Navigation"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav[aria-label="Main Navigation"] a {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    margin: 0 2rem;
    text-align: center;
    white-space: nowrap;
  }

  .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    height: auto;
    min-height: 0;
    padding: var(--space-md);
    padding-top: 0;
  }

  .left,
  .middle,
  .right {
    flex: none;
    width: 100%;
  }
}
