/* Scale Projects — dark marketing layout */

:root {
  --bg: #000;
  --text: #fff;
  --muted: #9a9292;
  --muted-2: #c8c0c0;
  --card-a: #524a4a;
  --card-b: #332f2f;
  --accent-a: #0a5347;
  --accent-b: #2bb894;
  --accent: #2bb894;
  --radius: 22px;
  --gap: 12px;
  --pad: 56px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

/* —— loader (only when JS is running and not yet ready) —— */
.loader {
  display: none;
}

html.js:not(.is-ready):not(.is-preview) .loader {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 30;
  place-items: center;
  background: #000;
}

.loader img {
  width: 48px;
  height: 48px;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .loader img { animation: none; }
  html.js:not(.is-ready):not(.is-preview) .loader { display: none; }
}

/* —— layout —— */
.shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: min(440px, 38vw);
  flex: 0 0 min(440px, 38vw);
  padding: var(--pad) 32px var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.brand {
  margin: 0 0 28px;
}

.brand__mark {
  width: 72px;
  height: 72px;
}

.sidebar h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(52px, 6.2vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-transform: lowercase;
}

.support {
  margin-top: auto;
  padding-top: 40px;
  max-width: 280px;
}

.support p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid #2a2a2a;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

@media (hover: hover) {
  .btn:hover {
    background: #242424;
    border-color: #3a3a3a;
  }
}

.btn:active { transform: translateY(1px); }

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--pad) var(--pad) var(--pad) 16px;
}

.content h2 {
  margin: 0 0 22px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* —— cards —— */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 196px;
  padding: 20px 22px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--card-a) 0%, var(--card-b) 100%);
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, filter 0.28s ease;
}

.card--accent {
  background: linear-gradient(45deg, var(--accent-a) -8%, var(--accent-b) 108%);
  min-height: 230px;
}

.card--wide { min-height: 210px; }

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card__icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.card__icon picture,
.card__icon img,
.card__emoji {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.card__arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.22);
  flex: 0 0 auto;
  transition: transform 0.28s ease, background 0.28s ease;
}

.card--accent .card__arrow {
  background: rgba(0, 0, 0, 0.18);
}

.card__arrow img {
  width: 11px;
  height: 11px;
}

.card__body { margin-top: 28px; }

.card__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.card__desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
  max-width: 52ch;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    filter: brightness(1.07);
  }
  .card:hover .card__arrow {
    transform: translate(2px, -2px);
    background: rgba(0, 0, 0, 0.32);
  }
}

.card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.support--mobile { display: none; }

/* reveal: visible without JS; brief fade only if JS is booting */
.shell { opacity: 1; }

html.js:not(.is-ready):not(.is-preview) .shell {
  opacity: 0;
  transform: translateY(8px);
}

html.js.is-ready .shell,
html.is-preview .shell {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .shell, .card, .card__arrow { transition: none; transform: none; }
  html.js:not(.is-ready):not(.is-preview) .shell { opacity: 1; }
}

/* —— responsive —— */
@media (max-width: 980px) {
  :root { --pad: 28px; }

  .shell { display: block; }

  .sidebar {
    width: auto;
    flex: none;
    height: auto;
    position: relative;
    padding: 32px 22px 12px;
  }

  .brand { margin-bottom: 20px; }

  .brand__mark { width: 56px; height: 56px; }

  .sidebar h1 {
    font-size: clamp(44px, 14vw, 72px);
  }

  .sidebar .support { display: none; }

  .content { padding: 20px 22px 32px; }

  .support--mobile {
    display: block;
    max-width: none;
    padding: 8px 22px 40px;
    margin: 0;
  }
}

@media (max-width: 620px) {
  .pair { grid-template-columns: 1fr; }

  .card,
  .card--accent,
  .card--wide { min-height: 180px; }

  .card__title { font-size: 20px; }

  .card__icon,
  .card__icon picture,
  .card__icon img,
  .card__emoji {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 1600px) {
  .shell { max-width: 1680px; margin: 0 auto; }
}
