:root {
  --blue: #3a5897;
  --blue-dark: #233d78;
  --red: #ff2941;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #15213b;
  --muted: #5f6b80;
  --border: rgba(58, 88, 151, 0.16);
  --shadow: 0 24px 64px rgba(58, 88, 151, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 41, 65, 0.09), transparent 34rem),
    radial-gradient(circle at 100% 18%, rgba(58, 88, 151, 0.12), transparent 36rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.viewer-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  width: min(100% - 32px, 1480px);
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 940px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.8rem, 3.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.intro {
  max-width: 850px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.button,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button {
  min-height: 50px;
  padding: 0 21px;
}

.button:hover,
.tool-button:hover {
  transform: translateY(-1px);
  opacity: 0.97;
}

.button:focus-visible,
.tool-button:focus-visible,
.image-button:focus-visible {
  outline: 3px solid rgba(255, 41, 65, 0.34);
  outline-offset: 3px;
}

.primary {
  color: #fff;
  background: var(--red);
  box-shadow: 0 15px 32px rgba(255, 41, 65, 0.28);
}

.secondary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 15px 32px rgba(58, 88, 151, 0.24);
}

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.zoom-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  box-shadow: 0 15px 34px rgba(255, 41, 65, 0.34);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(20, 28, 54, 0.98);
}

.viewer[hidden] { display: none; }

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  color: #fff;
  background: rgba(58, 88, 151, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.tool-button {
  min-width: 44px;
  min-height: 42px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-button.wide { min-width: 112px; }
.tool-button.link { background: var(--red); }
.tool-button.close { background: #fff; color: var(--blue-dark); }

.zoom-level {
  min-width: 64px;
  text-align: center;
  font-weight: 900;
}

.viewer-stage {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.1), transparent 24rem),
    radial-gradient(circle at 84% 82%, rgba(255, 41, 65, 0.13), transparent 22rem),
    rgba(20, 28, 54, 0.99);
}

.viewer-stage.dragging { cursor: grabbing; }

.viewer-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  width: min(94vw, 1800px);
  height: auto;
  transform-origin: 0 0;
  user-select: none;
  will-change: transform;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.viewer-help {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(35, 61, 120, 0.72);
  font-size: 0.88rem;
  pointer-events: none;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hero-actions { justify-content: stretch; }
  .button { flex: 1 1 220px; }
  .card { border-radius: 18px; }

  .zoom-badge {
    right: 10px;
    bottom: 10px;
    padding: 10px 13px;
    font-size: 0.86rem;
  }

  .viewer-toolbar {
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .viewer-image { width: 1500px; }
  .viewer-help { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
