:root {
  /* default palette = Almond & Sky */
  --bg: #efeae0;
  --card: #ffffff;
  --ink: #232a32;
  --muted: #8a8e94;
  --rule: rgba(40, 50, 70, 0.10);
  --accent: #8aa3b8;
  --accent-soft: #cfdce6;
  --shadow: 0 1px 2px rgba(40,50,70,0.04), 0 8px 24px -12px rgba(40,50,70,0.10);
  --shadow-hover: 0 1px 2px rgba(40,50,70,0.05), 0 18px 40px -16px rgba(40,50,70,0.18);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- top bar ---------- */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 40px 80px;
}
@media (max-width: 640px) {
  .shell { padding: 24px 20px 60px; }
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}
.wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.005em;
  line-height: 1;
}
.wordmark em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.wordmark .dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 10px 6px;
  vertical-align: middle;
}

/* ---------- intro ---------- */
.intro {
  max-width: 560px;
  margin: 0 0 64px;
}
.intro .eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.intro h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  margin: 0 0 20px;
  letter-spacing: -0.015em;
}
.intro h1 em {
  font-style: italic;
  color: var(--accent);
}
.intro p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 480px;
}

/* ---------- section header ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.section-head:first-of-type { margin-top: 0; }
.section-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.005em;
}
.section-head .count {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-feature-settings: "tnum";
}

/* ---------- apps grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.app {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}
.app .thumb-wrap {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}
.app:hover .thumb-wrap {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.app .thumb {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.app .meta {
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.app .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0.005em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.app .name .arrow {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .25s, transform .25s, color .25s;
}
.app:hover .name .arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}
.app .url {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-feature-settings: "tnum";
}

/* "soon" placeholder card */
.app.soon { cursor: default; pointer-events: none; }
.app.soon .thumb-wrap {
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed var(--rule);
}
.app.soon:hover .thumb-wrap {
  transform: none;
  border-color: var(--accent);
  box-shadow: none;
}
.app.soon .thumb {
  color: var(--muted);
  font-size: 22px;
  font-weight: 300;
}
.app.soon .name { color: var(--muted); font-style: italic; }

/* ---------- thumbnail mock-screen base ---------- */
.ms {
  width: 78%;
  height: 78%;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--rule), 0 6px 18px -10px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.ms .ms-bar {
  height: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 3px;
  flex-shrink: 0;
}
.ms .ms-bar i {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--rule);
}
.ms .ms-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
  background: var(--bg);
}

.script {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
}

/* ---------- footer ---------- */
footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
footer .sig {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
}

/* ---------- palette picker ---------- */
.palette-btn {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  transition: box-shadow .2s, transform .2s, color .2s;
  box-shadow: var(--shadow);
}
.palette-btn:hover { color: var(--ink); transform: translateY(-1px); }
.palette-btn .dots {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg);
  border-radius: 999px;
}
.palette-btn .dots i {
  width: 10px; height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}

.palette-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 48px -12px rgba(40,50,70,0.18);
  z-index: 50;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.palette-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  background: transparent;
  border: none;
  font-family: inherit;
  color: var(--ink);
  width: 100%;
  text-align: left;
}
.palette-row:hover { background: var(--bg); }
.palette-row.active { background: var(--bg); }
.palette-row .name {
  flex: 1;
  font-size: 13px;
}
.palette-row .name em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
}
.palette-row .check {
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
}
.palette-row.active .check { opacity: 1; }
.palette-row .strip {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
.palette-row .strip i {
  width: 12px; height: 22px; display: block;
}

.picker-wrap { position: relative; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.grid, .intro, .section-head { animation: fadeIn .4s ease both; }
