:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --ink: #102033;
  --muted: #5d697a;
  --subtle: #7a8797;
  --line: #dce5ef;
  --line-strong: #c9d6e3;
  --usp: #0b3b66;
  --usp-dark: #082a49;
  --accent: #0f766e;
  --accent-soft: #e6f5f3;
  --gold: #b88400;
  --shadow: 0 18px 50px rgba(16, 32, 51, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 45%, #eef3f8 100%);
  color: var(--ink);
  line-height: 1.62;
  font-size: 16px;
}

a { color: #075985; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
code { background: #eef4f8; border: 1px solid var(--line); border-radius: 0.45rem; padding: 0.05rem 0.35rem; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -999px; top: 1rem;
  background: var(--ink); color: #fff; padding: .65rem 1rem; border-radius: .7rem; z-index: 20;
}
.skip-link:focus { left: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(201, 214, 227, .75);
}
.header-inner {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem;
  color: var(--ink); text-decoration: none;
}
.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: 0 0 auto;
  box-shadow: 0 10px 25px rgba(11, 59, 102, .18);
}
.brand strong { display: block; letter-spacing: -0.015em; }
.brand small { display: block; color: var(--muted); font-size: .82rem; margin-top: .05rem; }
.site-nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 650;
  padding: .55rem .7rem; border-radius: 999px; font-size: .95rem;
}
.site-nav a:hover, .site-nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-toggle { display: none; }

.site-main { width: min(100% - 2rem, var(--max)); margin: 0 auto; padding: 2.2rem 0 4.5rem; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.3rem;
  align-items: stretch;
  margin-bottom: 2rem;
}
.hero-copy, .contact-card, .page-hero, .content-panel, .feature-card, .year-card, .archive-card, .note-card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(220, 229, 239, .92);
  box-shadow: var(--shadow);
}
.hero-copy {
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 4.2rem);
  position: relative;
  overflow: hidden;
}
.hero-copy::after {
  content: "";
  position: absolute; right: -7rem; bottom: -8rem;
  width: 20rem; height: 20rem; border-radius: 999px;
  background: radial-gradient(circle, rgba(184,132,0,.16), transparent 65%);
}
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; margin: 0 0 .55rem; }
h1, h2, h3 { line-height: 1.17; letter-spacing: -0.025em; margin: 0 0 .7rem; }
h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: 1.08rem; }
.lead { font-size: clamp(1.08rem, 2vw, 1.28rem); color: var(--muted); max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.65rem; position: relative; z-index: 1; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.65rem; padding: .62rem 1rem;
  border-radius: 999px; border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--ink); font-weight: 750;
  background: #fff;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(16,32,51,.08); }
.button.primary { background: var(--usp); color: #fff; border-color: var(--usp); }
.button.primary:hover { color: #fff; background: var(--usp-dark); }
.button.ghost { background: transparent; }
.contact-card { border-radius: var(--radius-lg); padding: 1.6rem; }
.contact-card h2 { font-size: 1.25rem; }
.contact-card p { margin: .7rem 0; color: var(--muted); }

.section-block { margin-top: 2.2rem; }
.section-heading { margin-bottom: 1rem; }
.cards-grid, .feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-card, .note-card, .content-panel, .archive-card, .year-card { border-radius: var(--radius-md); padding: 1.35rem; }
.feature-card { display: flex; flex-direction: column; min-height: 225px; }
.feature-card.highlight { background: linear-gradient(135deg, #ffffff, #f1faf8); }
.card-kicker { color: var(--gold); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.feature-card p, .note-card p, .content-panel p { color: var(--muted); }
.card-link { margin-top: auto; font-weight: 800; text-decoration: none; }
.card-link::after { content: " →"; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 1rem; align-items: start; }
.link-list { display: grid; gap: .75rem; margin-top: 1rem; }
.link-list a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1rem; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.link-list span { color: var(--muted); }
.note-card { background: linear-gradient(180deg, #fff, #f8fbff); }

.page-hero { border-radius: var(--radius-lg); padding: clamp(1.7rem, 4vw, 3rem); margin-bottom: 1.7rem; }
.page-hero.compact h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.page-hero p:last-child { max-width: 72ch; color: var(--muted); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.project-card a { display: block; height: 100%; color: inherit; text-decoration: none; }
.project-card {
  border-radius: 24px; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(16,32,51,.12); }
.mini-page {
  margin: 1rem 1rem 0; min-height: 210px; border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #eef6f7);
  border: 1px solid var(--line); padding: .85rem;
  display: flex; flex-direction: column; gap: .55rem;
}
.mini-top { display: flex; gap: .28rem; }
.mini-top span { width: .48rem; height: .48rem; border-radius: 999px; background: var(--line-strong); }
.mini-title { width: fit-content; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .22rem .55rem; font-size: .68rem; font-weight: 800; }
.mini-headline { font-weight: 900; color: var(--usp); line-height: 1.05; max-width: 15ch; }
.mini-lines { display: grid; gap: .34rem; margin-top: .15rem; }
.mini-lines span { height: .5rem; border-radius: 999px; background: #dbe7f1; }
.mini-lines span:nth-child(2n) { width: 82%; }
.mini-lines span:nth-child(3n) { width: 68%; }
.mini-pill { margin-top: auto; align-self: flex-start; background: var(--usp); color: #fff; border-radius: 999px; padding: .28rem .65rem; font-weight: 850; font-size: .8rem; }
.project-info { padding: 1rem 1.1rem 1.25rem; }
.project-info p { color: var(--muted); margin-bottom: 0; }
.editor-note { border-style: dashed; }

.toolbar-note { background: #fff7e6; border: 1px solid #f1d99b; color: #725300; padding: 1rem 1.1rem; border-radius: var(--radius-md); margin-bottom: 1rem; }
.year-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.year-card h2 { color: var(--usp); border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.semester { margin-top: 1rem; }
.semester h3 { color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.course-list, .archive-list, .clean-list { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .55rem; }
.course-list a, .course-static, .archive-list a {
  display: flex; justify-content: space-between; gap: .75rem; align-items: baseline;
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft);
  text-decoration: none; color: var(--ink);
}
.course-list span span, .archive-list span { color: var(--muted); font-size: .92rem; }
.course-static { opacity: .85; }
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pill-row a { display: inline-flex; padding: .45rem .7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; font-weight: 750; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.archive-card:first-child { grid-column: 1 / -1; }
.archive-list a { align-items: center; }
.archive-list a span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.legacy-content { overflow-x: auto; }
.legacy-content h1, .legacy-content h2, .legacy-content h3 { margin-top: 1.4rem; }
.legacy-content center { display: block; text-align: left; font-weight: 800; color: var(--usp); margin: .65rem 0; }
.legacy-content table { max-width: 100%; border-collapse: collapse; margin: .7rem 0; }
.legacy-content table[border="1"], .legacy-content table[border="1"] td, .legacy-content table[border="1"] th { border: 1px solid var(--line-strong); }
.legacy-content td, .legacy-content th { padding: .45rem; vertical-align: top; }
.legacy-content hr { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.legacy-content ul { padding-left: 1.2rem; }
.legacy-content a[target="_blank"]::after { content: " ↗"; font-size: .8em; }
.legacy-content .muted-link { color: var(--muted); font-weight: 700; }
.readable { max-width: 850px; }
.clean-list { list-style: none; }
.clean-list li { margin: .4rem 0; }

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  padding: 1.6rem max(1rem, calc((100% - var(--max)) / 2));
  color: var(--muted);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer-links { display: flex; gap: .8rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 750; }
.footer-links a:hover { color: var(--accent); }
.site-version { display: inline-block; margin-top: .35rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }

@media (max-width: 920px) {
  .hero, .two-columns { grid-template-columns: 1fr; }
  .cards-grid, .feature-grid, .project-grid, .year-grid, .archive-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 68px; align-items: center; }
  .nav-toggle {
    display: inline-flex; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .55rem .75rem; font-weight: 800; color: var(--ink);
  }
  .site-nav {
    display: none; position: absolute; left: 1rem; right: 1rem; top: 68px;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    padding: .6rem;
  }
  .site-nav.open { display: grid; grid-template-columns: 1fr 1fr; }
  .site-nav a { border-radius: 12px; }
  .cards-grid, .feature-grid, .project-grid, .year-grid, .archive-grid { grid-template-columns: 1fr; }
  .link-list a, .course-list a, .course-static, .archive-list a { flex-direction: column; gap: .25rem; align-items: flex-start; }
  .site-main { width: min(100% - 1rem, var(--max)); padding-top: 1rem; }
}


/* Página principal minimalista, idioma e tema */
html:not([data-lang]) [data-lang="en"],
html[data-lang="pt"] [data-lang="en"] { display: none !important; }
html[data-lang="en"] [data-lang="pt"] { display: none !important; }
html:not([data-theme="dark"]) .theme-when-dark { display: none !important; }
html[data-theme="dark"] .theme-when-light { display: none !important; }

html[data-theme="dark"] {
  --bg: #07111f;
  --panel: #0f1b2d;
  --panel-soft: #111f33;
  --ink: #eef5ff;
  --muted: #bac7d7;
  --subtle: #8fa1b7;
  --line: #26384f;
  --line-strong: #38526f;
  --usp: #8fc7ff;
  --usp-dark: #b8dbff;
  --accent: #6ee7d8;
  --accent-soft: rgba(110, 231, 216, 0.13);
  --gold: #ffd166;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(110, 231, 216, 0.10), transparent 34rem),
    linear-gradient(180deg, #07111f 0%, #0a1423 55%, #050b14 100%);
}
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer {
  background: rgba(7, 17, 31, 0.86);
  border-color: rgba(56, 82, 111, 0.8);
}
html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .content-panel,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .year-card,
html[data-theme="dark"] .archive-card,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .home-intro,
html[data-theme="dark"] .home-info-card {
  background: rgba(15, 27, 45, 0.88);
  border-color: rgba(56, 82, 111, 0.88);
}
html[data-theme="dark"] a { color: #9fd4ff; }
html[data-theme="dark"] a:hover { color: var(--accent); }
html[data-theme="dark"] .button,
html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .link-list a,
html[data-theme="dark"] .course-list a,
html[data-theme="dark"] .course-static,
html[data-theme="dark"] .archive-list a {
  background: rgba(17, 31, 51, 0.94);
  color: var(--ink);
  border-color: var(--line-strong);
}
html[data-theme="dark"] .button.primary {
  background: #174d80;
  color: #fff;
  border-color: #2d6ba4;
}
html[data-theme="dark"] .feature-card.highlight,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .toolbar-note {
  background: linear-gradient(180deg, rgba(17, 31, 51, 0.98), rgba(11, 24, 40, 0.98));
  color: var(--muted);
}
html[data-theme="dark"] .mini-page { background: linear-gradient(180deg, #102238, #0e1a2b); }
html[data-theme="dark"] .mini-lines span { background: #26384f; }
html[data-theme="dark"] code { background: #0a1423; border-color: var(--line); color: var(--ink); }

.header-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .42rem;
  flex: 0 0 auto;
}
.tool-button {
  min-height: 2.3rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-radius: 999px;
  padding: .45rem .72rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
}
.tool-button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(16,32,51,.08); }

.home-minimal .site-main.home-main {
  width: min(100% - 2rem, 920px);
  padding-top: clamp(1.15rem, 3vw, 2.2rem);
}
.home-intro {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 5vw, 3rem);
  text-align: left;
}
.home-intro h1 {
  max-width: none;
  margin-bottom: 0.75rem;
  font-size: clamp(2.8rem, 7vw, 4.35rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}
.home-intro h1 span { display: block; }
.home-intro .lead { max-width: 92ch; font-size: 1.05rem; }
.home-linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.1rem;
}
.home-linkrow a {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: .38rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
}
.home-linkrow a:hover { color: var(--accent); border-color: var(--accent); }
.signature-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  margin-top: clamp(1.5rem, 4vw, 2.6rem);
}
.signature-link {
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .65rem;
  padding: .95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  text-decoration: none;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.signature-link strong { line-height: 1.1; letter-spacing: -0.03em; font-size: 1rem; }
.signature-link span { color: var(--muted); font-size: .86rem; }
.signature-link:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 38px rgba(16, 32, 51, .10);
}
.signature-main {
  background: linear-gradient(135deg, var(--usp), var(--accent));
  color: #fff;
  border-color: transparent;
}
.signature-main span, .signature-main:hover, .signature-main:hover span { color: #fff; }
.home-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.home-info-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.home-info-card h2 { font-size: 1.18rem; }
.home-info-card p { color: var(--muted); margin: .65rem 0 0; }
.quiet-list { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .55rem; }
.quiet-list a { font-weight: 750; text-decoration: none; }
.compact-section { margin-top: 1.4rem; }
.inline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.button.subtle { background: var(--panel-soft); }
.home-projects.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-projects .feature-card { min-height: 180px; }
.home-projects .feature-card h3 a { color: inherit; text-decoration: none; }
.course-current {
  border-color: rgba(15, 118, 110, .35) !important;
  background: var(--accent-soft) !important;
}
.course-current strong::after {
  content: " atual";
  display: inline-flex;
  margin-left: .45rem;
  padding: .08rem .45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.course-static.is-disabled {
  opacity: .58;
  cursor: default;
  filter: grayscale(.18);
}

@media (max-width: 1040px) {
  .signature-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header-inner { gap: .5rem; }
  .brand small { display: none; }
  .brand-mark { width: 38px; height: 38px; border-radius: 13px; }
  .tool-button { min-height: 2.1rem; padding: .38rem .58rem; font-size: .78rem; }
  .header-tools { gap: .3rem; }
  .home-minimal .site-main.home-main { width: min(100% - 1rem, 980px); padding-top: 1rem; }
  .home-intro { border-radius: 24px; padding: 1.45rem; }
  .home-linkrow { gap: .45rem; }
  .signature-links, .home-info-grid, .home-projects.feature-grid { grid-template-columns: 1fr; }
  .signature-link { min-height: 92px; }
  .inline-heading { align-items: flex-start; flex-direction: column; }
}


.site-version {
  display: inline-block;
  margin-top: .35rem;
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--subtle);
}
.disabled-link {
  color: var(--muted);
  opacity: .72;
  cursor: not-allowed;
  text-decoration: none;
}
.legacy-content pre {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 1rem;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.legacy-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
}
html[data-theme="dark"] body.home .home-linkrow a {
  color: #eaf2ff !important;
  background: rgba(147, 197, 253, 0.12) !important;
  border-color: rgba(147, 197, 253, 0.45) !important;
}

html[data-theme="dark"] body.home .home-linkrow a:hover {
  color: #ffffff !important;
  background: rgba(147, 197, 253, 0.22) !important;
  border-color: #93c5fd !important;
}
