/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef3f9;
  --text: #1f2937;
  --muted: #5b6472;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #d9e2ec;
  --code-bg: #0f172a;
  --code-text: #e5ecf4;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 220px);
}

a {
  color: var(--primary);
}

a:hover,
a:focus {
  color: var(--primary-dark);
}

header,
main,
footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

header {
  padding: 3rem 0 2rem;
}

header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.15;
  color: #0f172a;
}

header > p {
  max-width: 70ch;
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--muted);
}

nav {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 1rem;
  z-index: 10;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

nav a {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid transparent;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

nav a:hover,
nav a:focus {
  background: #dbeafe;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

main {
  padding-bottom: 3rem;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.75rem;
}

section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.9rem;
  line-height: 1.2;
  color: #0f172a;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #dbeafe;
}

article {
  background: #fcfdff;
  border: 1px solid #e6edf5;
  border-left: 5px solid #93c5fd;
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  margin: 1.25rem 0 0;
}

article h3 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  font-size: 1.2rem;
  color: #12315f;
}

p,
ul,
ol {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.35rem;
}

strong {
  color: #0f172a;
}

code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
  background: #eaf2ff;
  color: #11315f;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

pre {
  margin: 1rem 0 0;
  padding: 1rem;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #12315f;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.8rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eff6ff;
  color: #0f172a;
}

form {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

fieldset {
  border: 1px solid #bfd4ea;
  border-radius: var(--radius-sm);
  padding: 1rem;
}

legend {
  font-weight: 700;
  color: #12315f;
  padding: 0 0.5rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #c7d2e0;
  border-radius: 10px;
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover,
button:focus {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

footer {
  padding: 0 0 3rem;
}

footer p {
  text-align: center;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 768px) {
  body {
    line-height: 1.6;
  }

  header {
    padding-top: 2rem;
  }

  nav {
    position: static;
  }

  section {
    padding: 1.25rem;
    border-radius: 18px;
  }

  article {
    padding: 1rem;
  }

  nav ul {
    flex-direction: column;
  }

  nav a {
    width: 100%;
  }
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.exercise-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe5f0;
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.exercise-card:hover,
.exercise-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  border-color: #93c5fd;
}

.exercise-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.exercise-card p {
  margin-bottom: 1rem;
  color: #5b6472;
  flex-grow: 1;
}

.card-link {
  display: inline-block;
  align-self: flex-start;
  text-decoration: none;
  font-weight: 700;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.card-link:hover,
.card-link:focus {
  background: #1d4ed8;
  color: #ffffff;
  transform: translateY(-1px);
}

.correction-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border-color: #d7dde7;
}

.correction-card .card-link {
  background: #475569;
}

.correction-card .card-link:hover,
.correction-card .card-link:focus {
  background: #334155;
}

@media (max-width: 768px) {
  .exercise-grid {
    grid-template-columns: 1fr;
  }
}
