/* Home Field ScorebooK — 2026 rebuild
   Modern, dependency-free. Preserves the original layout & palette. */

:root {
  /* ---- per-site theme: defaults here, overridden by the inline <style> the build injects ---- */
  --theme-color: #476e6b;                 /* main feature-section background */
  --theme-text: #c2cdd6;                  /* body text on the theme color */

  --ink: #222;
  --heading: #f3f8fc;
  --footer-bg: #363d42;
  --footer-link: #aabdcd;
  --footer-link-hover: #fbfdff;
  --accent: #007aff;
  --maxw: 1026px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  font-synthesis: none;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* allow the hand frame to bleed off-edge on large screens */
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(92%, var(--maxw)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: #fff; color: #000; padding: .6em 1em; border-radius: 8px; z-index: 100;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; }

/* ============================ HEADER ============================ */
.header {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6), 0 0 16px rgba(0, 0, 0, .3);
  background-color: #2c3a39;
  /* light wash only — keeps the original photo brightness while staying legible */
  /* default; the build injects a per-site .header override with the themed image */
  background-image:
    linear-gradient(rgba(10, 18, 16, .09), rgba(10, 18, 16, .19)),
    url(../img/field-bg.webp);
  background-size: cover;
  background-position: center;
  padding-bottom: clamp(40px, 8vw, 90px);
}
/* fixed parallax only where it performs well (desktop, real pointer) */
@media (min-width: 1070px) and (hover: hover) and (pointer: fine) {
  .header { background-attachment: fixed; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  /* full width with modest side padding so the wordmark/language sit near the edges on wide screens */
  padding: env(safe-area-inset-top, 0) clamp(24px, 3vw, 48px) 0;
  min-height: 64px;
}
.wordmark { font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; color: #fff; white-space: nowrap; }
.wordmark__sep { font-weight: 400; opacity: .5; margin: 0 .04em; }

/* ---- language menu ---- */
.langmenu { position: relative; }
.langmenu summary {
  display: inline-flex; align-items: center; gap: .45em;
  list-style: none; cursor: pointer; user-select: none;
  padding: .45em .8em; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .92rem; font-weight: 600; color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: background .2s var(--ease);
}
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover { background: rgba(255, 255, 255, .24); }
.langmenu .globe { opacity: .9; }
.langmenu ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  margin: 0; padding: 6px; list-style: none; min-width: 160px;
  background: rgba(28, 34, 33, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  text-shadow: none;
}
.langmenu li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6em .8em; border-radius: 8px; color: #eef3f3; font-weight: 500;
  transition: background .15s var(--ease);
}
.langmenu li a:hover { background: rgba(255, 255, 255, .12); }
.langmenu li a[aria-current="true"] { color: #fff; font-weight: 700; }
.langmenu li a[aria-current="true"]::after { content: "✓"; color: var(--accent); }

/* ---- hero ---- */
.hero {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(28px, 5vw, 56px); padding-top: clamp(24px, 5vw, 48px);
  text-align: center;
}
.hero__copy { max-width: 36rem; }
/* app icon above the title — follows the copy's text-align (centered on mobile, left on desktop) */
.hero__logo { display: inline-block; margin: 0 0 16px; }
.hero__logo img { width: 58px; height: 58px; display: block; }
.hero__title { margin: 0; font-size: clamp(1.6rem, 7.6vw, 2.9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; }
.hero__subtitle { display: block; font-size: .42em; font-weight: 400; letter-spacing: 0; margin-top: .4em; opacity: .95; }
.hero__tagline { font-size: clamp(1.1rem, 3.4vw, 1.4rem); font-weight: 400; margin: .8em 0 1em; }
.hero__intro { font-size: 1rem; line-height: 1.7; margin: 0 auto 1.6em; opacity: .96; }
.appstore { display: inline-block; margin-top: 1.4em; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.appstore__badge { height: 52px; width: auto; } /* official Apple badge (localized SVG) */
.appstore:hover { opacity: .82; transform: translateY(-1px); }

/* ---- device frame (PNG overlay; slider shows through the transparent screen cutout) ---- */
.hero__device { display: flex; justify-content: center; }
.device {
  position: relative;
  width: min(74vw, 300px);
  aspect-ratio: 322 / 639;          /* no-hand frame ratio (default / narrow) */
  margin: 0 auto;
}
.device__screen {
  position: absolute;               /* no-hand screen cutout */
  left: 6.69%; top: 2.98%; width: 86.78%; height: 93.97%;
  overflow: hidden; background: #000; border-radius: 8% / 4%;
}
.device__frame { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.device__frame img { width: 100%; height: 100%; }
.device__frame--hand { display: none; }   /* hand frame appears at wider widths */

/* ---- generic scroll-snap slider ---- */
.slider {
  display: flex; margin: 0; padding: 0; list-style: none;
  height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.slider::-webkit-scrollbar { display: none; }
.slider > li { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.device__screen .slider > li img { width: 100%; height: 100%; object-fit: cover; }

/* ---- dots ---- */
.dots { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(4, 4, 4, .35); cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.dots--light button { background: rgba(255, 255, 255, .3); }
.dots button[aria-selected="true"] { background: var(--accent); transform: scale(1.15); }
.dots--light button[aria-selected="true"] { background: #f3f8fc; }

/* screenshot pagination overlaid on the screen, as capsules where the iOS home bar sits */
.dots--screen {
  position: absolute; left: 0; right: 0; bottom: 0.6%;
  z-index: 3; gap: 5px; flex-wrap: nowrap; pointer-events: auto;
}
.dots--screen button {
  width: 12px; height: 3px; border-radius: 20px;
  background: #000; transform: none;   /* on a light screenshot */
}
.dots--screen.dots--on-dark button { background: #fff; }   /* on a dark screenshot (set per active slide) */
.dots--screen button[aria-selected="true"],
.dots--screen.dots--on-dark button[aria-selected="true"] { background: var(--accent); }   /* active stays blue in both */

/* ============================ MAIN ============================ */
.features-bg { background: var(--theme-color); color: var(--theme-text); padding: clamp(48px, 8vw, 80px) 0 clamp(56px, 9vw, 100px); }

.quotebox { text-align: center; max-width: 40rem; margin: 0 auto clamp(40px, 7vw, 70px); }
.quotes { overflow-x: auto; }
.quotes > li {
  display: flex; align-items: center; justify-content: center;
  padding: 0 1em .4em; min-height: 5.5em;
  font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 200; line-height: 1.45; color: #fff;
}
.quote__text { margin: 0; }
/* quote marks flow inline with the text, hugging the first/last line on multi-line quotes */
.quote__text::before { content: "\201C\00A0"; }
.quote__text::after { content: "\00A0\201D"; }
/* Japanese uses full-width corner brackets (no extra spacing needed) */
[lang="ja"] .quote__text::before { content: "\300C"; }
[lang="ja"] .quote__text::after { content: "\300D"; }
.quotebox .dots { margin-top: 22px; }

.features { display: grid; gap: clamp(28px, 5vw, 44px); }
.feature { border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 1.2em; }
/* Helvetica/Arial give the square period of the original (system SF has a round one) */
.feature__n { font-family: Helvetica, Arial, sans-serif; font-size: clamp(3.2rem, 9vw, 5.2rem); line-height: 1; font-weight: 800; color: rgba(0, 0, 0, .22); margin: 0 0 .1em; }
.feature__n::after { content: "."; }
.feature h3 { color: var(--heading); font-size: 1.4rem; margin: 0 0 .5em; }
.feature p { margin: 0; line-height: 1.7; }

@media (min-width: 760px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* ============================ FOOTER ============================ */
/* footer is intentionally ~1.5x its content height, with content in the top portion */
.footer {
  background: var(--footer-bg); color: #fff; font-size: .9rem;
  padding-top: 44px;
  padding-bottom: calc(clamp(56px, 9vw, 110px) + env(safe-area-inset-bottom, 0));
}
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; opacity: .92; }
.footer__icon img { width: 28px; height: 28px; display: block; }
.footer__name { font-weight: 700; font-size: 1.05rem; color: #fff; }
.footer__links { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; }
.footer__links a { color: var(--footer-link); font-weight: 600; transition: color .2s var(--ease); }
.footer__links a:hover { color: var(--footer-link-hover); }

@media (min-width: 760px) {
  .footer__inner { flex-direction: row; justify-content: space-between; }
}

/* ============================ DEVICE FRAME — RESPONSIVE STAGES ============================ */

/* Stage 3: hand frame, stacked below the text, whole image centered (phone sits right-of-centre) */
@media (min-width: 640px) {
  .header { padding-bottom: 0; }                  /* pin the hand-frame bottom to the quote section (item 4) */
  .device {
    width: min(86vw, 540px);
    aspect-ratio: 691 / 782;                      /* hand frame ratio */
  }
  .device__screen {                               /* hand screen cutout */
    left: 48.91%; top: 2.43%; width: 40.38%; height: 76.73%;
    border-radius: 7% / 3.1%;
  }
  .device__frame--nohand { display: none; }
  .device__frame--hand { display: block; }
}

/* Stages 1–2: two columns — hand frame left (bleeding off the edge), text right */
@media (min-width: 1024px) {
  .hero {
    flex-direction: row-reverse; text-align: start;
    align-items: flex-end; justify-content: space-between;
    padding-top: clamp(64px, 7vw, 116px);
  }
  /* centre the copy on the phone SCREEN, not the full frame: the hand extends ~18% below the
     screen, so an equal bottom padding lifts the centred content up onto the screenshots */
  .hero__copy { flex: 1 1 50%; max-width: none; align-self: center; padding-bottom: clamp(60px, 6.2vw, 96px); }
  .hero__intro { margin-inline: 0; }
  .hero__device { flex: 0 0 auto; align-self: flex-end; }   /* bottom-pinned (item 4) */
  .device {
    width: clamp(440px, 42vw, 560px);
    margin: 0;
    margin-left: clamp(-120px, -7vw, -40px);      /* hand bleeds off the left edge */
  }
}

/* ============================ LANGUAGE OFFER BANNER ============================ */
.lang-offer {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%);
  display: flex; align-items: center; gap: 14px; z-index: 200;
  width: min(94%, 560px); padding: 12px 14px 12px 18px;
  background: rgba(28, 34, 33, .97); color: #fff; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4);
  transition: transform .35s var(--ease); font-size: .95rem;
}
.lang-offer.show { transform: translateX(-50%) translateY(0); }
.lang-offer span { flex: 1; }
.lang-offer button { border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: .55em 1em; border-radius: 999px; }
.lang-offer .accept { background: var(--accent); color: #fff; }
.lang-offer .dismiss { background: rgba(255, 255, 255, .14); color: #fff; }

/* ============================ MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
