:root {
  color-scheme: light;
  --brand: #0a6b61;
  --brand-deep: #07534c;
  --ink: #132824;
  --muted: #63736f;
  --line: #dce8e5;
  --surface: #ffffff;
  --background: #f4f9f7;
  --shadow: 0 18px 48px rgba(16, 64, 56, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(10, 107, 97, 0.08), transparent 32rem),
    var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  color: var(--brand-deep);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(10, 107, 97, 0.24);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 46px;
}

.category-card {
  position: relative;
  display: flex;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  align-items: flex-end;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.category-card::before {
  position: absolute;
  top: -46px;
  right: -36px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(10, 107, 97, 0.08);
  content: "";
}

.category-card:hover,
.category-card:focus-visible {
  border-color: rgba(10, 107, 97, 0.45);
  box-shadow: 0 22px 58px rgba(16, 64, 56, 0.16);
  outline: none;
  transform: translateY(-4px);
}

.card-copy {
  position: relative;
  z-index: 1;
}

.card-title {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.card-action {
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 700;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
}

.back-link {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand-deep);
  background: var(--surface);
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--brand);
  outline: none;
}

.page-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 3rem);
  letter-spacing: -0.04em;
}

.empty-state {
  margin-top: 36px;
  padding: 52px 24px;
  border: 1px dashed #b9cfca;
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.gallery-shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 60px;
}

.gallery-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  padding: 12px 0 18px;
  align-items: center;
  background: linear-gradient(var(--background) 75%, transparent);
}

.gallery-heading {
  min-width: 0;
}

.gallery-title {
  margin: 0;
  overflow: hidden;
  font-size: clamp(1rem, 3vw, 1.25rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-title {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-count {
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.screen-stage {
  display: flex;
  min-height: calc(100vh - 120px);
  padding: 20px 0 44px;
  justify-content: center;
  align-items: flex-start;
}

.screen-image {
  display: block;
  width: min(430px, 100%);
  height: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(13, 45, 39, 0.18);
}

.gallery-arrow {
  position: fixed;
  z-index: 10;
  top: 50%;
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #063f3a;
  cursor: pointer;
  opacity: 0.25;
  transform: translateY(-50%);
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  outline: 3px solid rgba(10, 107, 97, 0.24);
  outline-offset: 3px;
}

.gallery-arrow:disabled {
  visibility: hidden;
}

.gallery-arrow--previous {
  left: max(16px, calc(50% - 340px));
}

.gallery-arrow--next {
  right: max(16px, calc(50% - 340px));
}

.load-error {
  max-width: 640px;
  margin: 80px auto;
  padding: 30px;
  border: 1px solid #e9c9c4;
  border-radius: 18px;
  background: #fff7f6;
}

@media (max-width: 760px) {
  .shell {
    padding-top: 24px;
  }

  .brand {
    margin-bottom: 34px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .category-card {
    min-height: 145px;
  }

  .gallery-shell {
    width: min(100% - 24px, 860px);
  }

  .gallery-arrow {
    width: 46px;
    height: 46px;
  }

  .gallery-arrow--previous {
    left: 8px;
  }

  .gallery-arrow--next {
    right: 8px;
  }

  .screen-image {
    width: min(100%, 430px);
    border-radius: 18px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
