@media (prefers-color-scheme: dark) {
  body,
  body[data-theme="dark"] {
    text-align: center;
    font-family: "Space Grotesk", sans-serif;
    font-optical-sizing: auto;
    font-weight: 350;
    font-style: normal;
    background-color: #220100;
    color: #f7e7b6;
  }
}

/* Manual dark mode toggle */
body[data-theme="dark"] {
    background-color: #0f0430;
    color: #f7e7b6;
}
body{
    text-align: center;
    font-family: "Space Grotesk", sans-serif;
    font-optical-sizing: auto;
    font-weight: 354;
    font-style: normal;
    background-color: #f7e7b6;
    color: #220100;
    ::selection {
    background-color: #FE5F55;
    color: #fff;
}
}

/* Ensure the viewport has no default margins so fixed elements can be flush with the corner */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* banner sizing and positioning (responsive) */
:root {
  /* banner size used for both banner width and container offset */
  --banner-size: clamp(90px, 18vw, 320px);
  --banner-offset: calc(var(--banner-size) + 1rem);
}

.banner {
  position: fixed;
  /* use safe-area insets when available so the banner isn't hidden on devices with notches */
  top: env(safe-area-inset-top, 0);
  left: env(safe-area-inset-left, 0);
  width: var(--banner-size);
  z-index: 9999; /* sit above other UI */
  display: block;
  text-decoration: none;
  pointer-events: auto;
  margin: 0;
  padding: 0;
}
.banner img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
}

/* Container styles */
.container {
    max-width: 800px;
    margin: var(--banner-offset) auto 0 auto;
    margin: clamp(80px, calc(var(--banner-size) + 1rem), 180px) auto 0 auto;
    background: rgba(255,255,255,0.85);
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 2rem 2rem 2rem 2rem;
    text-align: center;
    transition: background 0.3s;
}
.container {
    max-width: 800px;
    margin: clamp(80px, calc(var(--banner-size) + 1rem), 180px) auto 0 auto;
    background: rgba(255,255,255,0.85);
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 2rem 2rem 2rem 2rem;
    text-align: center;
    transition: background 0.3s;
}

/* Nav bar styling */
nav {
    padding: 1.5em 1em 1.5em 1em;
    max-width: 800px;
    margin: 0 auto 1em auto;
    background: rgba(255,255,255,0.85);
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    transition: background 0.3s;
}

/* Increase nav “button” text size */
nav a {
    font-size: 2rem;
}


body[data-theme="dark"] .container {
    background: #271d45;
}

body[data-theme="dark"] nav {
    background: #271d45;
}

/* Headings and paragraphs */
h1 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
p {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}

/* Links */
a {
    color: #FE5F55;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
a:hover {
    color: #d43c2d;
    text-decoration: underline;
}

/* Parrot link container */
.parrot-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

/* Dark mode toggle button */
#darkModeToggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: #FE5F55;
    color: #fff;
    border: none;
    border-radius: 2rem;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s;
}
#darkModeToggle:hover {
    background: #d43c2d;
}
body.dark-mode #darkModeToggle {
    background: #f7e7b6;
    color: #220100;
}
/* Accessibly hide elements */
.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Dark Mode Toggler */
#theme {
  display: grid;
  place-content: center;
  position: absolute;
  height: 2rem;
  width: 2rem;
  top: 1rem;
  right: 1rem;
  border: solid 2px transparent;
  border-radius: 3px;
}

#theme:focus-within {
  border-color: var(--colorAccentPrimary);
}

body[data-theme="dark"] #theme::before {
  content: "\1F506";
}
body[data-theme="light"] #theme::before {
  content: "\1F312";
}

.skip-to-main-content-link {
  position: absolute; /* Positions the link absolutely on the page */
  left: -9999px; /* Moves the link far off-screen to the left */
  z-index: 999; /* High z-index to ensure visibility when focused */
  padding: 1em;
  background-color: black;
  color: white;
  opacity: 0; /* Invisible by default */
}

.skip-to-main-content-link:focus {
  left: 50%; /* Centre horizontally when focused */
  transform: translateX(-50%); /* Centre by moving back 50% of own width */
  opacity: 1; /* Fully visible when focused */
}