/* ============================================================
   Hajime - public surface (home + tournament page). Spec 037/038.
   Adapted from the claude/design concept: warm-charcoal + gold +
   Inter / IBM Plex Mono, light/dark tokens. The review chrome
   (concept bar, device frame, tweaks dock) and the unused variants
   (asymmetric hero + live panel, stacked tournament card) are dropped
   per the fixed design decisions; the page renders the centered hero
   and the row tournament card. Responsive via container queries on the
   .product container, so it reflows on real viewports.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #F6F8FA;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ============================================================
   WORKSPACE TOKENS (mirrored from auth.css)
   ============================================================ */
.product {
  --accent: #D9A441;
  --gold: var(--accent);
  --radius: 14px;
  --pad: 1;            /* density multiplier */
  container-type: inline-size;
  container-name: site;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.product[data-theme="light"] {
  --bg:            #F6F8FA;
  --surface:       #FFFFFF;
  --surface-2:     #F0F3F6;
  --surface-3:     #E7ECF1;
  --border:        #D0D7DE;
  --border-strong: #A8B3BD;
  --ink:           #1F2328;
  --ink-2:         #59636E;
  --ink-muted:     rgba(31, 35, 40, 0.55);
  --ink-faint:     rgba(31, 35, 40, 0.30);
  --running:  #1F8A4D;  --running-bg: rgba(31, 138, 77, 0.10);
  --pending:  #1F7BD8;  --pending-bg: rgba(31, 123, 216, 0.08);
  --amber:    #B88300;  --amber-bg: rgba(184, 131, 0, 0.10);
  --red:      #C5372B;  --red-bg:   rgba(197, 55, 43, 0.08);
  --shadow-sm: 0 1px 2px rgba(31,35,40,0.06), 0 1px 1px rgba(31,35,40,0.04);
  --shadow-md: 0 4px 14px rgba(31,35,40,0.08), 0 1px 3px rgba(31,35,40,0.06);
  --weave: rgba(31,35,40,0.05);
}

.product[data-theme="dark"] {
  --bg:            #1A1712;
  --surface:       #232019;
  --surface-2:     #2A2620;
  --surface-3:     #332E26;
  --border:        rgba(242, 235, 224, 0.13);
  --border-strong: rgba(242, 235, 224, 0.26);
  --ink:           #F2EBE0;
  --ink-2:         rgba(242, 235, 224, 0.64);
  --ink-muted:     rgba(242, 235, 224, 0.44);
  --ink-faint:     rgba(242, 235, 224, 0.24);
  --running:  #3FB984;  --running-bg: rgba(63, 185, 132, 0.13);
  --pending:  #3FA4E8;  --pending-bg: rgba(63, 164, 232, 0.12);
  --amber:    #E8B23A;  --amber-bg: rgba(232, 178, 58, 0.13);
  --red:      #E0594C;  --red-bg:   rgba(224, 89, 76, 0.13);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.35);
  --weave: rgba(242,235,224,0.05);
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 clamp(20px, 4cqi, 52px); }

/* ============================================================
   SITE BAR (warm charcoal - identity anchor, theme-agnostic)
   ============================================================ */
.site-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 clamp(16px, 4cqi, 52px);
  background: #16110A; color: #F2EBE0;
  border-bottom: 1px solid #26211a;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #16110A;
  font-weight: 700; font-size: 20px; line-height: 1;
  font-family: 'Noto Serif JP', 'IBM Plex Serif', serif;
}
.brand-name { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand-name b { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.site-bar .spacer { flex: 1; }
.bar-nav { display: flex; align-items: center; gap: 4px; }
.bar-nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 8px;
  color: rgba(242,235,224,0.7); cursor: pointer;
  font: 500 13.5px/1 'Inter', sans-serif;
}
.bar-nav a:hover { color: #F2EBE0; background: rgba(242,235,224,0.06); }
.bar-nav .ghost-light { border: 1px solid rgba(242,235,224,0.16); }
.bar-nav .ghost-light:hover { border-color: rgba(242,235,224,0.32); background: transparent; }
.bar-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 15px; height: 38px; border-radius: 9px;
  background: var(--accent); color: #16110A;
  font: 700 13.5px/1 'Inter', sans-serif; cursor: pointer;
}
.bar-cta:hover { filter: brightness(1.06); }

@container site (max-width: 720px) {
  .bar-nav .hide-mobile { display: none; }
}

/* ============================================================
   BUTTONS (shared)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font: 700 14px/1 'Inter', sans-serif; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, filter .14s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn .ico { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1c1407; }
.btn-primary:hover { filter: brightness(1.06); background: var(--accent); border-color: var(--accent); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================
   BADGES / CHIPS
   ============================================================ */
.chip-status {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px; border-radius: 7px;
  font: 700 11.5px/1 'Inter', sans-serif;
  border: 1px solid transparent; white-space: nowrap;
}
.chip-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-status .dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.st-open   { color: var(--running); background: var(--running-bg); border-color: color-mix(in srgb, var(--running) 30%, transparent); }
.st-soon   { color: var(--amber);   background: var(--amber-bg);   border-color: color-mix(in srgb, var(--amber) 32%, transparent); }
.st-live   { color: var(--red);     background: var(--red-bg);     border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.st-closed { color: var(--ink-2);   background: var(--surface-2);  border-color: var(--border); }
.st-done   { color: var(--pending); background: var(--pending-bg); border-color: color-mix(in srgb, var(--pending) 30%, transparent); }

.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font: 600 12.5px/1 'IBM Plex Mono', monospace; color: var(--ink-2);
  letter-spacing: 0.02em;
}
.cat-chip b { color: var(--ink); font-weight: 700; }

.eyebrow {
  font: 600 11px/1 'IBM Plex Mono', monospace;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted);
}

/* ============================================================
   HOME - HERO (centered, sober - no live panel)
   ============================================================ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--weave) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg,  var(--weave) 0 1px, transparent 1px 72px);
  -webkit-mask: radial-gradient(ellipse 95% 78% at 50% -6%, #000 30%, transparent 82%);
          mask: radial-gradient(ellipse 95% 78% at 50% -6%, #000 30%, transparent 82%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-inner {
  text-align: center; padding: clamp(64px, 13cqi, 132px) 0 clamp(56px, 9cqi, 104px);
  max-width: 880px; margin: 0 auto;
}
.hero h1 {
  margin: 16px auto 0; font-weight: 800;
  font-size: clamp(34px, 6.2cqi, 60px); line-height: 1.02; letter-spacing: -0.03em;
  max-width: 18ch; text-wrap: balance;
}
.hero .lede {
  margin: 22px auto 0; color: var(--ink-2);
  font-size: clamp(15px, 1.9cqi, 19px); line-height: 1.6; max-width: 56ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; justify-content: center; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; justify-content: center;
  font: 600 11px/1.4 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   HOME - FEATURE CARDS
   ============================================================ */
.section { padding: clamp(48px, 8cqi, 88px) 0; }
.section-head { margin-bottom: clamp(24px, 4cqi, 40px); }
.section-head h2 {
  margin: 10px 0 0; font-size: clamp(22px, 3cqi, 30px); font-weight: 800; letter-spacing: -0.02em;
}
.section-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head p { margin: 9px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 60ch; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@container site (max-width: 980px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@container site (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: calc(22px * var(--pad)) 20px;
  box-shadow: var(--shadow-sm);
}
.feature .ic {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent); margin-bottom: 16px;
}
.feature .ic svg { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 7px; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }

/* ============================================================
   HOME - UPCOMING TOURNAMENTS (row card)
   ============================================================ */
.t-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
.t-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s;
}
.t-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.t-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 66px; height: 66px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.t-date .d { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.t-date .m { font: 700 10px/1 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); margin-top: 4px; }
.t-main { min-width: 0; }
.t-main h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 13px; }
.t-meta span { display: inline-flex; align-items: center; gap: 7px; }
.t-meta svg { width: 14px; height: 14px; color: var(--ink-muted); }
.t-end { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.t-go { display: inline-flex; align-items: center; gap: 7px; font: 700 13px/1 'Inter'; color: var(--accent); }
.t-go svg { width: 15px; height: 15px; }
@container site (max-width: 640px) {
  .t-card { grid-template-columns: auto 1fr; }
  .t-end { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}
.t-empty {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  color: var(--ink-2); font-size: 14px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot {
  background: var(--surface-2); border-top: 1px solid var(--border);
  padding: clamp(36px, 6cqi, 60px) 0 32px;
}
.foot-grid { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-brand .brand-mark { background: var(--accent); }
.foot-brand .b-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.foot-brand p { margin: 14px 0 0; color: var(--ink-2); font-size: 13px; max-width: 40ch; line-height: 1.6; }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h4 { margin: 0 0 12px; font: 600 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.foot-col a { display: block; color: var(--ink-2); font-size: 13.5px; padding: 5px 0; }
.foot-col a:hover { color: var(--ink); }
.foot-rule { height: 1px; background: var(--border); margin: 32px 0 20px; }
.foot-legal { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--ink-muted); font-size: 12px; }
.foot-legal .mono { font-size: 11px; letter-spacing: 0.04em; }
.foot-legal .brand-mark { width: 28px; height: 28px; font-size: 16px; }

/* ============================================================
   FICHA - TOURNAMENT PAGE
   ============================================================ */
.ficha-bar .bar-nav { margin-left: auto; }

.ficha-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.ficha-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--weave) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg,  var(--weave) 0 1px, transparent 1px 72px);
  -webkit-mask: radial-gradient(ellipse 90% 90% at 18% -20%, #000 20%, transparent 75%);
          mask: radial-gradient(ellipse 90% 90% at 18% -20%, #000 20%, transparent 75%);
}
.ficha-head .wrap { position: relative; z-index: 1; padding-top: clamp(28px, 5cqi, 52px); padding-bottom: clamp(28px, 5cqi, 48px); }
.fh-share { display: inline-flex; align-items: center; gap: 0; margin-top: 18px; max-width: 100%; }
.fh-url {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  height: 40px; padding: 0 14px; border-radius: 10px 0 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-right: 0;
  font: 500 13px/1 'IBM Plex Mono', monospace; color: var(--ink-2); overflow: hidden;
}
.fh-url svg { width: 15px; height: 15px; color: var(--ink-muted); flex: none; }
.fh-url .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-copy {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 40px; padding: 0 15px; border-radius: 0 10px 10px 0;
  background: var(--ink); border: 1px solid var(--ink); color: var(--bg);
  font: 700 12.5px/1 'Inter'; cursor: pointer; transition: filter .14s;
}
.fh-copy:hover { filter: brightness(1.1); }
.fh-copy svg { width: 15px; height: 15px; }
.fh-copy.copied { background: var(--running); border-color: var(--running); color: #fff; }

.ficha-head h1 {
  margin: 22px 0 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.04;
  font-size: clamp(30px, 5.4cqi, 52px); max-width: 20ch; text-wrap: balance;
}
.fh-org { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.fh-org span { display: inline-flex; align-items: center; gap: 8px; }
.fh-org svg { width: 15px; height: 15px; color: var(--ink-muted); }

.ficha-body { padding: clamp(32px, 6cqi, 56px) 0 clamp(56px, 9cqi, 88px); }
.ficha-grid { display: grid; grid-template-columns: 1fr 360px; gap: clamp(20px, 4cqi, 40px); align-items: start; }
@container site (max-width: 860px) { .ficha-grid { grid-template-columns: 1fr; } }

.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@container site (max-width: 520px) { .fact-grid { grid-template-columns: 1fr; } }
.fact {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
}
.fact .k { display: flex; align-items: center; gap: 9px; font: 600 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.fact .k svg { width: 16px; height: 16px; color: var(--accent); }
.fact .v { margin-top: 12px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.fact .v .sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-top: 4px; letter-spacing: 0; }

.block-title { display: flex; align-items: center; gap: 10px; margin: clamp(28px, 5cqi, 40px) 0 16px; }
.block-title h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.block-title .count { font: 600 11px/1 'IBM Plex Mono', monospace; color: var(--ink-muted); }
.cat-wrap { display: flex; flex-wrap: wrap; gap: 9px; }
/* Offered categories grouped by division (spec 038): a few cards instead of a
   flat wall of chips, each division listing its weights as pills. */
.cat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cat-group { border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; background: var(--surface); }
.cat-group-label { font-weight: 700; font-size: 14px; margin-bottom: 9px; color: var(--ink); }
.cat-weights { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-weights .wpill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--ink-muted); }

.bases {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  margin-top: clamp(28px, 5cqi, 40px);
}
.bases .pdf {
  width: 52px; height: 60px; flex: none; border-radius: 8px; position: relative;
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--red) 36%, transparent);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px;
}
.bases .pdf svg { width: 24px; height: 24px; color: var(--red); }
.bases .pdf .ext { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font: 800 8px/1 'IBM Plex Mono', monospace; letter-spacing: 0.1em; color: var(--red); }
.bases .info { flex: 1; min-width: 0; }
.bases .info h3 { margin: 0 0 5px; font-size: 15.5px; font-weight: 700; }
.bases .info p { margin: 0; color: var(--ink-2); font-size: 12.5px; font-family: 'IBM Plex Mono', monospace; letter-spacing: 0.02em; }
@container site (max-width: 460px) {
  .bases { flex-wrap: wrap; }
  .bases .btn { width: 100%; }
}

.ficha-aside { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 16px; }
.register-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px); padding: 22px; box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.register-card .rc-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 80% 50% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.register-card > * { position: relative; }
.register-card .rc-status { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.register-card .rc-close { font: 600 11px/1 'IBM Plex Mono', monospace; color: var(--ink-muted); }
.register-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.register-card p { margin: 0 0 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.register-card .hint { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--ink-muted); font-size: 12px; }
.register-card .hint svg { width: 14px; height: 14px; flex: none; }

.aside-note {
  display: flex; gap: 11px; padding: 15px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
}
.aside-note svg { width: 17px; height: 17px; color: var(--ink-muted); flex: none; margin-top: 1px; }
.aside-note b { color: var(--ink); }

@container site (max-width: 860px) {
  .ficha-aside { position: static; }
}
