/* =========================================================
   TORECA BALL THAILAND — corporate site styles
   ========================================================= */
:root {
  color-scheme: light;
  --red: #E0102F;
  --red-dark: #B80C26;
  --blue: #0A4A9C;
  --blue-dark: #083B7D;
  --navy: #0B1A3E;
  --navy-2: #13275A;
  --ink: #18213A;
  --muted: #4F5A70;
  --line: #E1E6EF;
  --bg: #FFFFFF;
  --bg-alt: #F4F6FB;
  --white: #FFFFFF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 26, 62, .06), 0 8px 24px rgba(11, 26, 62, .07);
  --shadow-lg: 0 2px 4px rgba(11, 26, 62, .06), 0 20px 48px rgba(11, 26, 62, .14);
  --header-h: 68px;
  --container: 1160px;
  --gutter: 20px;
  /* Thai flag: red / white / blue (double) / white / red  = 1:1:2:1:1 */
  --flag: linear-gradient(to bottom,
      var(--red) 0 16.66%, #fff 16.66% 33.33%, var(--blue) 33.33% 66.66%,
      #fff 66.66% 83.33%, var(--red) 83.33% 100%);
  --flag-h: linear-gradient(to right,
      var(--red) 0 16.66%, #fff 16.66% 33.33%, var(--blue) 33.33% 66.66%,
      #fff 66.66% 83.33%, var(--red) 83.33% 100%);
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-th: "Noto Sans Thai", "Inter", "Leelawadee UI", Tahoma, sans-serif;
  --font-ja: "Noto Sans JP", "Inter", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font: var(--font-en);
}
html[lang="th"] { --font: var(--font-th); }
html[lang="ja"] { --font: var(--font-ja); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[lang="th"] body { line-height: 1.85; }
html[lang="ja"] body { line-height: 1.85; letter-spacing: .02em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { line-height: 1.25; color: var(--navy); margin: 0 0 .5em; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.45; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { line-height: 1.45; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 480px) { :root { --gutter: 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::before { content: ""; display: block; height: 6px; background: var(--flag); }
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); flex-shrink: 0; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-en); font-weight: 800; letter-spacing: .02em; font-size: 1.02rem; }
.brand-name span { color: var(--red); font-weight: 700; }
.brand-tag { font-size: .7rem; color: var(--muted); letter-spacing: .04em; margin-top: 3px; }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover { background: var(--bg-alt); color: var(--blue); }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; flex-shrink: 0; }
.lang-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; line-height: 1.4; min-height: 32px;
}
.lang-switch button[lang="th"] { font-family: var(--font-th); }
.lang-switch button[lang="ja"] { font-family: var(--font-ja); }
.lang-switch button:hover { color: var(--navy); background: var(--bg-alt); }
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.nav-toggle {
  display: none; appearance: none; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; position: relative; transition: transform .2s, opacity .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .lang-switch { margin-left: auto; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; gap: 0; }
  .site-nav a { padding: 14px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .site-nav li:last-child a { border-bottom: 0; }
}
@media (max-width: 520px) {
  .brand-text { display: none; }
  .header-inner { gap: 10px; }
  .lang-switch button { padding: 5px 9px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.3;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(224, 16, 47, .28); }
.btn-primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--bg-alt); color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 480px at 85% 10%, rgba(10, 74, 156, .10), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(224, 16, 47, .07), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%);
  padding: 72px 0 88px;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); color: var(--navy);
  padding: 6px 14px 6px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  box-shadow: var(--shadow);
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(224, 16, 47, .15); }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; margin: 20px 0 18px; }
html[lang="th"] .hero h1, html[lang="ja"] .hero h1 { letter-spacing: 0; font-size: clamp(1.9rem, 4.2vw, 3rem); }
.hero h1 .accent { color: var(--red); }
.hero-sub { font-size: 1.12rem; color: var(--muted); max-width: 40em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero-facts li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; color: var(--navy); }
.hero-facts svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-logo-wrap { position: relative; width: min(420px, 100%); aspect-ratio: 1; }
.hero-logo-wrap::before {
  content: ""; position: absolute; inset: -6%; border-radius: 50%;
  background: conic-gradient(from 200deg, rgba(224, 16, 47, .18), rgba(10, 74, 156, .22), rgba(224, 16, 47, .18));
  filter: blur(28px);
}
.hero-logo { position: relative; width: 100%; height: 100%; border-radius: 50%; box-shadow: var(--shadow-lg); background: #fff; border: 6px solid #fff; }

@media (max-width: 860px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { order: -1; }
  .hero-logo-wrap { width: min(240px, 70vw); }
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
@media (max-width: 720px) { .section { padding: 64px 0; } }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}
html[lang="th"] .eyebrow, html[lang="ja"] .eyebrow { letter-spacing: .06em; }
.eyebrow::before { content: ""; width: 22px; height: 14px; border-radius: 2px; background: var(--flag); box-shadow: 0 0 0 1px var(--line); }
.section h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -.01em; }
.lead { font-size: 1.08rem; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.about-text p { font-size: 1.05rem; color: var(--ink); }
.points { display: grid; gap: 16px; }
.point { display: flex; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.point h3 { font-size: 1.05rem; margin-bottom: 4px; }
.point p { margin: 0; color: var(--muted); font-size: .95rem; }
.icon-box { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: rgba(10, 74, 156, .08); color: var(--blue); }
.icon-box svg { width: 26px; height: 26px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

/* Roots in Japan */
.roots {
  margin-top: 56px; position: relative; overflow: hidden;
  background: var(--navy); color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center;
}
.roots::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 12px; background: var(--flag-h); }
.roots .eyebrow { color: #FF8597; }
.roots h3 { color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.roots p { color: #D5DCEC; }
.roots p:last-child { margin-bottom: 0; }
.stores { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.store { display: flex; align-items: center; gap: 14px; background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-sm); padding: 14px 16px; }
.store svg { width: 24px; height: 24px; color: #FF8597; flex-shrink: 0; }
.store strong { display: block; color: #fff; }
.store span { font-size: .88rem; color: #BFC9DF; }
@media (max-width: 860px) { .roots { grid-template-columns: 1fr; padding: 28px 24px 28px; } }

/* Business cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--flag); opacity: 0; transition: opacity .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card .icon-box { margin-bottom: 18px; }
.card:nth-child(even) .icon-box { background: rgba(224, 16, 47, .08); color: var(--red); }
.card h3 { font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } .card { padding: 22px; } }

/* Why */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.why-item { display: flex; gap: 20px; padding: 28px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.why-num {
  font-family: var(--font-en); font-weight: 800; font-size: 1.1rem; color: #fff; background: var(--blue);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
}
.why-item:nth-child(1) .why-num, .why-item:nth-child(4) .why-num { background: var(--red); }
.why-item h3 { font-size: 1.12rem; margin-bottom: 6px; }
.why-item p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } .why-item { padding: 22px; gap: 16px; } }

/* Company table */
.profile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.profile table { width: 100%; border-collapse: collapse; }
.profile th, .profile td { text-align: left; vertical-align: top; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.profile tr:last-child th, .profile tr:last-child td { border-bottom: 0; }
.profile th { width: 32%; background: #F8FAFD; color: var(--navy); font-weight: 600; font-size: .95rem; }
.profile td { overflow-wrap: anywhere; }
.note-inline { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.tba {
  display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; color: #7A5A00;
  background: #FFF6DB; border: 1px dashed #E2C15A; padding: 2px 10px; border-radius: 999px;
}
.notice {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 20px;
  padding: 16px 18px; background: #fff; border-left: 4px solid var(--blue); border-radius: var(--radius-sm); color: var(--muted); font-size: .95rem;
}
.notice svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; margin-top: 3px; }
.notice p { margin: 0; }
@media (max-width: 640px) {
  .profile th, .profile td { display: block; width: 100%; }
  .profile th { padding: 14px 18px 4px; border-bottom: 0; background: #fff; font-size: .85rem; color: var(--muted); }
  .profile td { padding: 0 18px 14px; }
}

/* Contact */
.contact-box {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-dark) 100%); color: #fff;
  padding: 56px; text-align: center;
}
.contact-box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: var(--flag); }
.contact-box h2 { color: #fff; }
.contact-box .eyebrow { color: #FF8597; justify-content: center; }
.contact-box .lead { color: #D5DCEC; max-width: 640px; margin: 0 auto 32px; }
.contact-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 820px; margin: 0 auto; }
.contact-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius);
  color: #fff; text-decoration: none; font-weight: 600; transition: background-color .15s, transform .15s;
}
.contact-btn svg { width: 28px; height: 28px; }
.contact-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; transform: translateY(-2px); }
.contact-btn .contact-value { font-weight: 400; font-size: .88rem; color: #D5DCEC; overflow-wrap: anywhere; }
.contact-btn[aria-disabled="true"] { cursor: default; opacity: .75; }
.contact-btn[aria-disabled="true"]:hover { transform: none; background: rgba(255, 255, 255, .08); }
.contact-box .tba { color: #FFE9A8; background: rgba(255, 214, 102, .12); border-color: rgba(255, 214, 102, .5); }
.social { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); }
.social a:hover { background: var(--bg-alt); color: var(--blue); }
.social svg { width: 22px; height: 22px; }
.contact-note { margin: 28px auto 0; max-width: 680px; font-size: .9rem; color: #BFC9DF; }
@media (max-width: 760px) {
  .contact-box { padding: 40px 20px; }
  .contact-actions { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #C3CCE0; padding: 56px 0 32px; font-size: .92rem; }
.site-footer::before { content: ""; display: block; height: 6px; background: var(--flag); margin-top: -56px; margin-bottom: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; background: #fff; }
.footer-brand strong { color: #fff; font-size: 1rem; display: block; line-height: 1.4; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 36px; padding-top: 24px; display: grid; gap: 10px; }
.footer-legal p { margin: 0; }
.disclaimer { font-size: .82rem; color: #A9B4CC; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Privacy page ---------- */
.page-hero { background: linear-gradient(180deg, #fff 0%, var(--bg-alt) 100%); padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.page-hero .lead { max-width: 820px; }
.meta-line { font-size: .92rem; color: var(--muted); margin: 0; }
.legal { max-width: 860px; padding-top: 48px; padding-bottom: 80px; }
.legal section { margin-bottom: 36px; }
.legal h2 { font-size: 1.3rem; padding-bottom: 8px; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.legal ul { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: 6px; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; background: var(--bg-alt); padding: 18px 20px; border-radius: var(--radius-sm); margin: 0 0 1em; }
.legal dt { font-weight: 600; color: var(--navy); }
.legal dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .legal dl { grid-template-columns: 1fr; gap: 2px; } .legal dd { margin-bottom: 10px; } }

/* ---------- Line breaking ---------- */
/* Thai has no spaces between words: never force arbitrary breaks.
   Let the browser break at dictionary word boundaries; only break inside a
   word as an emergency (overflow-wrap: break-word does not shrink min-content
   the way `anywhere` does, so table cells don't collapse mid-word). */
:lang(th),
html[lang="th"] .profile td,
html[lang="th"] .legal dd,
html[lang="th"] .contact-btn .contact-value {
  word-break: normal;
  line-break: auto;
  overflow-wrap: break-word;
}
/* Thai words wrapped by i18n.js (Intl.Segmenter); breaks are offered via <wbr> between them */
.tw { white-space: nowrap; }
/* Japanese headings: break at phrase boundaries where supported (Chrome 119+) */
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { word-break: auto-phrase; }
