/* =========================================================
   TEC1 CONECTA — Sistema visual base
   E.E.S.T. N° 1 · José C. Paz
   Tokens, reset, tipografía, header, footer y componentes
   compartidos por el sitio público.
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marca */
  --navy-900: #07182c;
  --navy-800: #0a2340;
  --navy-700: #0d2f52;
  --blue-600: #1d4ed8;
  --blue-500: #2f66e8;
  --gold-500: #c9a227;
  --gold-400: #e0bb4d;
  --gold-700: #8a6a12;
  --gold-100: #f6ecc9;
  --red-500: #b42318;
  --green-600: #1c7a4a;

  /* Neutros cálidos */
  --paper: #f8f6f1;
  --paper-2: #f1ede4;
  --paper-3: #e7e1d4;
  --white: #ffffff;

  /* Texto */
  --ink: #0d1f33;
  --ink-2: #34495e;
  --ink-3: #5d7086;
  --ink-4: #8a9aab;

  /* Líneas y sombras */
  --line: rgba(13, 31, 51, 0.12);
  --line-strong: rgba(13, 31, 51, 0.22);
  --shadow-sm: 0 1px 2px rgba(7, 24, 44, 0.06), 0 6px 18px rgba(7, 24, 44, 0.06);
  --shadow-md: 0 2px 4px rgba(7, 24, 44, 0.06), 0 18px 44px rgba(7, 24, 44, 0.12);
  --shadow-lg: 0 30px 80px rgba(7, 24, 44, 0.18);

  /* Formas */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;
  --r-pill: 999px;

  /* Tipografía */
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --container: 1180px;
  --header-h: 76px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4.3rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 1.5vw, 1.32rem); font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--blue-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--navy-700); }

ul, ol { margin: 0 0 1rem; padding-left: 1.2em; }

strong { font-weight: 650; }

::selection {
  background: var(--gold-100);
  color: var(--navy-900);
}

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

[hidden] { display: none !important; }

/* ---------- 3. Utilidades ---------- */
.container {
  width: min(100% - 3rem, var(--container));
  margin-inline: auto;
}

.container--narrow { max-width: 820px; }

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }

.section--paper { background: var(--paper); }
.section--white { background: var(--white); }
.section--ink {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.82);
}
.section--ink h2,
.section--ink h3 { color: #fff; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 62ch;
}

.muted { color: var(--ink-3); }

.text-center { text-align: center; }
.text-center .lead { margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--gold-500);
  color: var(--navy-900);
  padding: 0.85rem 1.25rem;
  font-weight: 650;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 4. Botones ---------- */
.btn {
  --btn-bg: var(--navy-800);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(7, 24, 44, 0.18);
}
.btn:active { transform: translateY(0); }

.btn--gold { --btn-bg: var(--gold-500); --btn-fg: var(--navy-900); }
.btn--gold:hover { --btn-bg: var(--gold-400); }

.btn--ink { --btn-bg: var(--navy-900); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--navy-800);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  --btn-bg: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn--ghost-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  border-color: rgba(255, 255, 255, 0.34);
}
.btn--ghost-light:hover { --btn-bg: rgba(255, 255, 255, 0.08); }

.btn--sm { min-height: 40px; padding: 0.6rem 1.05rem; font-size: 0.85rem; }

.btn--block { width: 100%; }

.btn svg { width: 18px; height: 18px; flex: none; }

.arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow,
.link-arrow:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--navy-800);
}
.link-arrow .arrow { color: var(--gold-500); }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 241, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px rgba(7, 24, 44, 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand:hover { color: var(--ink); }

.brand__mark {
  width: 42px;
  height: 42px;
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand__name span { color: var(--gold-700); }
.brand__sub {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a:hover { color: var(--ink); background: rgba(13, 31, 51, 0.05); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--gold-500);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Acceso con sesión: iniciales y rol en lugar de "Ingresar". */
.header-user {
  --avatar-bg: var(--navy-800);
  --avatar-tinta: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.7rem 0.28rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.header-user:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 5px 18px rgba(7, 24, 44, 0.08);
  transform: translateY(-1px);
}
.header-user__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-tinta);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.header-user__info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.header-user__info b {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 650;
}
.header-user__info small {
  margin-top: 3px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.header-user[data-rol="docente"] { --avatar-bg: #1d4ed8; }
.header-user[data-rol="alumno"] { --avatar-bg: #c9a227; --avatar-tinta: #241c00; }
.header-user[data-rol="padre"] { --avatar-bg: #1c7a4a; }
.header-user[data-rol="direccion"],
.header-user[data-rol="subdireccion"] { --avatar-bg: #0f766e; }
.header-user[data-rol="admin"] { --avatar-bg: #07182c; }

@media (max-width: 760px) {
  .header-user { padding: 0.2rem; border: 0; background: transparent; }
  .header-user__avatar { width: 38px; height: 38px; }
  .header-user__info { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    max-height: calc(100dvh - var(--header-h));
    overflow: auto;
  }
  .site-nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .site-nav a {
    padding: 0.9rem 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--blue-600); }
  .header-actions .btn { display: none; }
  .header-actions .nav-toggle { display: block; }
}

@media (max-width: 420px) {
  .brand__sub { display: none; }
  .brand__mark { width: 38px; height: 38px; }
}

/* ---------- 6. Cards ---------- */
.card {
  position: relative;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.card h3 { margin-bottom: 0.45rem; }
.card p { color: var(--ink-3); font-size: 0.94rem; }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  border-radius: 13px;
  background: var(--gold-100);
  color: var(--navy-800);
}
.card__icon svg { width: 22px; height: 22px; }

.card__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--gold-500);
  display: block;
  margin-bottom: 0.85rem;
}

/* ---------- 7. Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
  font-size: 0.9rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer .brand { color: #fff; margin: 0 0 1rem; }
.site-footer .brand__name span { color: var(--gold-400); }
.site-footer .brand__sub { color: rgba(255, 255, 255, 0.5); }

.site-footer__about { max-width: 34ch; color: rgba(255, 255, 255, 0.62); }

.site-footer h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.site-footer a {
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.52);
}

@media (max-width: 780px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ---------- 8. Animación de entrada ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

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

/* ---------- 9. Impresión ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 1.2rem 0; }
}
