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

/* Class 11 · Step 4: the basics */
:root {
    --text: #141414;
    --text-muted: #307473;
    --accent: #2dc2bd;
    --background: #f4fdaf;
    --border: #88a09e;
    --error: crimson;
}

body {
    font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.6;
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

/*Class 12: Step 2: My own scale*/
header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0;
    /* Lab 12: Task 4: Stacking the header when there isn't room */
    flex-wrap: wrap;
}

/* Lab 12: Task 1: Header side by side */
header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.1;
    margin-top: 2.5rem;
    border-bottom: 1.5px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

p {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* Lab 12: Task 3a: Footer work */
footer {
    border-top: 1px solid var(--border);
    padding-top: 1.0rem;
    display: flex;
    justify-content: space-between;
    /* Lab 14: Task 4: The footer stacks on narrow screens */
    flex-direction: column;
    align-items: center;
    margin-top: 4em;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 1rem;
    text-align: center;

}

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

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

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

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

/* Class 12: Step 4: Spacing on purpose */
section {
    margin-bottom: 3rem;
}

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

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

/* Class 13: Step 3: The nav bar */
nav ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Lab 14: Task 1: The nav stacks on narrow screens */
    flex-direction: column;
}

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

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 1a: Which page am I on */
nav a.current {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* Lab 13: Task 4: Seperate the bar from the header */
nav {
    padding-bottom: 1.5rem;
    border-bottom: .025px solid var(--border);
    margin-bottom: 2rem;
}

/* Lab 13: Task 5: A visible outline for tabbing */
nav a:focus-visible {
    outline: 1.5px solid var(--accent);
}

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

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

/* Class 14: Step 3: A row when there's room */
@media (min-width: 45rem) {
    .cards {
        flex-direction: row;
    }
}

/*Lab 14: Task 6: My own layout choices */
@media (min-width: 64rem) {
    body {
        max-width: 80rem;
    }

    .cards {
        gap: 2rem;
    }
}

body.dark {
    --text: white;
    --text-muted: silver;
    --accent: skyblue;
    --background: black;
    --border: dimgray;
    --error: lightsalmon;
}

/* 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(--text-muted);
    scroll-padding-block: 6px;
    background: #F8F6F0;
    color: var(var(--text));
}

form input:focus,form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

form button {
    font: inherit;
    font-weight: 700;
    color: var(--background);
    background: var(--accent);
    border: none;
    border-radius: 6px;
    padding: 0.6rem;
    cursor: pointer;
}

#form-status {
    font-weight: 500;
    color: var(--accent);
}

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

/* Class 18: STep 2: The hidden honeypot */
.hidden-field {
    display: none;
}