/* SHAOLYN — shaolynskateboards.com */

:root {
  --ink: #0a0a0a;
  --ink-2: #111111;
  --paper: #f2efe9;
  --dim: #9a958c;
  --accent: #d6377e; /* brand magenta */

  /* Palette for the three tenet marks. They are the only colour on the site,
   * so they carry the brand magenta through the yin-yang and the bonsai's
   * blossom, and borrow nature's colours for everything else.
   *
   * The marks now live in assets/tenet-*.svg, loaded as background images, and
   * a background image can't read a custom property — so these values are
   * duplicated as literal fills inside those three files. This block is the
   * source of truth: re-tinting a mark means editing here AND there. */
  --mk-magenta: var(--accent);

  /* The yin-yang's two halves are equal in area, so they have to be equal in
   * weight too or the symbol reads lopsided. The brand magenta was too close
   * to the light half to separate at glyph size, so the disc is orange and
   * white instead: a full-chroma safety orange, dark enough to split cleanly
   * from the white half at the S-curve and still bright against the near-black
   * page. A paler, dustier orange sat too near white. The tai chi figure's
   * robe keeps the softer parchment (--mk-yin), which is why the disc has its
   * own light tone rather than borrowing that one. */
  --mk-yang: #ff6a00;
  --mk-yin-disc: #ffffff;
  --mk-yin: #ccc3b2;

  --mk-jade: #2f8f86;      /* the ground the stance is rooted to */
  --mk-jade-hi: #67c9b8;   /* the ball of energy held between the palms */
  --mk-moss: #3f7a41;      /* foliage in shade */
  --mk-moss-hi: #7cbb55;   /* sunlit foliage */
  --mk-clay: #c06a45;      /* bonsai pot */
  --mk-bark: #8a5a3c;      /* trunk and branches */
  --mk-skin: #c68e63;      /* the figure's head and hands */
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(to bottom, rgba(10,10,10,0.92), rgba(10,10,10,0.72) 70%, transparent);
  backdrop-filter: blur(6px);
}

.nav-brand { display: flex; align-items: center; text-decoration: none; }

/* Heights are set against the wordmark itself: the source file is cropped to
 * the letters, with none of the black padding the old jpg carried. */
.nav-logo {
  height: 32px;
  width: auto;
  mix-blend-mode: screen; /* black field melts into the dark nav */
}

.nav-links a {
  color: var(--dim);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.72rem;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 1.4rem;
  transition: color 0.25s;
}

.nav-links a:hover { color: var(--paper); }

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

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #161616 0%, var(--ink) 70%);
}

.hero-logo {
  width: min(720px, 92vw);
  mix-blend-mode: screen; /* melts the jpg's black field into the page */
}

.hero-tagline {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-style: italic;
  color: var(--dim);
  letter-spacing: 0.03em;
}

.hero-cta {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.hero-cta:hover { color: var(--accent); }

.hero-cta-line {
  width: 1px;
  height: 3.2rem;
  background: currentColor;
  animation: drop 2.4s ease-in-out infinite;
}

@keyframes drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  45%  { transform: scaleY(1); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- shared section bits ---------- */

section { padding: 6.5rem 1.5rem; max-width: 1100px; margin: 0 auto; }

.section-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  margin-bottom: 1.2rem;
}

.section-sub { color: var(--dim); font-style: italic; margin-bottom: 2.6rem; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-cta-line { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- philosophy ---------- */

.philosophy { text-align: center; }

.philosophy-lead {
  max-width: 46rem;
  margin: 0 auto 4rem;
  font-size: 1.12rem;
  color: #cfcac1;
}

.tenets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  text-align: left;
}

.tenet {
  position: relative;
  border-top: 1px solid #2a2a2a;
  padding-top: 1.6rem;
  /* The scene fills the card, so the card's height is how much of the picture
   * there is to see; without a floor the shortest copy would crop its scene to
   * a sliver. */
  min-height: 20rem;
  /* the scene is scaled to cover and is wider than the card — clip it here so
   * that reads as a crop, not as a spill into the next column or the page */
  overflow: hidden;
  isolation: isolate;
}

/* Each tenet carries a photograph of the thing it is named for rather than a
 * glyph for it — and, since this is a skate brand, of that thing as a place
 * you would skate: a polished marble floor for balance, a stair set for
 * discipline, reeds laid over by the wind for flow. They fill the card edge to
 * edge behind the words, so the card reads as one image-and-text unit rather
 * than icon, title, body.
 *
 * The photographs are CC0 / public domain, found through Openverse; that
 * licence asks for nothing, but assets/tenet-photos.txt records where each one
 * came from anyway. They are cropped square, converted to grey and pushed
 * through an S-curve before they are saved (see that file for the recipe):
 * the page is monochrome apart from one accent, and a colour cast — the marble
 * floor's green, the reeds' tan — reads as a mistake rather than as warmth.
 * The curve is there because a flat alpha over near-black compresses a
 * photograph's whole range into the bottom of the scale, so the range has to
 * be opened up first or every shot turns to mud.
 *
 * Two masks, intersected. The vertical one keeps the copy readable, and it is
 * not a cut: the picture stays faintly present behind the words and only comes
 * up to full below them. Where it ramps matters more than it looks. The copy
 * runs to a little past half the card's height, and a ramp that reached full
 * at the middle put the last two lines over a photograph at two thirds
 * strength — enough for the stair treads to cut straight through the text. So
 * it is held to about a third until 52% and only opens up after that, then
 * eases off again at the very bottom. The horizontal one takes the left and
 * right edges down to nothing. Between them the photograph never meets a card
 * edge at full strength, which is the whole difference between reading as a
 * crop onto something larger and as a rectangle pasted onto the page. */
.tenet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tenet-art) no-repeat center bottom / cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s ease, transform 1.2s cubic-bezier(0.2, 0.9, 0.25, 1);
  -webkit-mask-image:
    linear-gradient(rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.34) 52%, #000 76%, #000 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image:
    linear-gradient(rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.34) 52%, #000 76%, #000 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  pointer-events: none;
}

.tenet.in::before { opacity: 0.3; transform: none; }

.tenet[data-tenet="balance"]   { --tenet-art: url("../assets/tenet-balance.jpg"); }
.tenet[data-tenet="discipline"]{ --tenet-art: url("../assets/tenet-discipline.jpg"); }
.tenet[data-tenet="flow"]      { --tenet-art: url("../assets/tenet-flow.jpg"); }

@media (prefers-reduced-motion: reduce) {
  .tenet::before { transition: none; }
  .tenet.in::before { transform: none; }
}

.tenet h3 {
  position: relative;
  font-family: var(--display);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.tenet p { position: relative; color: var(--dim); font-size: 0.98rem; }

/* ---------- deck ---------- */

/* This one section runs wider than the site's 1100px. The deck column doubles
 * as the board's turning circle, so every pixel of width is board; at 1100 the
 * split left the copy just under its 34rem measure. 1240 gives both a full
 * share — 568px each. Drop this line to put the section back in line with the
 * rest of the page, at the cost of a smaller board. */
/* Wider than the site's 1100px, and shallower than the usual 6.5rem — the deck
 * column doubles as the board's turning circle, so this section spends its
 * height on the board rather than on padding. */
.deck {
  max-width: 1240px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Half the frame each. The deck column is also the board's turning circle (see
 * .deck3d-hero), so letting it take a full share of the width rather than a
 * fixed cap keeps the board as large as the section allows and lets it scale
 * with the viewport. minmax(0, 1fr) on the copy stops long words forcing the
 * column wider and squeezing the board. */
.deck-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.deck-viz { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }

.deck-hint {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- 3D deck (shared by The Deck section + shop card) ---------- */

.deck3d {
  position: relative;
  aspect-ratio: 480 / 1791; /* matches board.png */
  perspective: 900px;
  cursor: grab;
  touch-action: none; /* the finger flips the board, not the page */
  user-select: none;
  -webkit-user-select: none;
}

.deck3d canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.deck3d.grabbing { cursor: grabbing; }

/* Name of the trick you just landed. Sits over the board, out of the way of
 * the drag (pointer-events: none) and invisible until there's something to
 * say. */
.deck3d-trick {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translate(-50%, 6px);
  pointer-events: none;
  z-index: 2; /* the three.js canvas is appended after this and would cover it */
  font-family: var(--display);
  font-style: italic;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(10, 10, 10, 0.72);
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.deck3d-trick.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .deck3d-trick { transition: none; }
}

/* Square, not the board's own tall ratio. A shuvit turns the board in its own
 * plane, so its length sweeps through the horizontal — the box has to be as
 * wide as the board is long or a tre flip clips at the sides. Overrides the
 * aspect-ratio on .deck3d above by source order. */
.deck3d-hero {
  /* Bounded by viewport height as well as column width. The box is square, so
     width alone sets the height too — on a short screen a full-width column
     makes a box taller than the window and the section stops fitting. */
  width: min(100%, 58vh);
  aspect-ratio: 1;
}

.deck3d-spinner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.deck3d-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  pointer-events: none; /* the wrapper owns the drag */
  object-fit: contain;
}

/* griptape side (CSS fallback when three.js can't load) */
.deck3d-top {
  transform: rotateY(180deg);
  background: url("../assets/board-grip.svg") center / contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck3d-grip-mark { color: #2f2f2f; font-size: 1.5rem; line-height: 1; }

.deck-copy p { color: #cfcac1; max-width: 34rem; margin-bottom: 1.1rem; }

.deck-spec {
  font-family: var(--display);
  font-style: italic;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.deck-note { color: var(--dim); font-style: italic; font-size: 0.95rem; }

@media (max-width: 640px) {
  .deck-inner { grid-template-columns: 1fr; }
  /* Stacked: the board takes the column, capped so the square doesn't push the
     copy a whole screen down on a large phone. */
  .deck3d-hero { width: min(100%, 400px, 58vh); }
}

/* ---------- shop ---------- */

/* The buy panel lives in the deck section's copy column, beside the big board,
 * so it carries no picture of its own. */
.deck-buy { max-width: 34rem; margin: 1.6rem 0 1.2rem; }

.product {
  background: var(--ink-2);
  border: 1px solid #1f1f1f;
  padding: 1.2rem 1.3rem 1.3rem;
  transition: border-color 0.3s;
}

.product + .product { margin-top: 1rem; }

.product:hover { border-color: #333; }

.product h3 {
  font-family: var(--display);
  font-style: italic;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.product-note { color: var(--dim); font-size: 0.85rem; font-style: italic; margin-bottom: 0.9rem; }

.product-sizes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }

.size-pill {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: transparent;
  border: 1px solid #2a2a2a;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.size-pill:hover { color: var(--paper); border-color: var(--dim); }

.size-pill.on { color: var(--ink); background: var(--paper); border-color: var(--paper); }

.size-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.product-stock {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.cart-qty button[disabled] { opacity: 0.3; cursor: not-allowed; }

.product-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }

.product-price {
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
}

.btn-add,
.btn-back {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: none;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  text-decoration: none;
  display: inline-block;
}

.btn-add:hover, .btn-back:hover { background: var(--accent); color: #fff; }

/* ---------- app ---------- */

.app { text-align: center; }

.app-lead {
  max-width: 40rem;
  margin: 0 auto 2.6rem;
  font-size: 1.08rem;
  color: #cfcac1;
}

.app-stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 190px;
  padding: 0.65rem 1.3rem 0.65rem 1rem;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--accent);
  text-decoration: none;
  text-align: left;
  transition: background 0.25s, color 0.25s;
}

.store-btn:hover { background: transparent; color: var(--accent); }
.store-btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }

.store-btn svg { width: 1.7rem; height: 1.7rem; flex-shrink: 0; }

.store-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.store-btn small {
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

/* Sits beside the two store buttons and points at app/ — the same shape, but
 * outlined, so the downloads stay the loud thing in the row. */
.store-btn-ghost {
  color: var(--paper);
  background: transparent;
  border-color: #3a3a3a;
}

.store-btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

.product-approx {
  display: block;
  color: var(--dim);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 0.15rem;
}

/* ---------- success page ---------- */

.success-title {
  font-family: var(--display);
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-top: 1rem;
}

.btn-back { margin-top: 2.5rem; }

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

.footer {
  border-top: 1px solid #1e1e1e;
  text-align: center;
  padding: 5rem 1.5rem 3rem;
}

.footer-logo {
  width: min(360px, 70vw);
  margin: 0 auto 2rem;
  mix-blend-mode: screen; /* black field melts into the page */
}

.footer-line { font-style: italic; color: var(--dim); margin-bottom: 1.4rem; }

.footer-mail {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.footer-mail:hover { text-decoration: underline; }

.footer-fine { margin-top: 2.4rem; font-size: 0.78rem; color: #575349; line-height: 1.9; }
/* Inherit the fine print's grey rather than the accent: these two are
 * obligations to make findable, not places to send anyone. */
.footer-fine a { color: inherit; text-decoration: none; border-bottom: 1px solid #3a372f; }
.footer-fine a:hover { color: var(--dim); }

/* small screens: hide nav links except brand? keep, just tighten */
@media (max-width: 520px) {
  /* Keep the bar one row: logo + links + basket all had to fit, so the type
     tightens and the wordmark comes down with it rather than wrapping. */
  .nav { padding: 0.55rem 0.9rem; gap: 0.5rem; }
  .nav-logo { height: 24px; }
  .nav-links { display: flex; align-items: center; flex-wrap: nowrap; }
  .nav-links a {
    margin-left: 0.75rem;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  section { padding: 4.5rem 1.2rem; }
}

@media (max-width: 380px) {
  .nav { padding: 0.5rem 0.7rem; }
  .nav-logo { height: 22px; }
  .nav-links a { margin-left: 0.6rem; font-size: 0.55rem; }
}

/* ---- Legal pages (privacy.html, terms.html) -------------------------------
 * Long-form reading rather than the one-pager's scroll theatre: a single
 * measure-limited column, no reveal animation, and headings that step down
 * quietly so a reader can scan for the clause they came for. */
.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
}
.legal h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}
.legal .legal-date {
  color: var(--dim);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 3rem;
}
.legal h2 {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.75rem 0 0.85rem;
}
.legal h3 {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 0.5rem;
}
.legal p,
.legal li {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--paper);
}
/* The site's reset zeroes paragraph margins, which is right for the one-pager
 * and wrong here — without this the clauses run together in one slab. */
.legal p { margin: 0 0 1.15rem; }
.legal ul { padding-left: 1.2rem; margin: 0.6rem 0 1.2rem; }
.legal li { margin-bottom: 0.5rem; }
.legal a { color: var(--accent); }
.legal .legal-note {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1rem;
  color: var(--dim);
}
.legal-back {
  display: inline-block;
  margin-top: 3.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.2rem;
}
.legal-back:hover { color: var(--paper); }

@media (max-width: 640px) {
  .legal { padding: 5.5rem 1.2rem 3.5rem; }
}
