/* Shop, blog, snake and projects pages load style.css first (window, title, button, page layout); this file only adds their parts. */
.shop-window { height: auto; padding-block: 36px; }
/* z-index: auto so product photos can blend into the window background. */
.shop-content { z-index: auto; grid-template-rows: none; row-gap: 24px; text-transform: lowercase; }

.products { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.product { min-width: 0; display: grid; justify-items: center; gap: 10px; color: #eee; font-size: 13px; text-align: center; text-decoration: none; }
.product h2 { margin: 0; font-size: inherit; }
.price { color: #999; font-weight: 700; }

/* Photos have black backgrounds; lighten melts the black into the window so they float like the main page's gif. */
.product-art { display: block; width: 100%; aspect-ratio: 1; }
.product-art img { width: 100%; height: 100%; display: block; object-fit: cover; mix-blend-mode: lighten; }
.product:hover h2, .product:focus-visible h2 { color: var(--accent); }
.product:focus-visible { outline: 1px dashed var(--accent); outline-offset: 5px; }

.swatches { display: flex; gap: 8px; }
.swatch { width: 16px; height: 16px; padding: 0; border: 1px solid #777; border-radius: 50%; background: #111; cursor: pointer; }
.swatch.blue { background: #3333aa; }
.swatch.white { background: #eee; }
.swatch.is-selected { outline: 1px solid var(--accent); outline-offset: 3px; }
.swatch:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

.buy-button { font-family: inherit; font-size: 14px; letter-spacing: -.04em; cursor: pointer; }

/* Blog: every post shown in full, separated by a hairline. */
.posts { width: 100%; display: grid; gap: 28px; text-align: left; text-transform: none; }
.post { display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid #3a3a3a; }
.post header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.post h2 { margin: 0; color: #eee; font-size: 13px; text-transform: lowercase; }
.post time { flex: none; color: #999; font-size: 13px; font-weight: 700; }
.post p { margin: 0; color: #ccc; font-size: 13px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.posts-note { margin: 0; color: #999; font-size: 13px; font-weight: 700; }

/* Stars: one masked bar filled to --fill. Grey shows the average, yellow previews your pick. */
.rating { display: flex; align-items: center; gap: 12px; }
.rating[hidden] { display: none; }
.rating-stars { position: relative; width: 120px; height: 24px; }
.stars {
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.8 12 8.05 17.61 8.33 13.23 11.85 14.7 17.27 10 14.2 5.3 17.27 6.77 11.85 2.39 8.33 8 8.05Z'/%3E%3C/svg%3E");
  --fill: 0%;
  height: 100%;
  background: linear-gradient(90deg, #bbb var(--fill), #444 var(--fill));
  -webkit-mask: var(--star) 0 0 / 24px 24px repeat-x;
  mask: var(--star) 0 0 / 24px 24px repeat-x;
}
.previewing .stars { background: linear-gradient(90deg, var(--accent) var(--fill), #444 var(--fill)); }
.rating-input button { position: absolute; top: 0; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.rating-input button:focus-visible { outline: 1px dashed var(--accent); outline-offset: 2px; }
.rating-value { color: #999; font-size: 13px; font-weight: 700; }

/* Snake: the board sits where the main page's gif does, framed like the email button.
   The canvas is pinned inside the box so its pixel size can't push the layout wider
   (Safari let it, and the board grew on every frame until it went blank). */
.snake-board { position: relative; width: 100%; aspect-ratio: 1; border: 1px solid #777; background: radial-gradient(rgba(255, 255, 255, .045) .5px, transparent .5px) 0 0 / 3px 3px #1b1b1b; box-shadow: 3px 3px 0 #000; transition: border-color .5s; }
.snake-board.hit { border-color: var(--accent); transition: none; } /* one flash on a crash */
.snake-board canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; -webkit-tap-highlight-color: transparent; }
.snake-status { margin: 0; color: #999; font-size: 13px; font-weight: 700; transition: color .35s; }
.snake-status.lit { color: var(--accent); transition: none; } /* blinks on every bite */
html.playing, html.playing body { touch-action: none; overscroll-behavior: none; } /* while a game runs: swipes steer, never scroll */

/* Projects: /projects lists them; /projects?p=<slug> is one project, laid out like an app's page in the Mac App Store. */
.apps { width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.apps li { display: flex; align-items: center; gap: 16px; padding-top: 16px; border-top: 1px solid #3a3a3a; }
.apps li + li { margin-top: 16px; }
.app-link { min-width: 0; flex: 1; display: flex; align-items: center; gap: 16px; color: #eee; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.app-link:hover strong, .app-link:focus-visible strong { color: var(--accent); }
.app-link:focus-visible { outline: 1px dashed var(--accent); outline-offset: 5px; }
.app-text { min-width: 0; display: grid; gap: 4px; font-size: 13px; }
.app-text strong, .app-text span { overflow-wrap: anywhere; }
.app-text span { color: #999; }

/* Icons keep their own shape (a Mac icon brings its rounded square); the hard shadow follows whatever shape it is. */
.app-icon { flex: none; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(3px 3px 0 #000); }
.app-icon.blank { display: grid; place-items: center; border: 1px solid #777; background: #1b1b1b; color: #eee; font-size: 24px; font-weight: 700; }
.get-button { width: auto; min-width: 80px; min-height: 0; flex: none; padding: 8px 18px; font-family: inherit; font-size: 14px; letter-spacing: .06em; }
.soon, .soon:hover, .soon:active { border-color: #555; background: #1b1b1b; color: #999; box-shadow: none; transform: none; cursor: default; } /* the button's place, not a button */

.project-window { width: min(720px, calc(100vw - 32px)); }
.project-window .shop-content { width: 100%; }
.project { justify-items: stretch; row-gap: 32px; text-align: left; }
.lockup { display: flex; align-items: center; gap: 28px; }
.lockup .app-icon { width: 128px; height: 128px; font-size: 52px; }
.lockup-text { min-width: 0; display: grid; justify-items: start; gap: 8px; }
.lockup .eyebrow { font-size: 24px; overflow-wrap: anywhere; }
.subtitle { margin: 0; color: #999; font-size: 13px; font-weight: 700; }
.get-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.get-note { color: #999; font-size: 12px; font-weight: 700; letter-spacing: .06em; }

/* The App Store's strip of facts: label, big value, caption, split by hairlines. */
.strip { display: flex; margin: 0; padding: 16px 0; border-block: 1px solid #3a3a3a; }
.strip div { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 6px; padding-inline: 8px; text-align: center; }
.strip div + div { border-left: 1px solid #3a3a3a; }
.strip dt, .strip dd span { color: #999; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.strip dd { display: grid; justify-items: center; gap: 4px; margin: 0; }
.strip strong { color: #eee; font-size: 20px; line-height: 1.1; hyphens: auto; overflow-wrap: break-word; }

/* Screenshots sit in the same frame as the buttons and the snake board; the next one peeks in from the right. */
.shots-box { position: relative; }
.shots { display: flex; gap: 16px; padding: 0 4px 14px 0; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.shots:focus-visible { outline: 1px dashed var(--accent); outline-offset: 5px; }
.shots img { flex: none; width: auto; max-width: 85%; height: min(320px, (100vw - 72px) * .47); object-fit: contain; scroll-snap-align: start; border: 1px solid #777; background: #1b1b1b; box-shadow: 3px 3px 0 #000; }
.shots img.tall { height: min(440px, 100vw); } /* phone-shaped shots stay readable on a phone */
.shots-box button { position: absolute; top: calc(50% - 7px); translate: 0 -50%; width: 36px; height: 36px; padding: 0; border: 1px solid #777; background: #1b1b1b; color: #eee; font: inherit; font-size: 14px; font-weight: 700; box-shadow: 3px 3px 0 #000; cursor: pointer; }
.shots-box .prev { left: 10px; }
.shots-box .next { right: 14px; }
.shots-box button:hover, .shots-box button:focus-visible { border-color: var(--accent); }
.shots-box button:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }
.shots-box button:active { box-shadow: none; transform: translate(2px, 2px); }
@media (hover: none) { .shots-box button { display: none; } }

.about, .news, .info { display: grid; gap: 14px; }
.about p, .news p { max-width: 70ch; margin: 0; color: #ccc; font-size: 13px; line-height: 1.6; text-transform: none; white-space: pre-line; overflow-wrap: anywhere; }
.project h2 { margin: 0; color: #eee; font-size: 14px; letter-spacing: .06em; }
.news-meta { display: flex; justify-content: space-between; gap: 16px; color: #999; font-size: 13px; font-weight: 700; }
.info dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 24px; margin: 0; }
.info dt { color: #999; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.info dd { margin: 4px 0 0; color: #ccc; font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .project { row-gap: 28px; }
  .lockup { align-items: start; gap: 18px; }
  .lockup .app-icon { width: 88px; height: 88px; font-size: 36px; }
  .lockup .eyebrow { font-size: 18px; letter-spacing: .12em; }
  .strip { display: grid; grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .strip div + div { border-left: 0; }
  .strip div:nth-child(even) { border-left: 1px solid #3a3a3a; }
  .strip div:last-child:nth-child(odd) { grid-column: 1 / -1; } /* a lone last fact centres under the pair */
  .strip strong { font-size: 16px; }
  .info dl { grid-template-columns: 1fr 1fr; }
}

/* The site's one arrow, drawn in the colour of whatever it sits in; the "next" button flips it. */
.back::before, .shots-box button::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin-inline: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M15 8H3M8 2 2 8l6 6' fill='none' stroke='%23000' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M15 8H3M8 2 2 8l6 6' fill='none' stroke='%23000' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.shots-box .next::before { scale: -1 1; }
.back { display: inline-flex; align-items: center; gap: 8px; }

/* Mirrors the clock under the main page's window; also holds the snake's sound switches. */
.shop-nav { display: flex; gap: 28px; }
.shop-nav a, .shop-nav button { padding: 0; border: 0; background: none; color: #aaa; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shop-nav a:hover, .shop-nav a:focus-visible, .shop-nav button:hover, .shop-nav button:focus-visible { color: var(--accent); }
.shop-nav a:focus-visible, .shop-nav button:focus-visible { outline: 1px dashed var(--accent); outline-offset: 5px; }
