/* ==========================================================================
   DevKarakas — shared styles
   ========================================================================== */

:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #eeeef2;
  --text: #131318;
  --text-soft: #3b3b45;
  --muted: #676774;
  --line: #e3e3e9;
  --line-strong: #cdcdd6;
  --accent: #5b5bd6;
  --accent-strong: #4646c0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 91, 214, 0.10);
  --warning: #d97706;
  --store-bg: #131318;
  --store-ink: #ffffff;
  --shadow: 0 1px 2px rgba(19, 19, 24, 0.04), 0 8px 24px -12px rgba(19, 19, 24, 0.18);
  --shadow-lg: 0 2px 4px rgba(19, 19, 24, 0.04), 0 24px 48px -20px rgba(19, 19, 24, 0.28);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --surface: #141419;
    --surface-2: #1b1b22;
    --text: #eeeef3;
    --text-soft: #c9c9d3;
    --muted: #8f8f9c;
    --line: #23232c;
    --line-strong: #31313c;
    --accent: #9d9df5;
    --accent-strong: #b9b9f8;
    --accent-ink: #12123a;
    --accent-soft: rgba(157, 157, 245, 0.12);
    --warning: #f5b14c;
    --store-bg: #eeeef3;
    --store-ink: #0b0b0f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -20px rgba(0, 0, 0, 0.8);

    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  background: var(--accent-strong);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(48px, 8vw, 88px);
  scroll-margin-top: 40px;
}

.section + .section {
  padding-top: 0;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* ---------- App cards ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(22px, 4vw, 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--tint) 18%, transparent), transparent 60%);
  pointer-events: none;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tint) 40%, var(--line));
  box-shadow: var(--shadow-lg);
}

.app-card__head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-icon {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 12px 24px -10px color-mix(in srgb, var(--tint) 70%, transparent);
}

.app-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.app-card__genre {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.app-card__tagline {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.02rem;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--store-bg);
  border-radius: 14px;
  background: var(--store-bg);
  color: var(--store-ink);
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.store-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.store-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.store-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-btn__small {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.8;
}

.store-btn__big {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.store-btn.is-soon {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: default;
}

.store-btn.is-soon:hover {
  transform: none;
  opacity: 1;
}

.store-btn.is-soon svg {
  filter: grayscale(1);
  opacity: 0.55;
}

.app-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.app-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
}

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

.text-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.text-link:hover svg {
  transform: translateX(2px);
}

.lang-tag {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---------- Contact band ---------- */

.contact-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 120% at 100% 100%, var(--accent-soft), transparent 60%),
    var(--surface);
}

.contact-band__text {
  max-width: 520px;
}

.contact-band p {
  margin: 10px 0 0;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(32px, 6vw, 64px);
  padding-block: 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer p {
  margin: 0;
}

/* ==========================================================================
   Privacy policy pages
   ========================================================================== */

.policy {
  padding-block: clamp(32px, 6vw, 64px) 0;
}

.policy__inner {
  max-width: 760px;
}

.back-link {
  margin-bottom: 28px;
}

.back-link svg {
  transform: rotate(180deg);
}

.back-link:hover svg {
  transform: rotate(180deg) translateX(2px);
}

.policy-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.policy-head__app {
  display: flex;
  align-items: center;
  gap: 16px;
}

.policy-head .app-icon {
  width: 64px;
  height: 64px;
}

.policy-head__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.policy-head__stores {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

/* ---------- Prose ---------- */

.prose {
  padding-top: 36px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.prose h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.prose .policy-date {
  margin: 12px 0 32px;
  color: var(--muted);
  font-size: 0.94rem;
}

.prose h2 {
  margin: 48px 0 12px;
  padding-top: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  scroll-margin-top: 88px;
}

.prose h3 {
  margin: 28px 0 8px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}

.prose li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 22px;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.prose ol {
  margin: 0 0 20px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.prose ol > li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 40px;
  counter-increment: step;
}

.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.callout {
  margin: 0 0 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.callout--warning {
  border-left-color: var(--warning);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout__title {
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 600;
}

.table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.prose table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td:first-child {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Motion ---------- */

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .site-nav a {
    padding: 8px 10px;
  }

  .app-card__head {
    gap: 16px;
  }

  .app-icon {
    width: 76px;
    height: 76px;
  }

  .store-btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .section__head {
    flex-direction: column;
    align-items: start;
  }
}
