/* ==========================================================================
   Especialização em Inteligência Artificial para Professores — UFPR / SEPT
   Folha de estilo do site. HTML, CSS e JS puros.
   ========================================================================== */

/* ---------- Fonte: Atkinson Hyperlegible Next (auto-hospedada) ---------- */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/atkinson-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/atkinson-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/atkinson-next-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/atkinson-next-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens: o quadro branco e as quatro canetas ---------- */
:root {
  --board: #ffffff;            /* superfície do quadro */
  --wall: #eef0f3;             /* parede atrás do quadro */
  --frame: #d3d8de;            /* moldura de alumínio */
  --ink: #1c2430;              /* caneta azul-escura: texto */
  --ink-2: #46607a;            /* texto secundário, tingido do azul */
  --blue: #00548e;             /* caneta azul UFPR: títulos, traços */
  --sky: #0096c7;              /* azul claro: links, foco */
  --coral: #f0654a;            /* caneta coral: só traços de urgência */
  --coral-ink: #c8462b;        /* coral escurecido para texto pequeno */
  --green: #3ba55d;            /* caneta verde: marcações */
  --green-ink: #2b7d45;        /* verde escurecido para texto */
  --yellow: #e3a600;           /* caneta amarela: marcações raras */
  --highlight: #ffe58a;        /* seleção de texto */
  --rule: #e2e6ea;             /* filete fino */

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", Roboto, system-ui, sans-serif;
  --measure: 66ch;
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --draw: 900ms;

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--wall);
  scrollbar-color: var(--blue) var(--wall);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--board);
  caret-color: var(--blue);
  accent-color: var(--blue);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 48em) {
  body { font-size: 1.125rem; }
}

::selection { background: var(--highlight); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a {
  color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--sky);
}
a:hover { color: var(--sky); }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
strong { font-weight: 700; }

h1, h2, h3 {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.1rem + 4.6vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h3 { font-size: 1.125rem; color: var(--ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  padding: 0.5rem 0.9rem; background: var(--ink); color: #fff;
  border-radius: 4px; z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- O quadro na parede ---------- */
.board {
  background: var(--board);
  min-height: 100vh;
}
@media (min-width: 60em) {
  .board {
    margin: 1rem;
    min-height: calc(100vh - 2rem);
    border: 1px solid var(--frame);
    border-radius: 8px;
      }
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---------- Traços de caneta (SVG) ---------- */
.ink {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
/* Espessuras em unidades do viewBox de cada traço (o SVG é esticado, como
   a ponta chanfrada do canetão engrossa conforme a direção do traço). */
.ink-under .ink { stroke-width: 3; }
.ink-circle .ink { stroke-width: 2.6; }
.week .ink-ring .ink { stroke-width: 3.5; }
.avatar .ink-ring .ink { stroke-width: 2.2; }
.ink--coral { stroke: var(--coral); }
.ink--green { stroke: var(--green); }
.ink--yellow { stroke: var(--yellow); }

/* O traço aparece "escrito": só com JS e só para quem aceita movimento. */
.js [data-draw] .ink { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js [data-draw].is-drawn .ink { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-draw].is-drawn .ink {
    transition: stroke-dashoffset var(--draw) var(--ease-out);
    transition-delay: var(--draw-delay, 0ms);
  }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-draw] .ink { stroke-dashoffset: 0; }
}

/* Palavra sublinhada com traço de caneta */
.underlined { position: relative; display: inline-block; white-space: nowrap; }
.underlined .ink-under {
  position: absolute; left: -0.5%; right: -0.5%; bottom: -0.08em;
  width: 101%; height: 0.22em;
}
@media (max-width: 40em) {
  /* Em telas estreitas a expressão precisa quebrar: o traço passa a ser
     um fundo repetido por linha, sem animação. */
  .underlined { display: inline; white-space: normal;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 40 3, 80 12, 120 6 S 180 11, 197 5' fill='none' stroke='%2300548e' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: 100% 0.2em; background-position: 0 100%;
    padding-bottom: 0.06em;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .underlined .ink-under { display: none; }
}

/* As duas expressões do título escritas com outras canetas */
.word-ia { color: var(--sky); }
.word-prof { color: var(--green-ink); }

/* Trecho circulado com caneta coral */
.circled { position: relative; display: inline-block; padding: 0.15em 0.4em; white-space: nowrap; }
.circled .ink-circle {
  position: absolute; inset: -0.3em -0.4em -0.35em -0.4em;
  width: calc(100% + 0.8em); height: calc(100% + 0.65em);
}

/* Traço de marca-texto amarelo atrás de uma palavra */
.hl { position: relative; display: inline-block; }
.hl .ink-hl { position: absolute; left: -0.2em; right: -0.2em; bottom: 0.02em; width: calc(100% + 0.4em); height: 0.8em; z-index: -1; }
.hl .ink-hl .ink { stroke-width: 14; opacity: 0.5; stroke-linecap: butt; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
  padding-block: 0.75rem;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: var(--ink);
  margin-right: auto;
}
.brand img { width: 2.75rem; height: auto; }
.brand-name { font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; font-size: 1.05rem; }
.brand-name small { display: block; font-weight: 500; color: var(--ink-2); font-size: 0.8rem; letter-spacing: 0.01em; }

.site-nav ul { display: flex; gap: 0.25rem 1.25rem; list-style: none; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; font-weight: 600; color: var(--ink);
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--sky); color: var(--blue); }

@media (max-width: 47.99em) {
  .site-header .container { padding-block: 0.6rem; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .site-nav ul { flex-wrap: nowrap; gap: 1.1rem; white-space: nowrap; padding-bottom: 0.15rem; }
  .site-nav a { font-size: 0.95rem; }
  .site-header .header-cta { display: none; }
}

/* ---------- Botões ---------- */
.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font: inherit; font-weight: 700; line-height: 1.3;
  color: #fff; background: var(--blue);
  border: 2px solid var(--blue); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.button:hover { background: var(--sky); border-color: var(--sky); color: #fff; }
.button:active { transform: translateY(1px); }
.button[disabled], .button[aria-disabled="true"] {
  color: var(--ink-2); background: transparent;
  border-style: dashed; border-color: var(--ink-2);
  cursor: not-allowed;
}
.button[disabled]:hover { background: transparent; }

.button--secondary {
  color: var(--blue); background: transparent;
}
.button--secondary:hover { background: #eaf6fb; color: var(--blue); border-color: var(--blue); }

/* ---------- Seções ---------- */
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section > .container > h2 { margin-bottom: 0.6em; }
.section .lead { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.35rem); color: var(--ink-2); margin-bottom: 2rem; }

/* ---------- Abertura ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem); }
.hero .container {
  display: grid; gap: 1.75rem 4rem;
  grid-template-columns: 1fr;
  grid-template-areas: "title" "notice" "actions" "facts";
  align-items: start;
}
@media (min-width: 60em) {
  .hero .container {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "title notice" "actions notice" "facts facts";
    gap: 1.25rem 4rem;
  }
}
.hero-title { grid-area: title; container-type: inline-size; }
.notice { grid-area: notice; }
.hero-actions { grid-area: actions; }
.facts { grid-area: facts; }
.hero h1 { max-width: 16ch; margin-bottom: 1rem; font-size: clamp(2.25rem, 11cqi, 4.25rem); }
.hero .lead { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); line-height: 1.4; color: var(--ink); margin-bottom: 0; max-width: 34ch; position: relative; z-index: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.hero-actions .note { color: var(--ink-2); font-size: 0.95rem; flex-basis: 100%; }

/* O aviso escrito no quadro */
.notice { padding-top: 0.5rem; padding-inline-end: 0.6em; container-type: inline-size; }
.notice-word { font-weight: 600; color: var(--ink); font-size: 1.05rem; display: block; margin-bottom: 0.35rem; }
.notice-dates {
  margin: 0 0 1.1rem;
  font-size: clamp(1.35rem, 0.9rem + 2.4vw, 2.4rem);
  font-size: clamp(1.25rem, 7.1cqi, 2.4rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink);
}
.notice-dates .circled { margin-left: 0.3em; }
.notice-dates time { white-space: nowrap; }
.ink-arrow { display: inline-block; width: 1.1em; height: 0.66em; vertical-align: -0.08em; margin: 0 0.12em; }
.ink-arrow .ink { stroke-width: 3.6; }
.notice p { max-width: 30ch; margin-bottom: 0.4rem; }
.notice .fine { font-size: 0.95rem; color: var(--ink-2); }

/* Fatos, escritos em uma linha */
.facts {
  list-style: none; margin-top: 1rem; padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-weight: 500; line-height: 1.7; color: var(--ink);
}
.facts li { display: inline; }
.facts li:not(:last-child)::after { content: "\00a0·"; color: var(--blue); font-weight: 800; margin-right: 0.55em; white-space: nowrap; }
.facts b { font-weight: 800; color: var(--blue); white-space: nowrap; }

/* ---------- Listas com marca de caneta ---------- */
.check-list { list-style: none; display: grid; gap: 0.75rem; max-width: var(--measure); }
.check-list li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; align-items: start; }
.check-list .check { width: 1.5rem; height: 1.5rem; margin-top: 0.15em; }
.check-list .ink { stroke-width: 3; }

.two-col { display: grid; gap: 2.5rem 4rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 56em) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- A semana no quadro ---------- */
.week {
  display: flex; gap: clamp(0.35rem, 1.5vw, 0.9rem); align-items: center;
  list-style: none; margin: 0.5rem 0 1.75rem;
  font-weight: 700; font-size: clamp(1.25rem, 1rem + 1.4vw, 1.9rem); color: var(--ink-2);
}
.week li { position: relative; width: 2.2em; text-align: center; line-height: 2.2em; }
.week li.is-class { color: var(--ink); }
.week .ink-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.week-caption { font-weight: 600; color: var(--ink); margin-bottom: 1.25rem; position: relative; z-index: 0; }
.week-caption strong { color: var(--coral-ink); }

/* ---------- Disciplinas ---------- */
.subjects {
  list-style: none; counter-reset: subject;
  display: grid; gap: 0.25rem 3rem; grid-template-columns: 1fr;
}
@media (min-width: 56em) { .subjects { grid-template-columns: 1fr 1fr; } }
.subjects li {
  counter-increment: subject;
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.75rem; align-items: baseline;
  padding: 0.7rem 0; border-bottom: 1px solid var(--rule);
}
.subjects li::before {
  content: counter(subject);
  font-weight: 800; font-size: 1.35rem; color: var(--blue); line-height: 1;
}
.subjects .body { display: block; }
.subjects .name { font-weight: 700; display: block; }
.subjects .teacher { color: var(--ink-2); font-size: 0.95rem; display: block; }
.subjects-cta { margin-top: 1.75rem; }

/* ---------- Docentes ---------- */
.people { list-style: none; display: grid; gap: 1.25rem 2.5rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 40em) { .people { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64em) { .people { grid-template-columns: 1fr 1fr 1fr; } }
.person { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; align-items: center; }
.avatar { position: relative; width: 4.5rem; height: 4.5rem; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 1.2rem; color: var(--blue); letter-spacing: 0.02em;
}
.avatar .ink-ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); }
.person .name { font-weight: 700; display: block; line-height: 1.3; }
.person .role { color: var(--ink-2); font-size: 0.95rem; display: block; margin-top: 0.15rem; }
.person .role em { font-style: normal; color: var(--coral-ink); font-weight: 600; }

/* ---------- Documentos e links ---------- */
.link-list { list-style: none; display: grid; gap: 0.35rem; }
.link-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--rule);
}
.link-list a { font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.link-list .ext { width: 1rem; height: 1rem; }
.link-list .ext .ink { stroke-width: 2.5; }
.link-list .soon { color: var(--ink-2); font-size: 0.9rem; white-space: nowrap; }
.link-list .pending { color: var(--ink-2); font-weight: 600; }

/* ---------- Rodapé: a bandeja do quadro ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2.5rem 2rem; color: var(--ink-2); font-size: 0.95rem; }
.site-footer .container { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 56em) { .site-footer .container { grid-template-columns: 1fr auto; align-items: center; } }

/* Assinatura institucional: UFPR e SEPT */
.institutions { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.institutions a { display: block; line-height: 0; border-radius: 4px; }
.institutions img { width: auto; height: 3.75rem; }
.institutions img[alt^="SEPT"] { height: 3.1rem; }
@media (min-width: 56em) { .institutions { justify-content: flex-end; } }
.site-footer p { margin-bottom: 0.35rem; }
.site-footer .sig { display: flex; align-items: center; gap: 0.8rem; color: var(--ink); font-weight: 700; margin-bottom: 0.75rem; }
.site-footer .sig img { width: 2.25rem; }

.site-footer { padding-bottom: 0; }
.site-footer > .container { padding-bottom: 2rem; }
.tray {
  position: relative; height: 14px; margin-top: 2.5rem;
  border-top: 2px solid #c9ced5; background: #e6e9ed;
}
@media (min-width: 60em) { .tray { border-radius: 0 0 7px 7px; } }
.tray-markers {
  position: absolute; right: var(--gutter); bottom: 12px;
  width: 300px; height: 30px;
}
@media (max-width: 40em) { .tray-markers { width: 240px; height: 24px; bottom: 12px; } }

/* ---------- Páginas internas: O curso e Documentos ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-title { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); line-height: 1.1; max-width: 20ch; margin-bottom: 1rem; }
.page-head .lead { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem); line-height: 1.45; color: var(--ink); max-width: 60ch; margin-bottom: 0; }
.page-head .facts { margin-top: 1.5rem; }

.button--small { padding: 0.45rem 0.9rem; font-size: 0.95rem; }
.toggle-all { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.syllabus { list-style: none; border-top: 1px solid var(--rule); }
.syllabus > li { border-bottom: 1px solid var(--rule); }
.syllabus summary {
  display: grid; grid-template-columns: 2.5rem 1fr 1.5rem; gap: 0.75rem; align-items: center;
  padding: 0.9rem 0; cursor: pointer; list-style: none;
}
.syllabus summary::-webkit-details-marker { display: none; }
.syllabus summary:hover .name { color: var(--sky); }
.syllabus .num { font-weight: 800; font-size: 1.35rem; color: var(--blue); line-height: 1; }
.syllabus .head { display: grid; gap: 0.15rem; }
.syllabus .name { font-weight: 700; font-size: 1.1rem; line-height: 1.35; }
.syllabus .meta { color: var(--ink-2); font-size: 0.95rem; }
.syllabus .chev { width: 1.5rem; height: 1.5rem; transition: transform 240ms var(--ease-out); }
.syllabus .chev .ink { stroke-width: 2.5; }
.syllabus details[open] .chev { transform: rotate(90deg); }
.details-body { padding: 0.25rem 0 1.5rem 3.25rem; }
.details-body h3 { font-size: 0.95rem; color: var(--ink-2); font-weight: 700; margin: 1rem 0 0.35rem; }
.details-body p { max-width: var(--measure); }
.refs { list-style: none; display: grid; gap: 0.4rem; max-width: var(--measure); font-size: 0.95rem; color: var(--ink); }
.refs li { padding-left: 1rem; text-indent: -1rem; }
@media (max-width: 40em) {
  .syllabus summary { grid-template-columns: 2rem 1fr 1.25rem; }
  .details-body { padding-left: 0; }
}
