/* Zathu site: a launcher, not a gallery. Dense, tactile, dark.
   Tokens for the synth instrument and /synth live in base.css; this is the site only. */

body.site {
  --bg: #131416;
  --panel: #1c1e22;
  --panel-2: #25282d;
  --edge: #33363d;
  --ink: #ece9e3;
  --muted: #a0a29f;
  --hot: #ff5a1f;
  --hot-dark: #b83a0a;
  --f-ui: 'Bricolage Grotesque', system-ui, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z: polygon(0 0, 100% 0, 100% 26%, 38% 74%, 100% 74%, 100% 100%, 0 100%, 0 74%, 62% 26%, 0 26%);

  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}
body.site::before { display: none; }
body.site .container { max-width: 1280px; padding: 0 clamp(16px, 3vw, 32px); }
body.site a { transition: none; }
body.site h1, body.site h2, body.site h3 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
body.site :focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }
body.site ::selection { background: var(--hot); color: #000; }
.text-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--hot); }
.text-link:hover { color: var(--hot); }

/* Buttons: keys you press */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 10px 22px; border-radius: 10px; border: 0; cursor: pointer;
  font: 700 1rem/1.15 var(--f-ui); letter-spacing: -0.01em;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .2s var(--ease);
}
.btn-hot { background: var(--hot); color: #160700; box-shadow: 0 4px 0 var(--hot-dark); }
.btn-hot:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--hot-dark); background: #ff6e3a; }
.btn-hot:active { transform: translateY(4px); box-shadow: 0 0 0 var(--hot-dark); transition-duration: .05s; }
.btn-ghost { background: var(--panel-2); color: var(--ink); box-shadow: 0 4px 0 #0c0d0f; }
.btn-ghost:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #0c0d0f; background: #30343a; }
.btn-ghost:active { transform: translateY(4px); box-shadow: 0 0 0 #0c0d0f; transition-duration: .05s; }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: .95rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--edge); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.brand { display: flex; align-items: baseline; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.04em; }
.z-mark { width: .66em; height: .7em; margin-right: .03em; flex: none; background: var(--hot); clip-path: polygon(0 0, 100% 0, 100% 21%, 30% 79%, 100% 79%, 100% 100%, 0 100%, 0 79%, 70% 21%, 0 21%); transition: transform .4s var(--ease); }
.brand:hover .z-mark { transform: rotate(-8deg) scale(1.12); }
.brand-name { font-size: 1em; }
.nav-links { list-style: none; display: flex; gap: 6px; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 8px; font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s; }
.nav-links a:hover { background: var(--panel-2); color: var(--ink); }

/* Hero */
.hero-section { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-title { font-size: clamp(2.3rem, 1rem + 3.9vw, 4.6rem); line-height: .98; letter-spacing: -0.045em; }
.hero-subtitle { margin-top: 24px; font-size: 1.3rem; line-height: 1.4; max-width: 34ch; color: var(--ink); }
.hero-action-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-stage { min-width: 0; }
.hero-hardware-panel { min-width: 0; }
.hero-note { margin-top: 18px; color: var(--muted); font-size: 1rem; max-width: 52ch; }
.hardware-chassis-card { color: var(--text-main); }

/* Sections */
.section { padding: clamp(56px, 8vw, 112px) 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 40px; margin-bottom: 32px; }
.section-title { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.4rem); }
.section-desc { color: var(--muted); max-width: 52ch; font-size: 1.1rem; }

/* Bento tiles */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.bento .tile-ytm { grid-column: span 12; align-items: center; }
.tile-ytm .tile-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 40px; }
.tile-ytm .tile-body > * { margin: 0; }
.tile-ytm .tile-kind, .tile-ytm h3 { flex-basis: 100%; }
.tile-ytm .tile-lead, .tile-ytm p:not(.tile-kind):not(.tile-lead) { flex: 1 1 320px; }
.tile-ytm .tile-actions { padding: 0; }
.tile { grid-column: span 4; background: var(--panel); border-radius: var(--radius); border-top: 4px solid var(--c); padding: 28px; display: flex; gap: 22px; transition: transform .3s var(--ease), background-color .3s var(--ease); }
.tile:hover { transform: translateY(-4px); background: var(--panel-2); }
.tile-majestic { grid-column: span 7; }
.tile-setlore { grid-column: span 5; }
.tile h3 { hyphens: manual; }
.tile-icon { width: 104px; height: 104px; flex: none; align-self: flex-start; transition: transform .4s var(--ease); }
.tile-icon-round { border-radius: 24%; }
.tile:hover .tile-icon { transform: rotate(-5deg) scale(1.05); }
.tile-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; flex: 1; }
.tile-kind { font-family: var(--font-mono); font-size: .8125rem; color: var(--c); }
.tile h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); overflow-wrap: anywhere; }
.tile-lead { font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.tile p { color: var(--muted); }
.tile .tile-lead { color: var(--ink); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 10px; }
.past { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 40px; color: var(--muted); }
.past-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--muted); }
.past-list { list-style: none; flex: 1 1 400px; }
.past-list li { display: flex; flex-direction: column; gap: 2px; }
.past-list a { color: var(--ink); }
.past-list a:hover { color: var(--hot); }

/* LAN: a server browser */
.srv-list { display: flex; flex-direction: column; gap: 8px; }
.srv-cols, .srv-head { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 1fr) minmax(0, 2.2fr) 28px; gap: 20px; align-items: center; }
.srv-cols { padding: 0 24px; font-size: .875rem; color: var(--muted); }
.srv { background: var(--panel); border-radius: var(--radius); overflow: hidden; transition: background-color .25s var(--ease); }
.srv.open { background: var(--panel-2); box-shadow: inset 4px 0 0 var(--hot); }
.srv-head { all: unset; box-sizing: border-box; width: 100%; padding: 20px 24px; cursor: pointer; display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 1fr) minmax(0, 2.2fr) 28px; gap: 20px; align-items: center; }
.srv-head:hover { background: rgba(255,255,255,.04); }
.srv-head:focus-visible { outline: 3px solid var(--hot); outline-offset: -3px; }
.srv-game { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.srv-repo { font-family: var(--font-mono); font-size: .9rem; color: var(--f4, #6ef8fb); }
.srv-what, .srv-repo { font-weight: 500; }
.srv-what { color: var(--muted); font-size: 1rem; line-height: 1.35; }
.srv-plus { width: 16px; height: 16px; background: var(--ink); justify-self: end; clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%); transition: transform .35s var(--ease), background-color .2s; }
.srv.open .srv-plus { transform: rotate(135deg); background: var(--hot); }
.srv-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .4s var(--ease); }
.srv-inner { overflow: hidden; }
.js .srv:not(.open) .srv-panel { grid-template-rows: 0fr; }
.js .srv:not(.open) .srv-inner { visibility: hidden; transition: visibility 0s .4s; }
.srv-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 4px 24px 24px; }
.srv-detail > div { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.srv-detail p { color: var(--muted); max-width: 48ch; }
.code { margin: 0; padding: 20px; background: #0e0f11; border-radius: 10px; font-family: var(--font-mono); font-size: .875rem; line-height: 1.75; overflow-x: auto; white-space: pre; }
.term-muted { color: #8c8e8a; } .term-cyan { color: #6ef8fb; } .term-green { color: #8cf59a; } .term-amber { color: #ffc766; }

/* Footer */
.site-footer { margin-top: clamp(64px, 9vw, 128px); background: var(--panel); padding: 40px 0; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 20px 40px; align-items: center; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; }
.footer-links a { color: var(--ink); font-weight: 500; }
.footer-links a:hover { color: var(--hot); }
.footer-copy { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10000; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 10px; background: #5dff8a; color: #04200d; font-weight: 700; transition: opacity .2s var(--ease), transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Motion */
.js .hero-content > *, .js .hero-stage { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease), background-color .3s var(--ease); }
.js .is-in { opacity: 1 !important; transform: none !important; }
.js .tile.is-in:hover { transform: translateY(-4px) !important; }

/* Maximized synth (see js/synth) */
body.scope-max-open .hero-section .container { z-index: 10001; }
body.scope-max-open .hero-section { overflow: visible; }
body.scope-max-open .site-header, body.scope-max-open .section, body.scope-max-open .site-footer, body.scope-max-open .hero-content { visibility: hidden; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero-grid, .srv-detail { grid-template-columns: 1fr; }
  .tile, .tile-majestic, .tile-setlore { grid-column: span 12; }
  .srv-cols { display: none; }
  .srv-head { grid-template-columns: 1fr 28px; gap: 4px 16px; }
  .srv-repo, .srv-what { grid-column: 1; }
  .srv-plus { grid-column: 2; grid-row: 1; }
  .footer-inner { grid-template-columns: 1fr; } .footer-links { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .tile { flex-direction: column; padding: 22px; }
  .tile-actions .btn, .hero-action-row .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  body.site *, body.site *::before, body.site *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero-content > *, .js .hero-stage, .js [data-reveal] { opacity: 1; transform: none; }
}
