/* NorthDroid — shared styles for northdroid.com
   Palette sampled from the Solitaire app icon: deep blue field, navy ink,
   card red, and the gold of the star. */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f4f7fb;
  --ink:       #16304f;
  --ink-soft:  #5a6b82;
  --line:      #dfe6f0;
  --blue:      #1565b0;
  --blue-deep: #0d3a6b;
  --red:       #d62b1f;
  --gold:      #f0b429;
  --card:      #ffffff;
  --shadow:    0 1px 2px rgba(22, 48, 79, .06), 0 8px 24px rgba(22, 48, 79, .08);
  --radius:    14px;
  --measure:   46rem;
  --wide:      64rem;
  --accent:    var(--blue);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0b1a2c;
    --bg-soft:   #102439;
    --ink:       #e8eef6;
    --ink-soft:  #9db0c8;
    --line:      #1e3550;
    --blue:      #62a8ea;
    --blue-deep: #8fc4f5;
    --red:       #ff6b5e;
    --card:      #102439;
    --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--red); }

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(22, 48, 79, .25);
}
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: .95rem;
}
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--blue); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- hero ---------- */

.hero {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(21, 101, 176, .16), transparent 65%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 4rem 0 4.5rem;
}
.hero-icon {
  width: 132px;
  height: 132px;
  border-radius: 29px;
  box-shadow: var(--shadow);
  margin-bottom: 1.75rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0 0 .75rem;
}
.hero .tagline {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: .95rem;
  font-weight: 500;
}
.badge .dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- card fan (decorative) ---------- */

.fan {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: 2.5rem 0 0;
}
.fan .pip {
  width: 3rem;
  height: 4.2rem;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(22, 48, 79, .18);
  box-shadow: 0 2px 8px rgba(22, 48, 79, .14);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #16304f;
}
.fan .pip.red { color: #d62b1f; }
.fan .pip:nth-child(1) { transform: rotate(-8deg)  translateY(4px); }
.fan .pip:nth-child(2) { transform: rotate(-3deg); }
.fan .pip:nth-child(3) { transform: rotate(3deg); }
.fan .pip:nth-child(4) { transform: rotate(8deg)  translateY(4px); }

/* ---------- sections ---------- */

section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--line); }

h2 {
  font-size: 1.4rem;
  letter-spacing: -.015em;
  margin: 0 0 1.5rem;
}
h3 { font-size: 1.05rem; margin: 0 0 .4rem; }

.lede { font-size: 1.05rem; color: var(--ink-soft); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2rem;
}
.grid p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.modes li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.modes strong { display: block; margin-bottom: .2rem; }
.modes span { color: var(--ink-soft); font-size: .92rem; }

/* ---------- document pages ---------- */

.doc { padding: 3rem 0 4rem; }
.doc h1 { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 .3rem; }
.doc h2 { font-size: 1.15rem; margin-top: 2.25rem; margin-bottom: .6rem; }
.doc .meta { color: var(--ink-soft); font-size: .9rem; margin: 0 0 2rem; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: .3rem 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: .95rem;
}
th, td {
  text-align: left;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { background: var(--bg-soft); white-space: nowrap; }

code {
  background: var(--bg-soft);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .9em;
}

.callout {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.callout p { margin: .4rem 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--blue); text-decoration: underline; }
.site-foot nav { display: flex; gap: 1.25rem; }

.wrap.wide { max-width: var(--wide); }

/* ---------- studio home ---------- */

.studio-hero { padding: 4.5rem 0 4.5rem; }
.studio-hero h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); }
.studio-hero .tagline { max-width: 36rem; }

.icon-row {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
}
.icon-row a { display: block; transition: transform .2s ease; }
.icon-row li:nth-child(odd) a  { transform: rotate(-6deg); }
.icon-row li:nth-child(even) a { transform: rotate(6deg) translateY(.5rem); }
.icon-row a:hover { transform: rotate(0) translateY(-4px); }
.icon-row img {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

/* One full-width band per game, tinted with its accent; every other one flips. */
.showcase {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0;
  background:
    radial-gradient(70% 90% at 85% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg);
  scroll-margin-top: 1rem;
}
.showcase.flip {
  background:
    radial-gradient(70% 90% at 15% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg-soft);
}
.showcase > .wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 3rem;
}
.showcase.flip .showcase-text { order: 2; }
.showcase .icon {
  width: 72px;
  height: 72px;
  border-radius: 17px;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.showcase h2 { font-size: clamp(1.8rem, 4vw, 2.3rem); margin: 0 0 .6rem; letter-spacing: -.02em; }
.showcase h2 a { color: var(--ink); text-decoration: none; }
.showcase h2 a:hover { color: var(--accent); }
.showcase .lede { margin: 0 0 1.25rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}
.chips li {
  padding: .25rem .8rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.showcase .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin: 0;
}
.showcase .more { font-weight: 600; font-size: .95rem; color: var(--accent); text-decoration: none; }
.showcase .more:hover { text-decoration: underline; }
.showcase .game-sub { margin-top: 1rem; }

/* Screenshots already include a device frame, so they're shown as-is, fanned. */
.showcase-shots {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
}
.showcase-shots img {
  width: 34%;
  max-width: 12rem;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 18px 40px rgba(22, 48, 79, .22);
  transition: transform .25s ease;
}
.showcase-shots img + img { margin-left: -6%; }
.showcase-shots img:nth-child(1) { transform: rotate(-6deg) translateY(1rem); }
.showcase-shots img:nth-child(2) { transform: scale(1.08); position: relative; z-index: 1; }
.showcase-shots img:nth-child(3) { transform: rotate(6deg) translateY(1rem); }
.showcase-shots:only-child img { transform: none; }
.showcase-shots:hover img:nth-child(1) { transform: rotate(-9deg) translate(-.75rem, 1rem); }
.showcase-shots:hover img:nth-child(3) { transform: rotate(9deg) translate(.75rem, 1rem); }

@media (max-width: 760px) {
  .showcase { padding: 3.5rem 0; }
  .showcase > .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .showcase.flip .showcase-text { order: 0; }
  .showcase-shots img { width: 36%; }
}

@media (prefers-reduced-motion: reduce) {
  .icon-row a, .showcase-shots img { transition: none; }
}

@media (prefers-color-scheme: dark) {
  /* Game accents are picked for light backgrounds; lift them for text on dark. */
  .chips li, .showcase .more, .showcase h2 a:hover { color: color-mix(in srgb, var(--accent) 55%, white); }
}

.principles-section { background: var(--bg); border-top: 1px solid var(--line); }
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2rem;
}
.principles p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- game page ---------- */

.store-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin: 0;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.store-btn:hover { color: var(--bg); background: var(--accent); }
.store-btn small { font-weight: 400; opacity: .8; }

.shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .25rem .25rem 1rem;
  margin: 0 -.25rem;
  list-style: none;
}
.shots li { flex: 0 0 auto; scroll-snap-align: start; }
.shots img {
  display: block;
  width: 13.5rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.game-sub { font-size: .9rem; color: var(--ink-soft); margin: 1.25rem 0 0; }
.game-sub a { color: var(--ink-soft); }

@media (max-width: 480px) {
  .site-nav { gap: .9rem; font-size: .9rem; }
  .shots img { width: 11rem; }
}

@media (max-width: 600px) {
  th { white-space: normal; width: 34%; }
  code { word-break: break-all; }
  .site-head .wrap { padding-top: .6rem; padding-bottom: .6rem; }
}
