/* D2 interneshnl investmient yukrein apps — shared stylesheet */

:root {
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-2: #eceef2;
  --text: #14171c;
  --muted: #5b6270;
  --border: #e1e4ea;
  --accent: #2453d6;
  --accent-hover: #1b43b3;
  --accent-contrast: #ffffff;
  --success-bg: #e8f6ee;
  --success-text: #135c34;
  --error-bg: #fdecec;
  --error-text: #8a1c1c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.05);
  --container: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --text: #e8eaee;
    --muted: #a0a7b4;
    --border: #2a2f39;
    --accent: #6d93ff;
    --accent-hover: #8eabff;
    --accent-contrast: #0b0d12;
    --success-bg: #12301f;
    --success-text: #8fe0b0;
    --error-bg: #3a1717;
    --error-text: #ffb3b3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header / navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  line-height: 1.2;
  min-width: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.brand-name {
  font-size: 0.95rem;
}

.nav-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 12px 8px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.site-nav a:hover {
  background: var(--surface);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* Without JS the menu is always visible on mobile */
.no-js .site-nav {
  display: block;
  position: static;
  border: 0;
  padding: 0 0 8px;
}

.no-js .nav-toggle {
  display: none;
}

.no-js .header-inner {
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .brand-name {
    font-size: 1rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav,
  .no-js .site-nav {
    display: block;
    position: static;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .site-nav ul {
    display: flex;
    gap: 4px;
  }

  .site-nav a {
    padding: 8px 12px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--text);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.play-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
}

.play-badge img {
  width: 180px;
  height: auto;
  /* The official badge PNG includes built-in transparent padding */
  margin: -10px -11px;
}

/* Sections */

.section {
  padding: 56px 0;
}

.section-alt {
  background: var(--surface);
}

.section-header {
  max-width: 680px;
  margin-bottom: 28px;
}

.section-header p {
  color: var(--muted);
}

@media (min-width: 768px) {
  .section {
    padding: 80px 0;
  }
}

/* Hero */

.hero {
  padding: 56px 0 48px;
}

.hero-inner > * {
  max-width: 760px;
}

.hero-intro {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

@media (min-width: 768px) {
  .hero {
    padding: 96px 0 80px;
  }
}

/* Cards */

.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.section-alt .card {
  background: var(--bg);
}

.card p {
  color: var(--muted);
}

.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  margin-bottom: 16px;
}

.card-link {
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* App cards */

.app-list {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.app-card {
  min-width: 0;
}

.app-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.app-card-head h3 {
  margin-bottom: 4px;
}

.app-card-head p {
  margin: 0;
}

.app-icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.app-icon--placeholder {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 2rem;
  font-weight: 700;
}

.app-card .play-badge {
  margin-top: 4px;
}

/* Screenshot gallery: horizontal scroll-snap on mobile, row on desktop */

.gallery {
  list-style: none;
  margin: 20px -24px 16px;
  padding: 4px 24px 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 24px;
  -webkit-overflow-scrolling: touch;
}

.gallery li {
  flex: 0 0 auto;
  width: 42%;
  max-width: 180px;
  scroll-snap-align: start;
}

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
}

.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 333 / 592;
  object-fit: cover;
}

@media (min-width: 768px) {
  .gallery {
    margin: 20px 0 16px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
  }

  .gallery li {
    width: auto;
    max-width: none;
  }
}

/* Lightbox */

.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(8, 10, 14, 0.82);
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: #ffffff;
  color: #14171c;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* About / contact details */

.about p {
  max-width: 720px;
}

.contact-details {
  font-style: normal;
}

.contact-details dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 24px;
  margin: 0;
}

.contact-details dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

.contact-details dt:first-child {
  margin-top: 0;
}

.contact-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .contact-details dl {
    grid-template-columns: max-content 1fr;
    gap: 12px 32px;
  }

  .contact-details dt {
    margin-top: 0;
  }
}

/* Forms */

.form {
  display: grid;
  gap: 18px;
  max-width: 640px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-weight: 600;
}

.form-field .req {
  color: var(--muted);
  font-weight: 400;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 48px;
}

.form textarea {
  min-height: 160px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.form-status {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0;
}

.form-status:empty {
  display: none;
}

.form-status--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.form-status--error {
  background: var(--error-bg);
  color: var(--error-text);
}

.form-status a {
  color: inherit;
  font-weight: 600;
}

.contact-layout {
  display: grid;
  gap: 40px;
}

/* Legal pages */

.page-header {
  padding: 48px 0 8px;
}

.page-header .meta {
  color: var(--muted);
}

.legal {
  max-width: 760px;
  padding-bottom: 72px;
}

.legal h2 {
  font-size: 1.35rem;
  margin-top: 2em;
}

.legal h3 {
  margin-top: 1.4em;
}

.legal ul {
  padding-left: 1.25em;
  margin: 0 0 1em;
}

.legal li {
  margin-bottom: 0.4em;
}

.legal address {
  font-style: normal;
}

/* 404 */

.not-found {
  padding: 96px 0;
  text-align: center;
}

.not-found .code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.site-footer p {
  margin: 0;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

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

.section--tight {
  padding-top: 24px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-status--info {
  background: var(--surface-2);
  color: var(--text);
}
