/* South View Studios home page (v2 layout). Loaded after studio.css on index.html only.
   Sections: compact hero with the try-now row, the directory, a 2-tile Spotlight,
   the full filterable app directory (markup generated by scripts/home-directory.py),
   the Keepers family band, and one studio section (note + principles). */

/* HERO: headline, lede and the try-now row */
.hero-v2 .hero-in { padding: 6rem 2.5rem 4rem; }
.hero-v2 .hero-lede { margin-bottom: 2.4rem; }
.hero-v2 h1.hero-line { max-width: none; }
.hero-line .nw { white-space: nowrap; }
.door-q { font-family: var(--display); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }

/* SPOTLIGHT (after the directory): two full-width tiles, RoadPlay then Anneal */
.featured { padding-top: 4.5rem; }
.featured .feat-rp { min-height: 560px; }
.featured .feat-anneal { grid-column: 1 / -1; min-height: 460px; justify-content: center; }
.featured .feat-anneal h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.featured .feat-anneal .feat-copy { max-width: 25rem; }
.featured .feat-anneal .feat-devices { right: 4rem; bottom: -170px; gap: 1rem; }
.featured .feat-anneal .dev-phone { width: 170px; }

/* DIRECTORY */
.dir { padding-top: 4rem; }
/* .section zeroes the side padding .wrap gives; restore it so cards never touch the screen edge */
.dir.wrap { padding-left: 2.5rem; padding-right: 2.5rem; }
.dir .sec-head { margin-bottom: 1.6rem; }
.dir-chips { display: none; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.2rem; position: sticky; top: 64px; z-index: 5; padding: .75rem 0; background: linear-gradient(var(--paper) 80%, transparent); }
.js .dir-chips { display: flex; }
.fchip { font: 600 .88rem/1 var(--body); color: var(--ink); background: var(--white); border: 0; border-radius: 999px; padding: .62rem 1rem; cursor: pointer; box-shadow: 0 0 0 1px var(--rule); transition: background .2s, color .2s, box-shadow .2s; }
.fchip span { font-weight: 500; color: var(--muted); margin-left: .2rem; }
.fchip:hover { box-shadow: 0 0 0 1px rgba(17,28,56,.3); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--white); box-shadow: none; }
.fchip[aria-pressed="true"] span { color: var(--gold-2); }
.fchip-plat { background: transparent; }
.fchip-plat[aria-pressed="true"] { background: var(--ink); }
.fchip:not(.fchip-plat) + .fchip-plat { margin-left: auto; }

.dir-group { padding: 1.8rem 0 2.2rem; border-top: 1px solid var(--rule); }
.dir-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: 1.2rem; }
.dir-head h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.dir-head p { color: var(--muted); font-size: .95rem; }
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
/* Filtering flattens every group into one grid */
.dir.filtering .dir-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.dir.filtering .dir-group, .dir.filtering .dir-grid { display: contents; }
.dir.filtering .dir-head { display: none; }
.dir-empty { color: var(--muted); padding: 2rem 0; }
.dir-more { margin-left: auto; font-size: .88rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.dir-more:hover { color: var(--ink); }

/* HERO: try-now row under the lede */
.try-home { max-width: 980px; margin: 0 auto; }
.try-home .try-row { grid-template-columns: repeat(4, 1fr); }
.try-all { display: inline-flex; gap: .4rem; margin-top: 1.1rem; font-size: .88rem; font-weight: 600; color: var(--gold-2); }
.try-all:hover { color: var(--white); }
.kb-more { display: inline-flex; gap: .4rem; margin-top: 1.4rem; font-weight: 600; color: var(--gold-2); }
.kb-more:hover { color: var(--white); }

.app { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem 1.1rem 1.05rem; background: var(--white); border-radius: 16px; box-shadow: 0 0 0 1px var(--rule); transition: box-shadow .25s, transform .25s var(--ease); }
.app[hidden] { display: none; }
.app:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(17,28,56,.2), 0 18px 36px -18px rgba(17,28,56,.35); }
.app .ic { width: 56px; height: 56px; border-radius: 22%; object-fit: cover; background: var(--paper-2); box-shadow: 0 0 0 1px var(--rule); transition: transform .3s var(--ease); }
.app:hover .ic { transform: scale(1.05) rotate(-3deg); }
.app h4 { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .5rem; }
.app p { font-size: .87rem; color: var(--muted); line-height: 1.45; margin-top: .2rem; }
.plat { display: block; margin-top: .5rem; font-size: .68rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); }
.plat .ver { text-transform: none; letter-spacing: .02em; }

/* KEEPERS BAND */
.keepers-band { padding: 2rem 0 5rem; }
.kb { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center; padding: 3.25rem; border-radius: 26px; background: radial-gradient(70% 90% at 100% 100%, var(--navy-2), var(--ink) 70%); color: var(--white); }
.kb .eyebrow { color: var(--gold); }
.kb h2 { font-size: var(--h2); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin-top: .8rem; max-width: 16ch; }
.kb h2 .serif { color: var(--gold-2); }
.kb-copy > p { margin-top: 1rem; color: rgba(255,255,255,.7); max-width: 32rem; }
.kb-apps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.8rem; }
.kb-apps a { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: .65rem; align-items: center; padding: .55rem .6rem; border-radius: 14px; font-size: .86rem; font-weight: 600; line-height: 1.2; transition: background .2s; }
.kb-apps a:hover { background: rgba(255,255,255,.08); }
.kb-apps img { grid-row: span 2; width: 40px; height: 40px; border-radius: 22%; object-fit: cover; }
.kb-apps span { font-size: .74rem; font-weight: 500; color: rgba(255,255,255,.5); }
.kb-copy { position: relative; z-index: 1; }
.kb-visual { position: relative; min-height: 380px; }
.kb-tv { position: absolute; top: 50%; left: 1.5rem; width: calc(100% + 4rem); transform: translateY(-50%); border-radius: 14px; background: #05070f; padding: 8px 8px 14px; box-shadow: 0 40px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.14); }
.kb-tv img { width: 100%; height: auto; border-radius: 6px; }
.kb-phone { position: absolute; left: -1rem; bottom: -5.5rem; width: 150px; aspect-ratio: 9 / 19.5; border-radius: 26px; background: #05070f; padding: 5px; transform: rotate(-6deg); box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.14); }
.kb-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 21px; }

/* STUDIO: note + principles side by side */
.studio { padding: 1rem 0 5rem; }
.studio-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.5rem; align-items: start; padding-top: 3.5rem; border-top: 1px solid var(--rule); }
.studio-note .dog { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: var(--white); box-shadow: 0 0 0 1px var(--rule), 0 10px 24px rgba(17,28,56,.12); margin-bottom: 1.4rem; }
.studio-note blockquote { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -.03em; color: var(--ink); max-width: 17ch; }
.studio-note blockquote .serif { color: var(--navy-2); }
.studio-rules { list-style: none; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.studio-rules li { padding: 1.2rem 1.2rem 1.25rem 0; border-bottom: 1px solid var(--rule); }
.studio-rules li:nth-child(even) { padding-left: 1.2rem; border-left: 1px solid var(--rule); }
.studio-rules b { display: block; font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.studio-rules span { display: block; font-size: .9rem; color: var(--muted); margin-top: .15rem; }

/* RESPONSIVE */
@media (max-width: 1080px) {
  .try-home { max-width: 640px; }
  .try-home .try-row { grid-template-columns: repeat(2, 1fr); }
  .dir-grid, .dir.filtering .dir-list { grid-template-columns: repeat(2, 1fr); }
  .kb { padding: 2.75rem; gap: 1.5rem; }
  .kb-apps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .hero-v2 .hero-in { padding: 4.5rem 1.5rem 3rem; }
  .featured { padding-top: 3.5rem; }
  .featured .feat-anneal { min-height: 520px; justify-content: flex-start; }
  .featured .feat-anneal .feat-devices { right: 1rem; bottom: -150px; }
  .featured .feat-anneal .dev-phone { width: 150px; }
  .fchip:not(.fchip-plat) + .fchip-plat { margin-left: 0; }
  .dir.wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
  .dir-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1.5rem 1.6rem; padding: .75rem 1.5rem; scrollbar-width: none; }
  .dir-chips::-webkit-scrollbar { display: none; }
  .fchip { flex: none; }
  .studio-in { grid-template-columns: 1fr; gap: 2rem; }
  .kb { grid-template-columns: 1fr; padding: 2.25rem 1.75rem 3.25rem; border-radius: 22px; }
  .kb-visual { min-height: 280px; margin-bottom: -3.25rem; }
  .kb-tv { width: auto; left: 18%; right: -3rem; top: 1rem; transform: none; }
  .kb-phone { left: 4%; bottom: -3rem; }
}
@media (max-width: 560px) {
  .hero-v2 .hero-in { padding: 4rem 1rem 2.5rem; }
  .dir.wrap { padding-left: 1rem; padding-right: 1rem; }
  .dir-chips { margin: 0 -1rem 1.4rem; padding: .75rem 1rem; }
  .dir-grid, .dir.filtering .dir-list { grid-template-columns: 1fr; gap: .6rem; }
  .app { grid-template-columns: 44px minmax(0, 1fr); gap: .8rem; padding: .75rem .85rem; align-items: center; }
  .app .ic { width: 44px; height: 44px; }
  .app h4 { font-size: .95rem; }
  .app p { font-size: .83rem; margin-top: .1rem; }
  .plat { margin-top: .3rem; font-size: .62rem; }
  .dir-group { padding: 1.4rem 0 1.6rem; }
  .dir-more { margin-left: 0; }
  .try-home { margin-top: 2rem; }
  .try-home .try-row { grid-template-columns: 1fr; gap: .5rem; }
  .kb { padding: 2rem 1.25rem 3rem; }
  .kb-apps a { font-size: .8rem; grid-template-columns: 32px 1fr; }
  .kb-apps img { width: 32px; height: 32px; }
  .kb-visual { min-height: 220px; }
  .kb-phone { width: 110px; border-radius: 20px; }
  .kb-phone img { border-radius: 16px; }
  .studio-rules { grid-template-columns: 1fr; }
  .studio-rules li, .studio-rules li:nth-child(even) { padding: 1rem 0; border-left: 0; }
}

/* External-site cue: apps that live on their own domain (MathBloom, FlashKeepers, All Our Years, Enginely) */
.app .ext { display: block; margin-top: .25rem; font-size: .68rem; color: var(--muted, #6b7280); }
.app .ext::after { content: " \2197"; }
