/*
  Ballcontrol — live-site remake. Black / orange token pass.

  1. Type
     Buttons: "Noto Sans TC", weight 800 (var(--copy)).
       hero kicker 0.8rem / 700 / letter-spacing 0.18em / line-height 1 — still Syne
       buttons 1.15rem / 800 / letter-spacing 0.04em — Noto Sans TC, not Syne
     Chinese display + body: "Noto Sans TC" — unchanged.
       display: weight 700, size clamp(3rem, 8vw, 6.4rem),
                line-height 1.02, letter-spacing -0.03em
       h1 is one line 「品質與設計」, white-space nowrap; shrinks on 390
       section titles: clamp(2rem, 4vw, 3.2rem)
       body: weight 400, size 1.0625rem, line-height 1.7, letter-spacing 0.01em
       lede: weight 500, size 1.12rem, line-height 1.65
     Numbers only (.phone, .series-no): "Oswald", weights 500–700.
       Not Inter. Not the Motto draft's Big Shoulders / IBM Plex pairing.

  2. Color — black ground, orange type, vermillion buttons
     --bg:      #0a0a0a   page, header, footer, cards
     --bg-2:    #111111   alternate section bands
     --fg:      #ff8a00   visitor-facing text (titles, body, nav, captions)
     --line:    #d46212   borders, dividers, form edges (yam / dark orange)
     --accent:  #ff3d2e   button fill only
     --btn-type:#0a0a0a   dark type on vermillion buttons
     --offset:  #d46212   4px hard button shadow (yam, visible on black)
     --field:   #161616   form field backgrounds
     No cream #f6f1e8 / #ece4d6. No ink #14131a. No vermillion used as text.
     No purple-blue gradient.

  3. Layout
     Sticky header, official white wordmark left, nav + button right.
     Home landing bands (hero / promo / story) stack copy over a shared
     full-width 3:2 landscape frame. Same width, height, and aspect on
     all three shots; object-fit cover; no rotate; no special border.
     Portfolio teaser and portfolio mosaics use equal tiles
     (a consistent --tile size). Desktop shows three equal cells;
     groups with more photos slide left/right, one step at a time.
     呂明才 keeps two unstretched cells of that same size.

  4. Motion (unchanged)
     Entrance: pop-up, 620ms, cubic-bezier(0.22, 1.15, 0.32, 1), stagger 80ms.
     Scroll: clip wipe, 820ms, same easing, animation-timeline: view().
     Buttons: 160ms offset-shadow snap.
     prefers-reduced-motion kills all three.

  5. Assets
     Official white wordmark in the header (black marks stay on disk for
     favicon / archive; bytes not edited). Live-site kit photos. No Motto
     comps, no Wix stock covers, no bookings stock.
*/

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #ff8a00;
  --line: #d46212;
  --accent: #ff3d2e;
  --btn-type: #0a0a0a;
  --offset: #d46212;
  --field: #161616;
  --display: "Syne", "Noto Sans TC", sans-serif;
  --copy: "Noto Sans TC", "PingFang HK", sans-serif;
  --number: "Oswald", sans-serif;
  --pop: 620ms cubic-bezier(0.22, 1.15, 0.32, 1);
  --wipe: 820ms cubic-bezier(0.22, 1.15, 0.32, 1);
  --snap: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --tile: 22rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--copy);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.4rem 0.7rem;
  z-index: 6;
}
.skip:focus { top: 0.75rem; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0.45;
  mix-blend-mode: soft-light;
  background-image: url("./grain.png");
  background-size: 180px 180px;
}

.page { min-width: 0; overflow-x: clip; }

/* Header */
.mast {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 0.7rem 4vw 0.7rem 1.4rem;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}

.mast-mark { display: block; width: min(16.5rem, 100%); min-width: 0; }
.mast-mark img { width: 100%; height: auto; display: block; }

.mast-end {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav {
  display: flex;
  gap: 1.1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { box-shadow: inset 0 -0.35em 0 var(--fg); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--btn-type);
  text-decoration: none;
  font-family: var(--copy);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.9rem 1.05rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--offset);
  cursor: pointer;
  transition: transform var(--snap), box-shadow var(--snap);
}
.btn:hover,
.btn:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--offset);
}
.btn-large { font-size: 1.35rem; padding: 1.05rem 1.2rem 0.9rem; }

/* Landing bands — copy stacked over a shared 3:2 landscape frame */
.landing {
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid var(--line);
  overflow-x: clip;
  min-height: 0;
}

.hero-copy,
.promo-copy,
.story-copy {
  padding: 4.2rem 4vw 2.8rem 1.6rem;
}

.kicker {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.display {
  margin: 0;
  font-family: var(--copy);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
h1.display {
  white-space: nowrap;
  font-size: clamp(2.2rem, 11.5vw, 6.4rem);
}

.lede {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.65;
}

.hero-actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }

.hero-shot,
.promo-shot,
.story-shot {
  margin: 0;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--bg);
  border: 0;
  transform: none;
}
.hero-shot img,
.promo-shot img,
.story-shot img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
}
.hero-shot img { object-position: 50% 35%; }
.promo-shot img { object-position: 45% 40%; }
.story-shot img { object-position: 50% 40%; }

/* Sections */
.band {
  padding: 4.4rem 4vw 4.4rem 1.6rem;
  border-bottom: 2px solid var(--line);
  overflow-x: clip;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--copy);
  font-weight: 700;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.sec-head p { margin: 0.4rem 0 0; max-width: 36rem; }

.promo-copy .display {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}
.promo-copy .lede { margin-top: 1rem; }

.story-copy .btn { margin-top: 1.4rem; }

/* Portfolio teaser */
.tease {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2rem;
  align-items: stretch;
}
.tease a {
  text-decoration: none;
  display: grid;
  background: var(--bg-2);
  border: 2px solid var(--line);
  overflow: hidden;
}
.tease figure { margin: 0; overflow: hidden; }
.tease img {
  width: 100%;
  height: var(--tile);
  object-fit: cover;
}
.tease a:first-child img { object-position: 60% 22%; }
.tease a:nth-child(2) img { object-position: 52% 30%; }
.tease a:nth-child(3) img { object-position: 58% 38%; }
.tease figcaption {
  padding: 0.7rem 0.8rem 0.85rem;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--bg);
  border-top: 2px solid var(--line);
}
.tease em {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
}

/* Instagram */
.ig-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(14rem, 0.7fr);
  gap: 2rem 3rem;
  align-items: start;
}
.phone {
  display: block;
  font-family: var(--number);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.phone-second { margin-top: 1rem; font-size: clamp(1.5rem, 3vw, 2.3rem); }
.phone-note { margin: 0.3rem 0 0; }
.mail { display: inline-block; margin-top: 0.9rem; font-weight: 500; }
address { font-style: normal; line-height: 1.6; padding-top: 0.3rem; }

.ask {
  margin-top: 2.4rem;
  max-width: 38rem;
  display: grid;
  gap: 0.85rem;
}
.ask-lead { margin: 0; }
.ask label {
  display: grid;
  gap: 0.25rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}
.ask input,
.ask textarea {
  font: inherit;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--fg);
  background: var(--field);
  caret-color: var(--fg);
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 0.45rem 0.5rem;
  width: 100%;
}
.ask input::placeholder,
.ask textarea::placeholder {
  color: rgba(255, 138, 0, 0.75);
  opacity: 1;
}
.ask input:-webkit-autofill,
.ask textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  box-shadow: 0 0 0 1000px var(--field) inset;
  transition: background-color 9999s ease-out;
}
.ask textarea {
  resize: vertical;
  border: 2px solid var(--line);
  padding: 0.6rem;
  background: var(--field);
}
.form-error { margin: 0; font-weight: 500; }
.ask .btn { justify-self: start; }

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  padding: 1.1rem 4vw 2rem 1.6rem;
  font-size: 0.92rem;
  border-top: 2px solid var(--line);
}
.colophon p { margin: 0; }

/* Portfolio page */
.folio-intro {
  max-width: 38rem;
  padding-top: 1.2rem;
}

.series {
  padding: 4rem 4vw 4.2rem 1.6rem;
  border-bottom: 2px solid var(--line);
  overflow-x: clip;
}
.series:nth-child(even) { background: var(--bg-2); }

.series-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.4rem 1.1rem;
  align-items: baseline;
  margin-bottom: 1.6rem;
}
.series-no {
  font-family: var(--number);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: 0.04em;
  line-height: 0.8;
}
.series-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 700; letter-spacing: -0.03em; }
.series-head p { margin: 0.35rem 0 0; max-width: 36rem; }

.mosaic {
  display: grid;
  gap: 0.7rem;
}
.mosaic figure { margin: 0; overflow: hidden; background: var(--bg); border: 2px solid var(--line); height: 100%; min-height: 0; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mosaic-scaa,
.mosaic-gm-match,
.mosaic-gm,
.mosaic-lmc {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: none;
  align-items: stretch;
}
.rail + .mosaic { margin-top: 0.85rem; }

.rail {
  min-width: 0;
  outline: none;
}
.rail:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}
.rail-viewport {
  overflow: hidden;
  min-width: 0;
  touch-action: pan-y;
}
.rail [data-track] {
  --rail-i: 0;
  --rail-gap: 0.7rem;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--rail-gap)) / 3);
  gap: var(--rail-gap);
  transform: translateX(calc(var(--rail-i) * (100% + var(--rail-gap)) / -3));
  transition: transform 420ms cubic-bezier(0.22, 1.15, 0.32, 1);
}
.rail-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 0.85rem;
  margin-top: 0.85rem;
}
.rail-btn {
  font-family: var(--copy);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0.9rem 0.6rem;
  box-shadow: 3px 3px 0 var(--offset);
  cursor: pointer;
  transition: transform var(--snap), box-shadow var(--snap);
}
.rail-btn:hover,
.rail-btn:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--offset);
}
.rail-btn:disabled {
  opacity: 0.38;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.rail-status {
  margin: 0;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* Compact Instagram rail — not the Portfolio --tile 22rem 3-up mosaic */
.rail.ig-rail [data-track] {
  --ig-visible: 6;
  --rail-gap: 0.45rem;
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--ig-visible) - 1) * var(--rail-gap)) / var(--ig-visible));
  gap: var(--rail-gap);
  transform: translateX(calc(-1 * var(--rail-i) * (100% + var(--rail-gap)) / var(--ig-visible)));
}
.ig-rail figure {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
  border: 2px solid var(--line);
}
.ig-rail a { display: block; height: 100%; }
.ig-rail img {
  width: 100%;
  height: 11rem;
  object-fit: cover;
  display: block;
}

.mosaic-scaa img,
.mosaic-gm-match img,
.mosaic-gm img,
.mosaic-lmc img {
  height: var(--tile);
  min-height: 0;
}
.mosaic-scaa .lead img { object-position: 60% 22%; }
.mosaic-scaa .pair img { object-position: 50% 40%; }
.mosaic-scaa .navy img { object-position: 50% 40%; }
.mosaic-scaa .white img { object-position: 50% 40%; }
.mosaic-gm-match .cele img { object-position: 52% 30%; }
.mosaic-gm-match .port img { object-position: 58% 28%; }
.mosaic-gm-match .atk img { object-position: 42% 30%; }
.mosaic-gm-match .blk img { object-position: 48% 25%; }
.mosaic-gm-match .dig img { object-position: center bottom; }
.mosaic-gm .front img { object-position: 50% 35%; }
.mosaic-gm .back img { object-position: 50% 40%; }
.mosaic-lmc .front img { object-position: 50% 38%; }
.mosaic-lmc .back img { object-position: 50% 42%; }
.mosaic-lmc .qesosass img,
.mosaic-lmc .cheng img,
.mosaic-lmc .elegantia img,
.mosaic-lmc .plktytc img { object-position: 50% 35%; }
.mosaic-lmc .twgss img { object-position: 50% 50%; }

.page-hero {
  padding: 3.4rem 4vw 2.4rem 1.6rem;
  border-bottom: 2px solid var(--line);
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .pop { animation: pop-up var(--pop) both; }
  .wipe {
    animation: wipe var(--wipe) both;
    animation-timeline: view();
    animation-range: entry 0% cover 38%;
  }
}

@keyframes pop-up {
  from { opacity: 0; transform: translateY(24px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes wipe {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pop, .wipe { animation: none; }
  .btn, .rail-btn { transition: none; }
  .rail [data-track] { transition: none; }
}

@media (max-width: 860px) {
  .mast {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.8rem;
    padding: 0.55rem 1rem 0.6rem;
  }
  .mast-mark {
    width: min(13.5rem, calc(100% - 8.8rem));
    min-width: 0;
    flex: 1 1 auto;
  }
  .mast-end { display: contents; }
  .mast-end .btn {
    order: 2;
    flex: 0 0 auto;
    font-size: 0.95rem;
    padding: 0.62rem 0.72rem 0.52rem;
    box-shadow: 3px 3px 0 var(--offset);
  }
  .nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    gap: 1rem;
    font-size: 0.82rem;
    padding-top: 0.15rem;
  }
  .hero, .promo, .story, .tease, .contact-grid, .series-head {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .hero-copy, .promo-copy, .story-copy, .band, .series, .page-hero, .colophon {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-copy, .promo-copy, .story-copy {
    padding-top: 2.2rem;
    padding-bottom: 1.6rem;
  }
  .tease a:nth-child(2), .mosaic-gm .back, .mosaic-lmc .front { margin: 0; }
  .tease img, .tease a:first-child img, .tease a:nth-child(2) img, .tease a:nth-child(3) img {
    height: 16rem;
  }
  .mosaic-scaa .lead,
  .mosaic-scaa .pair,
  .mosaic-gm-match .cele { grid-column: auto; grid-row: auto; }
  .mosaic-scaa img,
  .mosaic-gm-match img,
  .mosaic-gm img,
  .mosaic-lmc img {
    height: 12rem;
    min-height: 0;
  }
  .mosaic-gm-match .dig img { object-position: center bottom; }
  .rail-btn { padding: 0.75rem 0.85rem 0.65rem; min-height: 2.75rem; }
  .ig-head { flex-direction: column; align-items: flex-start; }
  .ig-head .btn {
    font-size: 0.95rem;
    padding: 0.7rem 0.8rem 0.58rem;
    max-width: 100%;
  }
  .rail.ig-rail [data-track] { --ig-visible: 3; }
  .details { grid-template-columns: 1fr; }
  .details figure:nth-child(2) { margin-top: 0; }
  .details img { height: 12rem; }
}

