/* =====================================================================
   Net2d - site de apresentacao do mestrado
   Estetica tecnico-academica moderna. Tema escuro com acentos ciano/azul.
   ===================================================================== */

:root {
  --bg: #0b1020;
  --bg-soft: #111830;
  --bg-card: #151d38;
  --bg-card-2: #1a2444;
  --border: #26304f;
  --border-soft: #1e2740;
  --text: #e8ecf6;
  --text-soft: #aab3cc;
  --text-dim: #7e88a6;
  --accent: #38bdf8;       /* ciano - rede */
  --accent-2: #818cf8;     /* indigo */
  --accent-3: #34d399;     /* verde - resultados */
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1140px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(11, 16, 32, 0.78);
  --glow-1: rgba(56, 189, 248, 0.10);
  --glow-2: rgba(129, 140, 248, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  /* cores por fase */
  --p1: #38bdf8;
  --p2: #22d3ee;
  --p3: #f472b6;
  --p4: #a78bfa;
  --p5: #34d399;
  --p6: #fbbf24;

  /* superficie do hero/arte de capa (adapta ao tema) */
  --art-bg: #0e1530;
  --art-node: #1a2444;
  --art-stroke: #2c375a;
}

/* ----------------------------- Tema claro ----------------------------- */
html[data-theme="light"] {
  --bg: #f5f8fd;
  --bg-soft: #eef3fb;
  --bg-card: #ffffff;
  --bg-card-2: #f1f5fc;
  --border: #d8e0ee;
  --border-soft: #e7ecf6;
  --text: #0f1830;
  --text-soft: #45506c;
  --text-dim: #6a7693;
  --accent: #0284c7;
  --accent-2: #6366f1;
  --accent-3: #059669;
  --shadow: 0 16px 40px rgba(30, 50, 90, 0.14);
  --header-bg: rgba(245, 248, 253, 0.82);
  --glow-1: rgba(56, 189, 248, 0.14);
  --glow-2: rgba(129, 140, 248, 0.12);
  /* cores de fase levemente escurecidas para legibilidade em fundo claro */
  --p1: #0ea5e9;
  --p2: #0891b2;
  --p3: #db2777;
  --p4: #7c3aed;
  --p5: #059669;
  --p6: #d97706;
  /* arte de capa permanece com superficie clara propria */
  --art-bg: #eef3fb;
  --art-node: #ffffff;
  --art-stroke: #cdd8ec;
}

/* o painel do diagrama de arquitetura usa cores fixas no SVG:
   mantemos um fundo escuro nos dois temas para consistencia visual */
.arch-wrap { --diagram-fixed: 1; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 600px at 78% -8%, var(--glow-1), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, var(--glow-2), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 62px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 1.15rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text-soft); padding: 7px 11px; border-radius: 8px;
  font-size: 0.92rem; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--bg-card); text-decoration: none; }

.lang-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); }
.lang-btn {
  font: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--text-dim); background: transparent; border: 0; cursor: pointer;
  padding: 5px 9px; border-radius: 6px; transition: all .15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active { color: #06121f; background: var(--accent); }

.header-controls { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-soft);
  font-size: 1rem; transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
html[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* ----------------------------- Video ----------------------------- */
.video-frame {
  position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-wrap { max-width: 860px; margin: 0 auto; }

/* ----------------------------- Hero ----------------------------- */
.hero { padding: 74px 0 38px; }
.kicker {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(56, 189, 248, 0.10); border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.08; letter-spacing: -0.025em;
  margin: 0 0 14px; font-weight: 820;
  background: linear-gradient(180deg, #fff 30%, #c7d2fe);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .hero h1 {
  background: linear-gradient(180deg, #0f1830 20%, #2a3a7a);
  -webkit-background-clip: text; background-clip: text;
}

/* hero em duas colunas com a figura de capa */
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 38px; align-items: center; }
.hero-art-card {
  background: var(--art-bg); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow);
}
.hero-art { display: block; width: 100%; height: auto; }
.ha-card { fill: var(--art-node); stroke: var(--art-stroke); }
.ha-track { stroke: var(--art-stroke); }
.ha-label { fill: var(--text-soft); font-size: 12px; font-family: var(--mono); }
.ha-title { fill: var(--text); font-size: 13.5px; font-weight: 700; }
.ha-flow { stroke: var(--accent); }
.hero .subtitle { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--text-soft); max-width: 50ch; margin: 0 0 22px; }
.hero .byline { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-dim); font-size: 0.95rem; margin-bottom: 26px; }
.hero .byline strong { color: var(--text); font-weight: 650; }
.hero .lede { max-width: 70ch; color: var(--text-soft); font-size: 1.02rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 0.96rem;
  padding: 12px 20px; border-radius: 11px; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121f; box-shadow: 0 10px 28px rgba(56, 189, 248, 0.28); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }

/* ----------------------------- Sections ----------------------------- */
section { padding: 46px 0; }
.section-head { margin-bottom: 30px; }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.02em; margin: 0 0 10px; }
.section-head p { color: var(--text-soft); max-width: 76ch; margin: 0; font-size: 1.02rem; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* Problem + axis */
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; align-items: start; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.panel h3 { margin: 0 0 12px; font-size: 1.2rem; }
.panel p { color: var(--text-soft); margin: 0; }

.axis { display: grid; gap: 14px; }
.axis-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.axis-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.axis-card.desired::before { background: var(--accent); }
.axis-card.operational::before { background: var(--accent-3); }
.axis-card h4 { margin: 0 0 6px; font-size: 1.05rem; }
.axis-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.axis-arrow { text-align: center; color: var(--accent); font-size: 1.4rem; line-height: 1; }

/* ----------------------------- Architecture ----------------------------- */
/* fundo escuro fixo: o SVG usa cores hex fixas e fica legivel nos dois temas */
.arch-wrap {
  background: linear-gradient(180deg, #111830, #151d38);
  border: 1px solid #26304f; border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); overflow-x: auto;
}
.arch-svg { display: block; width: 100%; height: auto; min-width: 720px; }
.chain-bar {
  margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  justify-content: center; padding: 16px; border: 1px dashed var(--border);
  border-radius: var(--radius); background: var(--bg-soft);
}
.chain-step { font-family: var(--mono); font-size: 0.85rem; color: var(--text); background: var(--bg-card-2); border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; }
.chain-sep { color: var(--accent); font-weight: 700; }

/* SVG node interactivity */
.node { cursor: pointer; transition: opacity .15s ease; }
.node:hover { opacity: 0.9; }
.node-rect { transition: filter .15s ease, stroke-width .15s ease; }
.node:hover .node-rect { filter: brightness(1.18); stroke-width: 2.4; }

/* ----------------------------- Three moves ----------------------------- */
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.move-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.move-card .num { font-family: var(--mono); color: var(--accent); font-size: 0.9rem; font-weight: 700; }
.move-card h4 { margin: 8px 0 8px; font-size: 1.15rem; }
.move-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ----------------------------- Timeline ----------------------------- */
.timeline { position: relative; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 26px; top: 8px; bottom: 8px; width: 3px;
  background: linear-gradient(180deg, var(--p1), var(--p2), var(--p3), var(--p4), var(--p5), var(--p6));
  border-radius: 3px; opacity: 0.7;
}
.tl-item { position: relative; padding: 0 0 22px 70px; }
.tl-node {
  position: absolute; left: 13px; top: 4px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--c, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: var(--c, var(--accent));
  box-shadow: 0 0 0 5px rgba(11, 16, 32, 0.9);
}
.tl-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--accent)); border-radius: var(--radius);
  padding: 18px 20px; transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.tl-card:hover { text-decoration: none; transform: translateX(4px); box-shadow: var(--shadow); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 7px; }
.tl-year { font-family: var(--mono); font-weight: 700; color: var(--c, var(--accent)); font-size: 0.9rem; }
.tag {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px;
  color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 38%, transparent);
}
.tl-venue { color: var(--text-dim); font-size: 0.85rem; }
.tl-card h3 { margin: 0 0 6px; font-size: 1.12rem; color: var(--text); letter-spacing: -0.01em; }
.tl-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.tl-go { margin-top: 10px; color: var(--c, var(--accent)); font-weight: 650; font-size: 0.9rem; }

/* ----------------------------- Phase detail page ----------------------------- */
.phase-hero { padding: 54px 0 10px; }
.crumbs { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 18px; }
.crumbs a { color: var(--text-soft); }
.phase-badge {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-family: var(--mono); font-size: 0.85rem; color: var(--c, var(--accent));
}
.phase-badge .pn {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c, var(--accent));
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.phase-hero h1 { font-size: clamp(1.6rem, 3.8vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 14px; }
.phase-hero .summary { font-size: 1.1rem; color: var(--text-soft); max-width: 78ch; }
.phase-metaline { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; color: var(--text-dim); font-size: 0.92rem; }
.phase-metaline .tag { color: var(--c); }

.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.block.full { grid-column: 1 / -1; }
.block.fit-block { border-color: color-mix(in srgb, var(--c, var(--accent)) 40%, var(--border)); background: linear-gradient(180deg, var(--bg-card), color-mix(in srgb, var(--c, var(--accent)) 6%, var(--bg-card))); }
.block-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.05rem; }
.block-title .ic { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); font-size: 0.9rem; }
.bullets { margin: 0; padding-left: 18px; color: var(--text-soft); }
.bullets li { margin-bottom: 9px; }
.bullets li::marker { color: var(--c, var(--accent)); }

.tool { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: var(--bg-card-2); }
.tool:last-child { margin-bottom: 0; }
.tool h4 { margin: 0 0 6px; font-family: var(--mono); font-size: 1rem; color: var(--c, var(--accent)); }
.tool p { margin: 0 0 10px; color: var(--text-soft); font-size: 0.94rem; }
.tool .repo-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 600; }

/* ----------------------------- Artigo: link + artefato + print do PDF ----------------------------- */
.paper-card { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: start; }
.paper-thumb {
  position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16); transition: transform .14s ease, box-shadow .2s ease, border-color .15s ease;
}
a.paper-thumb:hover { transform: translateY(-2px); border-color: var(--c, var(--accent)); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24); text-decoration: none; }
.paper-img { display: block; width: 100%; height: auto; }
.paper-thumb-hint {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 12px; font-size: 0.82rem; font-weight: 650;
  color: #fff; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74));
  opacity: 0; transition: opacity .16s ease;
}
a.paper-thumb:hover .paper-thumb-hint { opacity: 1; }
.paper-links { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.paper-venue { margin: 0 0 2px; color: var(--text-soft); font-size: 0.95rem; }
.paper-pending { margin: 0; color: var(--text-dim); font-style: italic; font-size: 0.92rem; }

.phase-nav { display: flex; justify-content: space-between; gap: 14px; margin: 30px 0 10px; flex-wrap: wrap; }
.phase-nav a { display: inline-flex; flex-direction: column; gap: 2px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; min-width: 200px; flex: 1; }
.phase-nav a:hover { text-decoration: none; border-color: var(--accent); }
.phase-nav .dir { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.phase-nav .ttl { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.phase-nav .next { text-align: right; align-items: flex-end; }

/* ----------------------------- Final product ----------------------------- */
.product-chain {
  font-family: var(--mono); font-size: 0.92rem; color: var(--text); text-align: center;
  background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 18px; margin: 8px 0 24px; line-height: 2;
}
.components { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.comp { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.comp h4 { margin: 0 0 8px; font-family: var(--mono); color: var(--accent); font-size: 1.02rem; }
.comp p { margin: 0 0 10px; color: var(--text-soft); font-size: 0.93rem; }
.comp .repo-link { font-size: 0.84rem; font-weight: 600; }

.note-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.note { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.note h3 { margin: 0 0 10px; font-size: 1.1rem; }
.note p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ----------------------------- Artifact seals ----------------------------- */
.phase-seals { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.seals-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.seal-chips { display: inline-flex; gap: 7px; }
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 8px; cursor: help;
  font-family: var(--mono); font-weight: 800; font-size: 0.82rem; color: #06121f;
  background: var(--accent-3); border: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.18);
}
.seal-d { background: var(--p1); }
.seal-f { background: var(--p4); color: #fff; }
.seal-s { background: var(--p5); }
.seal-r { background: var(--p6); }
.seal-link { font-size: 0.85rem; font-weight: 650; }

.tl-seals { display: inline-flex; gap: 6px; margin-top: 12px; }
.tl-seals .seal { width: 22px; height: 22px; border-radius: 6px; font-size: 0.72rem; cursor: default; }

/* ----------------------------- Repositorios em destaque ----------------------------- */
.repo-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-weight: 650; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .2s ease;
}
.repo-link:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56, 189, 248, 0.16); }

/* ----------------------------- Footer ----------------------------- */
.site-footer { border-top: 1px solid var(--border-soft); margin-top: 40px; padding: 34px 0; color: var(--text-dim); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-credit { margin-top: 16px; font-size: 0.85rem; color: var(--text-dim); }
.footer-credit a { font-weight: 600; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .moves { grid-template-columns: 1fr; }
  .phase-grid { grid-template-columns: 1fr; }
  .paper-card { grid-template-columns: 1fr; }
  .paper-thumb { max-width: 420px; }
  .note-cards { grid-template-columns: 1fr; }
  .nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-art-card { order: -1; max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
