/* El laboratorio de Beakman: la misma piel que la web de los tutores (docs/site.css).
   Bata verde lima, papel cuadriculado, Fredoka para títulos y Nunito para el texto. */
:root {
  color-scheme: light;
  --lime: #A6D41E;
  --lime-soft: #EEF6D6;
  --ink: #1F3A0B;
  --text: #1F2A17;
  --muted: #4E5A45;
  --paper: #FFFFFF;
  --card: #F4F6EC;
  --line: #DCE6C6;
  --grid: rgba(127, 168, 15, 0.10);
  --note: #F8EFCB;
  --note-line: #E8D27A;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--text); font: 17px/1.6 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  border-top: 6px solid var(--lime);
}
img { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--lime); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }

/* cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.face { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 3px solid var(--lime); box-shadow: 0 0 0 2px var(--ink);
  flex: none; background: var(--lime); }
.face img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
.brand b { display: block; font: 600 1.3rem/1.1 var(--display); color: var(--ink); }
.brand small { display: block; font-weight: 700; font-size: .85rem; color: #4F6B0A; }
.top nav { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-weight: 700; font-size: .95rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.lang { border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* portada */
.hero { padding-block: 26px 34px; display: grid; gap: 14px; max-width: 760px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 60%, rgba(166, 212, 30, .75) 60%, rgba(166, 212, 30, .75) 92%, transparent 92%); }
.lead { font-size: 1.2rem; }
section { padding-block: 10px 36px; }
section > h2 { font-size: 1.7rem; margin-bottom: 18px; }

/* tarjetas de asignatura */
.subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.subject { display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 4px 4px 0 var(--lime); text-decoration: none; color: var(--text); transition: transform .1s, box-shadow .1s; }
a.subject:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--lime); }
.subject img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 22%; border-bottom: 2px solid var(--ink); }
.subject.ciencias img { object-position: 75% 30%; }
.subject .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.subject h3 { font-size: 1.25rem; }
.subject p { font-size: .95rem; color: var(--muted); }
.subject.soon { border-color: var(--line); box-shadow: none; }
.subject.soon img { filter: grayscale(.85) opacity(.75); border-bottom-color: var(--line); }

.tag { justify-self: start; font-size: .85rem; font-weight: 800; color: var(--ink); background: var(--lime-soft); border-radius: 6px; padding: 2px 8px; }
.tag.soon { background: var(--note); color: #6B5A1E; }

/* tarjetas de recurso */
.resources { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.resource { display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 4px 4px 0 var(--lime); text-decoration: none; color: var(--text); transition: transform .1s, box-shadow .1s; }
.resource:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--lime); }
.resource img { display: block; width: 100%; height: auto; aspect-ratio: 800 / 423; object-fit: cover; object-position: left top; border-bottom: 2px solid var(--ink); }
.resource .body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.resource h3 { font-size: 1.25rem; }
.resource p { font-size: .97rem; color: var(--muted); }
.why { margin: 4px 0 0; padding-top: 10px; border-top: 1.5px dashed var(--line); display: grid; gap: 2px; }
.why dt { font: 600 .98rem/1.3 var(--display); color: var(--ink); }
.why dt:not(:first-child) { margin-top: 8px; }
.why dd { margin: 0; font-size: .93rem; line-height: 1.5; color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pc { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--muted);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.pc svg { width: 16px; height: 16px; }

/* página de asignatura */
.crumb { font-weight: 700; font-size: .95rem; }
.subject-head { display: flex; align-items: center; gap: 26px; padding-block: 18px 30px; }
.polaroid { flex: none; width: 150px; background: #fff; padding: 8px 8px 22px; border-radius: 4px; transform: rotate(-3deg);
  box-shadow: 0 10px 24px -14px rgba(31, 58, 11, .55); }
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 20%; }
.subject-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.subject-head p { font-size: 1.15rem; margin-top: 6px; }
.empty { background: var(--note); border: 1.5px solid var(--note-line); border-radius: 12px; padding: 12px 16px; max-width: 640px; }

/* tutores y pie */
.tutors { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1.5px solid var(--line); border-left: 6px solid var(--lime);
  border-radius: 16px; padding: 16px 20px; flex-wrap: wrap; justify-content: space-between; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--lime); color: var(--ink); font-weight: 800; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
footer { border-top: 1px solid var(--line); padding-block: 22px 36px; color: var(--muted); font-size: .92rem; margin-top: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }

/* en pantallas anchas, la ficha del recurso va en horizontal: imagen a la izquierda, texto a la derecha */
@media (min-width: 820px) {
  .resources { grid-template-columns: 1fr; }
  .resource { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
  .resource img { height: 100%; aspect-ratio: auto; min-height: 260px; border-bottom: 0; border-right: 2px solid var(--ink); }
  .resource .body { padding: 18px 22px 20px; align-content: start; }
  .why { grid-template-columns: 1fr 1fr; column-gap: 22px; grid-auto-flow: column; grid-template-rows: auto auto; }
  .why dt:not(:first-child) { margin-top: 0; }
}
@media (max-width: 900px) { .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  body { font-size: 16px; }
  .subjects { grid-template-columns: 1fr; }
  .subject-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
