/* Class 16 · Step 3: padding counts inside the width */
* {
    box-sizing: border-box;
}

/* Class 11 · Step 4: the basics */
:root {
    --text: #1a1a1a;
    --text-muted: #63656b;
    --accent: #a10925;
/* <!-- Lab 17 · Task 3: something I can see -->. Blinding users who visit my page for the love of the game */
    --background: #44043a;
    --border: #d6baba;
} 

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: 3rem 1.5rem;
}

/* 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;
}

h1 {
    font-size: 3rem; /* Class 12 · Step 2: my own scale */
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

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

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

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

footer p {
    margin: 0;
    font-size: inherit;
}

/* 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: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
}

/* Class 12 · Step 4: spacing on purpose */
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);
}

/* Class 13 · Step 3: the nav bar */
/* Lab 14 · Task 5: bigger tap targets for the nav */

nav a {
    display: inline-block;
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: 700;
    padding: 0.5rem 0; 
    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);
}

/* Class 13 · Step 3: nav as a row */
/* Lab 14 · Task 1: the nav stacks on narrow screens */
nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

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

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

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

/* Lab 13 · Task 4: separate the bar from the header */

nav {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

/* Lab 14 · Task 5: less space under the nav on phones */
@media (min-width: 40rem) {
    nav {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
}

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


/* Class 14 · Step 3: stack by default */
.cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: flex-start;

    
}

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

.card h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

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

/* Lab 12 · Task 3: footer */
/* Lab 14 · Task 4: footer stacks on narrow screens */
footer {
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

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

/* Lab 14 · extra: space between the header photo and the cards (tennis and projects pages) */
.tennis-main,
.projects-main {
    margin-top: 2rem;
}

/* Lab 14 · Task 6: second breakpoint, widen the page on big monitors */
@media (min-width: 64rem) {
    body {
        max-width: 60rem;
    }
}

body.dark {
    --text: white;
    --text-muted: silver;
    --accent: skyblue;
    --background: rgb(0, 0, 0);
    --border: dimgray;
}

/* 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); border-radius: 6px;
    background: var(--background); color: 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 1.4rem; cursor: pointer;
}
#form-status { font-weight: 700; color: var(--accent); }

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

/* Lab 16 · Task 3: theme button matches the nav and is easy to tap */
nav button {
    font: inherit;
    font-weight: 700;
    color: var(--accent);
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    min-height: 44px;
    cursor: pointer;
}

/* Lab 16 · Task 3: Send button is at least 44px tall */
form button {
    min-height: 44px;
}

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