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

/* Class 11: Step 4: the basics*/

:root{
    --text: #1f1d1d;
    --texted-muted: #b1a8a8;
    --accent: #3d35d8;
    --background: #fbfbf2;
    --border: #0c0c0c;
    --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: 3rem 1.5rem;
}

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

h1 { font-size: 3rem;   /* Class12: my own scale */
    line-height: 1.1;
    margin-bottom: 0.25rem;
    }

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

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

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

/* Lab 12: Task 3: footer */
/*Lab 14: Step 4: the footer stacks on the narrow screen */
footer { 
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    gap: 0.5rem;
}

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

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 */
nav a {
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid transparent;
}

/* Lab 13: Step 4: Seperate the var from the header */
nav{
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

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

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

/* Lab 13: Step 5: one thing of your own*/
/* Lab 14: step 1: the nav stacks on the narrow screen */
nav ul{
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
/* Lab 14: step 1: add a media for nav */
@media(min-width: 40rem){
    nav ul{
        flex-direction: row;
        gap: 1.5rem;
    }
}

/* Lab 13: Step 5: one thing of your own*/
nav a:focus-visible {
    outline: 2px solid var(--accent);
}

/* Class 14: Step 2: the cards go in a row */
.cards{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Lab 14: Step 6: One layout of your choice */
    flex-wrap: wrap;
}

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

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

/* Class 14: Step 5: Adding an img section so images don't run off the page */
img{
    max-width: 100%;
    height: auto;
}

body.dark-mode{
    --text: White;
    --texted-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%;
    /* Lab 16: Step 3: the form on a phone */
    max-width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    scroll-padding-block-start: 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;
    background: var(--accent);
    color: var(--background);
    border: none;
    padding: 0.5rem 1rem;
    /* Lab 16: Step 3: Form on a phone */
    min-height: 44px;
    border-radius: 6px;
    cursor: pointer;
}

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

#myform{
    display: none;
}

button#theme-toggle{
    font: inherit;
    font-weight: 700;
    background: var(--accent);
    color: var(--background);
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
}

.clickableemail{
    cursor: pointer;
    color: var(--accent);
    text-decoration: underline;

}

.top-button{
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent);
    color: var(--background);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

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

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