/* Daedalus — shared styles for the landing page and "Minha conta".
   Tokens, fonts, header, buttons, the "how to connect" steps and the motion helpers live here.
   Page-specific styles stay inline in each template (with the CSP nonce). */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/instrument-sans.woff2") format("woff2");
}

:root {
  --bg: #f4f1ea;
  --bg-alt: #ebe6db;
  --card: #fbfaf7;
  --text: #1f1b17;
  --muted: #6f675d;
  --line: #ddd6c9;
  --line-strong: #c9bfae;
  --accent: #7a4b1f;
  --accent-hover: #603a16;
  --accent-text: #fff8ef;
  --accent-soft: #f1e4d3;
  --accent-ink: #3d2712;
  --ok: #1e6b35;
  --err: #a8271f;
  --tag: #ece5d8;
  --sheet: #fffdf9;
  --shadow: 0 1px 2px rgba(45, 30, 15, .06), 0 14px 36px -14px rgba(45, 30, 15, .28);
  --shadow-lift: 0 2px 4px rgba(45, 30, 15, .08), 0 28px 56px -20px rgba(45, 30, 15, .38);
  --radius: 16px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --grain-opacity: .5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --bg-alt: #1e1a17;
    --card: #242019;
    --text: #f2ede4;
    --muted: #aaa196;
    --line: #37302a;
    --line-strong: #4b4238;
    --accent: #dda060;
    --accent-hover: #e9b47c;
    --accent-text: #1f1b17;
    --accent-soft: #33271b;
    --accent-ink: #f0d9bd;
    --ok: #7fd49a;
    --err: #ff8a80;
    --tag: #302a24;
    --sheet: #f6f2ea;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 36px -14px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .6), 0 28px 56px -20px rgba(0, 0, 0, .9);
    --grain-opacity: .35;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Paper grain: an SVG noise tile over the whole page. It never blocks clicks. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0 0.14 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::before { mix-blend-mode: screen; } }
body > * { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -.01em; margin: 0;
             font-variation-settings: "opsz" 96, "SOFT" 30; }
h3 { font-variation-settings: "opsz" 24, "SOFT" 30; }
p { margin: 0 0 12px; }
b, strong { font-weight: 600; }
i, em { font-family: var(--font-display); font-style: italic; font-weight: 450; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--tag); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.muted { color: var(--muted); font-size: .92rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 10; }
[hidden] { display: none !important; }

/* Eyebrow: small caps label above a heading. */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 600;
           letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }

/* Header (shared) */
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent);
             backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px);
             border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
         font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em;
         font-variation-settings: "opsz" 24, "SOFT" 60; }
.brand:hover { color: var(--text); }
.brand svg { flex: none; }
.mark-bg { fill: var(--accent); }
.mark-fg { stroke: var(--accent-text); }
nav.links { display: flex; align-items: center; gap: 22px; font-size: .95rem; }
nav.links a { color: var(--muted); text-decoration: none; }
nav.links a:hover { color: var(--text); }
nav.links .hide-sm { display: none; }
@media (min-width: 720px) { nav.links .hide-sm { display: inline; } }

/* Buttons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px;
       border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid var(--line-strong);
       color: var(--text); background: var(--card); cursor: pointer; line-height: 1.3; white-space: nowrap;
       transition: transform .25s var(--ease-out), background .2s, border-color .2s, box-shadow .25s var(--ease-out); }
.btn:hover { color: var(--text); border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text);
               box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text);
                     box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.small { padding: 8px 16px; font-size: .9rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, var(--line)); background: transparent; }
.btn.danger:hover { color: var(--err); border-color: var(--err); background: color-mix(in srgb, var(--err) 8%, transparent); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn .arrow { transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* "How to connect" steps (shared partial: _como_conectar.html) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.steps > li { counter-increment: step; background: var(--card); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 26px 26px 14px 78px; position: relative; min-width: 0;
              transition: border-color .2s, box-shadow .3s var(--ease-out); }
.steps > li:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 24px; top: 24px;
                      font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.7rem;
                      line-height: 1; color: var(--accent); font-variation-settings: "opsz" 48, "SOFT" 100; }
.steps h3 { font-size: 1.2rem; margin: 2px 0 12px; }
.steps p { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .steps > li { padding: 22px 18px 10px; }
  .steps > li::before { position: static; display: block; margin-bottom: 10px; }
}
code.copy { display: inline-block; font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line-strong);
            border-radius: 8px; word-break: break-all; background: var(--bg); }
.copy-btn { margin-left: 8px; vertical-align: middle; font: inherit; font-size: .85rem; font-weight: 600;
            padding: 6px 14px; border-radius: 999px; border: 1px solid var(--accent); background: transparent;
            color: var(--accent); cursor: pointer; transition: background .2s; }
.copy-btn:hover { background: var(--accent-soft); }

/* Scroll reveal: hidden only when JS is on, so the page still works without it. */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in { opacity: 1; transform: none;
                 transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); }

/* Skeleton loading blocks. */
.skeleton { position: relative; overflow: hidden; background: var(--tag); border-radius: 8px; color: transparent; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
                   background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent);
                   animation: shimmer 1.6s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important;
                           transition-duration: .001s !important; }
  .js .reveal { opacity: 1; transform: none; }
}
