/*
  EDIT GUIDE - where things live in this file:
  - :root block below: the site's color palette. Change these and everything
    using them updates at once (safest way to recolor the site).
  - body: the sunset gradient background and the font.
  - .site-frame: the rounded container every page's content sits inside.
  - header.hero / nav.section-nav: name, tagline, intro, and the tab links.
  - .card / .card-grid / .progression-row: how project cards look and are laid out.
  - .desc / .panel-bg: the translucent text boxes used for descriptions.
  - .compare-*: only used on the Crystal Caverns before/after slider page.
  - .detail-*: only used on individual project pages (projects/*.html).
*/
:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.25);
  --card-border: rgba(255, 255, 255, 0.5);
  --panel-bg: rgba(20, 18, 16, 0.3);
  --panel-border: rgba(255, 255, 255, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", sans-serif;
  color: var(--white);
  background: linear-gradient(
    180deg,
    #afc3e8 0%,
    #c9a9c3 26%,
    #e0906e 55%,
    #f0a868 72%,
    #f4c07a 100%
  );
  background-attachment: fixed;
  background-size: 100% 100%;
  min-height: 100vh;
}

.site-frame {
  max-width: 1100px;
  margin: 24px auto;
  border-radius: 18px;
  overflow: hidden;
  padding: 0 32px 48px;
  position: relative;
}

/* faint cloud streaks, kept subtle */
.site-frame::before,
.site-frame::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}
.site-frame::before {
  top: 14px;
  left: 30px;
  width: 90px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
}
.site-frame::after {
  top: 50px;
  right: 50px;
  width: 70px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
}

header.hero {
  padding: 40px 0 20px;
}

header.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 6px;
}

header.hero p.tagline {
  font-size: 20px;
  margin: 0 0 12px;
}

header.hero p.intro {
  font-size: 22px;
  margin: 0 0 20px;
  max-width: 60ch;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

nav.section-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 0;
}

nav.section-nav a {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

nav.section-nav a:hover,
nav.section-nav a:focus-visible,
nav.section-nav a.active {
  color: var(--black);
  border-bottom-color: var(--black);
}

section.category {
  padding-top: 16px;
}

section.category h2 {
  font-size: 38px;
  font-weight: 700;
  margin: 0 0 6px;
}

section.category .category-note {
  font-size: 18px;
  margin: 0 0 20px;
  max-width: 60ch;
}

h3.subgroup {
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 12px;
  opacity: 0.9;
}

.progression-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.progression-row .arrow {
  display: flex;
  justify-content: center;
  align-self: flex-start;
  font-size: 24px;
  padding-top: 50px;
  flex: 0 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.progression-row .card {
  flex: 0 0 220px;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  padding: 4px;
  transition: background 0.15s ease;
}

.card:hover,
.card:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.card h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.card .thumb {
  height: 120px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card .thumb .thumb-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 8px;
}

.desc {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

.callout {
  margin-top: 32px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 18px;
  line-height: 1.6;
}

.callout strong {
  font-weight: 700;
}

footer {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.4);
  font-size: 12px;
  text-align: center;
}

.detail-frame {
  padding: 40px 32px 48px;
}

.back-link {
  display: inline-block;
  color: var(--white);
  font-size: 18px;
  text-decoration: none;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 2px;
}

.back-link:hover,
.back-link:focus-visible {
  border-bottom-color: var(--white);
}

.detail-thumb {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin: 0 auto 20px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
  display: flex;
  max-width: 780px;
}

.detail-thumb img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
}

.detail-thumb .thumb-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 12px;
}

.detail-frame h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 12px;
}

.detail-desc {
  font-size: 19px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.detail-subhead {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 12px;
}

/* EDIT: reusable image gallery (one image at a time, left/right arrows).
   Used on any detail page that needs to show a set of images. See the
   gallery HTML block in block-electronics.html for the markup pattern -
   copy that whole block + the script under it to reuse on another page. */
.gallery {
  position: relative;
  width: 100%;
  max-width: 780px;
  aspect-ratio: 3296 / 2547;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin: 0 auto 8px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  font-family: inherit;
  transition: background 0.15s ease;
}

.gallery-btn:hover,
.gallery-btn:focus-visible {
  background: rgba(0, 0, 0, 0.5);
}

.gallery-btn.prev {
  left: 10px;
}

.gallery-btn.next {
  right: 10px;
}

.gallery-counter {
  text-align: center;
  font-size: 13px;
  color: var(--white);
  margin: 0 auto 16px;
  max-width: 780px;
}

.desc a {
  color: var(--white);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-frame {
    margin: 12px;
    padding: 0 18px 32px;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}
