:root {
  --bg: #ffffff;
  --green: #39b54a;
  --white: #111111;
  --muted: rgba(0, 0, 0, 0.55);
  --preview-color: #32ad45;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--white);
  background: var(--bg);
}

.page {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px clamp(22px, 4vw, 64px);
  position: relative;
}

.hero {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(360px, 520px) minmax(360px, 1fr);
  grid-template-areas:
    "title title title"
    "dots preview tagline";
  column-gap: 50px;
  row-gap: 70px;
  align-items: end;
}

.title {
  grid-area: title;
  margin: 0;
  color: var(--green);
  font-size: clamp(52px, 7.2vw, 102px);
  line-height: 0.88;
  letter-spacing: 0.045em;
  font-weight: 900;
  white-space: nowrap;
}

.dot-grid {
  grid-area: dots;
  display: grid;
  grid-template-columns: repeat(5, clamp(46px, 4.8vw, 62px));
  grid-auto-rows: clamp(46px, 4.8vw, 62px);
  gap: clamp(10px, 1.35vw, 18px);
}

.dot {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  background: var(--dot-bg);
  box-shadow: inset -10px -14px 20px rgba(0,0,0,.10), inset 8px 9px 14px rgba(255,255,255,.08);
  transition: box-shadow .25s ease;
}

.dot:hover {
  box-shadow:
    inset -10px -14px 20px rgba(0,0,0,.10),
    inset 8px 9px 14px rgba(255,255,255,.08),
    0 0 0 1px rgba(0,0,0,0.8);
}

.dot.active {
  box-shadow:
    inset -10px -14px 20px rgba(0,0,0,.10),
    inset 8px 9px 14px rgba(255,255,255,.08),
    0 0 0 1px rgba(0,0,0,0.8);
}

.preview-area {
  grid-area: preview;
  width: auto;
  aspect-ratio: unset;
  align-self: center;
  justify-self: center;
  position: relative;
  border-radius: 8px;
  background: #111;
  border: 3px solid var(--preview-color);
  box-shadow:
    0 26px 70px rgba(0,0,0,.46),
    0 0 0 7px color-mix(in srgb, var(--preview-color), transparent 78%),
    0 0 38px color-mix(in srgb, var(--preview-color), transparent 45%);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(.92);
  transition: all .35s ease;
}

.preview-area.active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.preview-area::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.20), transparent);
  transform: translateX(-130%);
  pointer-events: none;
}

.preview-area.flash::after {
  animation: shine .72s ease forwards;
}

@keyframes shine { to { transform: translateX(130%); } }

.preview-img {
  width: auto;
  height: 100%;
  object-fit: unset;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
}

.preview-area.active .preview-img {
  opacity: 1;
}

.tagline {
  grid-area: tagline;
  margin: 0;
  justify-self: start;
  font-size: clamp(22px, 2.9vw, 40px);
  line-height: 1;
  font-style: italic;
  letter-spacing: .10em;
  white-space: nowrap;
}

.footer {
  width: min(1320px, 100%);
  margin: 50px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  color: var(--muted);
  font-size: clamp(10px, .95vw, 13px);
  line-height: 1.45;
  text-transform: uppercase;
}

.footer strong { color: var(--white); }
.footer-contact { text-align: right; }

.preview-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f8f7f4;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}

.preview-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

@media (min-width: 601px) and (max-width: 1280px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page {
    height: auto;
    overflow: visible;
    padding: 48px clamp(28px, 5vw, 60px) 48px;
    justify-content: flex-start;
  }

  .preview-close {
    display: flex;
  }

  .hero {
    --cb: clamp(180px, 30vw, 381.93px);
    grid-template-columns: var(--cb) 50px 1fr;
    grid-template-areas:
      "title   title   title"
      "dots    .       preview"
      "tagline tagline tagline";
    column-gap: 0;
    row-gap: 30px;
    align-items: start;
    overflow: hidden;
  }

  .title {
    font-size: clamp(28px, 4.5vw, 56px);
    white-space: nowrap;
  }

  .dot-grid {
    justify-self: start;
    width: var(--cb);
    height: var(--cb);
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    grid-auto-rows: unset;
    gap: clamp(8.5px, 1.414vw, 18px);
  }

  .preview-area {
    width: auto;
    max-width: 100%;
    align-self: center;
    justify-self: start;
  }

  .tagline {
    font-size: clamp(18px, 2.6vw, 34px);
  }

  .footer {
    font-size: clamp(11px, 1.4vw, 13px);
    margin-top: 24px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 20px 16px 24px;
    justify-content: flex-start;
  }

  .hero {
    height: calc(100dvh - 12px);
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "title   ."
      "dots    preview"
      "tagline .";
    column-gap: 50px;
    row-gap: 25px;
  }

  .title {
    font-size: clamp(28px, 7.5vh, 48px);
    white-space: nowrap;
    align-self: start;
  }

  .dot-grid {
    height: calc(100dvh - 80px);
    width: calc(100dvh - 80px);
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    grid-auto-rows: unset;
    gap: 6px;
    justify-self: start;
    align-self: center;
  }

  .preview-area {
    grid-area: preview;
    height: calc(100dvh - 80px);
    width: auto;
    aspect-ratio: unset;
    align-self: center;
    justify-self: center;
  }

  .preview-area.active {
    transform: none;
  }

  .tagline {
    font-size: clamp(18px, 4.5vh, 28px);
    white-space: normal;
    align-self: start;
  }

  .footer {
    margin-top: 40px;
    font-size: 11px;
    line-height: 2;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 24px 20px 32px;
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "main"
      "tagline";
    row-gap: 20px;
    align-items: start;
  }

  .dot-grid {
    grid-area: main;
    justify-self: center;
    align-self: center;
    width: auto;
    height: auto;
    grid-template-columns: repeat(5, clamp(36px, 11vw, 52px));
    grid-template-rows: none;
    grid-auto-rows: clamp(36px, 11vw, 52px);
    gap: clamp(6px, 2vw, 10px);
  }

  .preview-area {
    grid-area: main;
    width: 100%;
    height: auto !important;
    z-index: 5;
  }

  .preview-img {
    width: 100%;
    height: auto;
  }

  .title {
    font-size: clamp(24px, 7.5vw, 36px);
    white-space: normal;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .tagline {
    white-space: normal;
    font-size: clamp(16px, 5vw, 26px);
    justify-self: center;
    text-align: center;
  }

  .footer {
    grid-template-columns: 1fr;
    margin-top: 36px;
    gap: 24px;
    line-height: 2;
    text-align: center;
    font-size: 12px;
  }

  .footer-contact { text-align: center; }

  .preview-close {
    display: flex;
  }
}
