/* Class 16 ~ Step 3: padding counts inside width, on top of it */
* {
  box-sizing: border-box;
}

/* Class 11 ~ Step 4: the basics */
:root {
  --text: #cdcccc;
  --text-muted: #e00505;
  /* Lab 17 ~ Task 3: something I can see */
  --accent: #fc049d;
  --background: #2c1801;
  --border: #d44000;
  --error: crimson;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-family: "MedievalSharp", cursive;
  font-weight: 400;
  font-style: normal;

  color: var(--text);
  background: var(--background);
  line-height: 1.6;
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

h1 {
  font-size: 3.2rem; /* Class 12 ~ Step 2: my own scale*/
  margin-bottom: 1.1rem;
  margin-top: 0;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0;
}

h2 {
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

main p {
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

/* Lab 12 ~ Task 3: footer */
footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

@media (min-width: 40rem) {
  footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Lab 11 ~ Task 4: Links style */
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--accent);
}

.portrait {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
}

/* Lab 14 ~ Task 5: images scale on small screens */
img {
  max-width: 100%;
  height: auto;
}

section {
  margin-bottom: 3rem;
}

/* Lab 12 ~ Task 2: list without bullets */
ul {
  list-style: none;
  padding-left: 0;
}

li {
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

nav li {
  border-left: none;
  padding-left: 0;
}

/* Lab 12 ~ Task 1: header side by side */
/* Lab 12 ~ Task 4: let the header stack when there isn't room */
header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Class 13 ~ Step 3: the nav bar */
/* Lab 14 ~ Task 1: the nav stacks on narrow screens */
nav ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  /* Lab 16 ~ Task 3: no more stacking */
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 40rem) {
  nav ul {
    flex-direction: row;
    gap: 2rem;
  }
}

nav a {
  text-decoration: none;
  font-weight: 700;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  border-bottom-color: var(--accent);
}

/* Lab 13 ~ Task 1: which page am I on */
nav a.current {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Lab 13 ~ Task 4: separate the bar from the header (change)*/
nav {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

/* Lab 13 ~ Task 5: keyboard navigation indicator */
nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Class 14 ~ Step 2: the cards go in a row */
/* Class 14 ~ Step 3: stack by default */
.cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  flex: 1;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Class 14 ~ Step 3.1: a rw when there's room */
@media (min-width: 40rem) {
  .cards {
    flex-direction: row;
  }
}

body.dark {
  --text: white;
  --text-muted: rgba(192, 192, 192, 0.823);
  --accent: skyblue;
  --background: dimgrey;
  --border: #d44000;
  --error: lightsalmon;
}

button {
  background: var(--accent);
  color: var(--background);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

button:hover {
  opacity: 0.8;
}

/* Class 16 ~ Step 3: the form */
form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

form input,
form textarea {
  font: inherit;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
}

/* Lab 16 ~ Task 1: error message state */
#form-status.error {
  color: var(--error);
}

/* Class 16 ~ Step 3: the form button */
form button {
  padding: 0.75rem 1.5rem;
}

/* Class 18 ~ Step 2: the honeypot, hidden from people */
.hidden-field {
  display: none;
}