/* Winfinity: black and cyan come from the logo. The 45° bevel (logo corners) is the repeated motif. */
:root {
  --bg: #05080c;
  --ink: #e9f2f7;
  --muted: #b4c3cd;
  --line: rgba(233, 242, 247, .14);
  --on-accent: #05080c;
  --display: "Chakra Petch", "Barlow", system-ui, sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --radius: 4px;
  --glow:
    0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent),
    0 0 22px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 80px color-mix(in srgb, var(--accent) 22%, transparent),
    inset 0 0 30px color-mix(in srgb, var(--accent) 16%, transparent);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--radius);
  font: 600 1rem/1.15 var(--display); text-align: center; text-decoration: none; overflow-wrap: anywhere;
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: #fff; border-color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn.big { min-height: 56px; padding: 12px 26px; font-size: 1.1rem; }


/* ---------- header (both modes) ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
html:not(.is-3d) .top { background: rgba(5, 8, 12, .92); border-bottom: 1px solid var(--line); }
.brand { justify-self: center; display: block; }
.brand img { height: 28px; width: auto; }
.cta { justify-self: end; }
.menu { justify-self: start; position: relative; }
.menu-btn {
  display: grid; place-items: center; width: 48px; height: 48px; list-style: none; cursor: pointer; color: var(--ink);
  background: rgba(10, 18, 26, .45); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line); border-radius: var(--radius); transition: color .2s, border-color .2s;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn:hover, .menu[open] .menu-btn { color: var(--accent); border-color: var(--accent); }
.menu-list { position: absolute; top: calc(100% + 10px); left: 0; display: grid; min-width: 240px; padding: 8px; background: #0a121a; border: 1px solid var(--line); border-radius: var(--radius); }
.menu-list a { display: flex; align-items: center; min-height: 46px; padding: 0 14px; font: 600 1.15rem/1 var(--display); text-decoration: none; }
.menu-list a:hover { color: var(--accent); background: rgba(255, 255, 255, .04); }
.menu-list a.small { margin-top: 6px; border-top: 1px solid var(--line); font: 500 .95rem/1 var(--body); color: var(--muted); }
@media (max-width: 560px) {
  .top { grid-template-columns: auto 1fr auto; }
  .brand img { height: 22px; }
  .cta { min-height: 44px; padding: 8px 14px; font-size: .9rem; }
}

html:not(.is-3d) .only-3d { display: none !important; }
.to-3d { display: none; }
.can-3d .to-3d { display: inline-flex; }

/* ---------- readable page (no WebGL or ?texto) ---------- */
#doc { padding-top: 76px; }
.intro { display: grid; align-content: center; justify-items: center; gap: 20px; min-height: 88svh; max-width: 900px; margin: 0 auto; padding: 56px 16px 80px; text-align: center; }
.intro-logo { width: min(420px, 80%); margin-bottom: 12px; }
.kicker, .tag { font: 600 .95rem/1.2 var(--display); color: var(--accent); }
.intro h1 { max-width: 16ch; font-size: clamp(2.3rem, 6vw, 4.4rem); }
.intro-text { max-width: 52ch; font-size: 1.15rem; color: var(--muted); }

.panel { container-type: inline-size; max-width: 1120px; margin: 0 auto; padding: clamp(56px, 9vw, 120px) 16px; border-top: 1px solid var(--line); scroll-margin-top: 60px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-body { display: grid; gap: 28px; }
.panel h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.lead { max-width: 30ch; margin-top: 16px; font-size: 1.25rem; }
.panel-main { display: grid; align-content: start; gap: 18px; }
.panel-main > p { max-width: 62ch; color: var(--muted); }
.panel-img { border: 1px solid var(--line); border-radius: var(--radius); }
.panel .btn { justify-self: start; margin-top: 8px; }
.items { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.items li { display: grid; gap: 6px; padding: 18px 0; border-top: 1px solid var(--line); }
.items h3 { font-size: 1.15rem; }
.items p { color: var(--muted); }
@container (min-width: 560px) { .items li { grid-template-columns: minmax(150px, 13rem) 1fr; gap: 24px; } }
@container (min-width: 860px) {
  .panel-body { grid-template-columns: 5fr 7fr; gap: 64px; }
  .panel-lead { position: sticky; top: 110px; align-self: start; }
}
.contact { display: grid; justify-items: center; gap: 20px; text-align: center; }
.contact .panel-head { justify-content: center; margin: 0; }
.contact > p { max-width: 46ch; color: var(--muted); font-size: 1.15rem; }
.contact .btn { justify-self: center; }
.foot { padding: 40px 16px calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .95rem; }
.foot a:hover { color: var(--accent); }

/* ---------- 3D mode ---------- */
#stage, #loader { display: none; }
/* navy vignette: lifts the chrome tower off pure black */
.is-3d body { height: 100dvh; overflow: hidden; background: radial-gradient(120% 80% at 50% 36%, #0d1c28 0%, #070d13 45%, var(--bg) 75%); }
.is-3d #stage { display: block; position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
#stage:focus-visible { outline-offset: -6px; }
.is-3d #doc { padding: 0; }
.is-3d .intro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.is-3d .foot, .is-3d .panel { display: none; }

.is-3d .panel:target {
  --pad: clamp(22px, 4vw, 40px);
  display: block; position: fixed; z-index: 20; top: 84px; left: 0; right: 0; margin: 0 auto;
  width: min(780px, calc(100% - 32px)); max-height: calc(100dvh - 104px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--pad); border: 1px solid color-mix(in srgb, var(--accent) 70%, #fff); border-radius: var(--radius);
  background: rgba(6, 12, 18, .7); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--glow); scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
  animation: panel-in .5s cubic-bezier(.2, .8, .2, 1) both, ignite .9s linear both;
}
.is-3d .panel:target:focus { outline: none; } /* focus lands here only programmatically; the glowing border already marks it */
/* light runs once along the top and bottom edges when the panel switches on */
.is-3d .panel:target::before, .is-3d .panel:target::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff 50%, transparent) no-repeat; background-size: 35% 100%;
  animation: sweep 1.3s .3s ease-out both;
}
.is-3d .panel:target::before { top: 0; }
.is-3d .panel:target::after { bottom: 0; animation-direction: reverse; }
.is-3d .panel-head {
  position: sticky; top: calc(var(--pad) * -1); z-index: 1; margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 18px; padding: var(--pad) var(--pad) 14px;
  background: linear-gradient(rgba(6, 12, 18, .94) 72%, rgba(6, 12, 18, 0));
}
.is-3d .contact .panel-head { justify-self: stretch; justify-content: space-between; margin-bottom: 0; }
.close { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); font: 600 .95rem/1 var(--display); text-decoration: none; white-space: nowrap; }
.close:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) {
  .is-3d .panel:target { top: 74px; width: calc(100% - 20px); max-height: calc(100dvh - 84px); }
}

@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes ignite {
  0% { box-shadow: none; border-color: transparent; }
  12%, 26%, 44%, 100% { box-shadow: var(--glow); border-color: color-mix(in srgb, var(--accent) 70%, #fff); }
  18%, 32% { box-shadow: none; border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
}
@keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; opacity: .2; } }

.hint {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 10; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; background: rgba(5, 8, 12, .72); border: 1px solid var(--line); border-radius: var(--radius);
  font: 500 .9rem/1.3 var(--body); text-align: center; transition: opacity .3s;
}
.hint-touch { display: none; }
@media (hover: none) { .hint-desktop { display: none; } .hint-touch { display: inline; } }
.is-3d:has(.panel:target) .hint, .is-loading .hint { opacity: 0; }

.is-3d #loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--bg); transition: opacity .6s, visibility .6s; }
.is-3d:not(.is-loading) #loader { opacity: 0; visibility: hidden; }
.loader-mark { position: relative; width: 64px; }
.loader-mark img { width: 64px; }
.loader-mark img:first-child { opacity: .18; }
.loader-mark img:last-child { position: absolute; inset: 0; clip-path: inset(calc(100% - var(--p, 0%)) 0 0 0); }
#loader p { font: 600 .95rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
#pct { color: var(--ink); }

/* bevelled corners where supported (kept last so it wins the cascade), small square-ish radius elsewhere */
@supports (corner-shape: bevel) {
  .btn, .menu-btn, .menu-list, .close, .hint { corner-shape: bevel; border-radius: 12px; }
  .is-3d .panel:target { corner-shape: bevel; border-radius: 28px; }
}

@media (prefers-reduced-motion: no-preference) { html:not(.is-3d) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
