/* ==========================================================
   VARIABLES
   Store colors in one place so they're easy to change later.
   ========================================================== */
:root {
    --bg: rgb(230, 225, 225);
    --surface: #ffffff;
    --text: #222222;
    --muted: #555555;
    --heading: darkcyan;
    --accent: rgb(4, 45, 168);
    --link: #0a84c6;          /* deepskyblue is too light to read on a pale background */
    --link-visited: rgb(5, 115, 115);
    --link-hover: deeppink;
    --link-active: crimson;
    --row-alt: aliceblue;
    --row-hover: lightcyan;
    --font: Helvetica, Arial, sans-serif;
}

/* ==========================================================
   BASE
   ========================================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg);
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    /* keeps the footer at the bottom on short pages */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Removed opacity: 0.7 — it faded the WHOLE page, text included.
       Removed font-weight: bold — bold everywhere means nothing stands out. */
}

main {
    flex: 1;     /* main stretches to fill space, pushing the footer down */
    width: 100%;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 50px 20px;
}

/* ==========================================================
   TYPOGRAPHY  (your original rules, merged and fixed)
   ========================================================== */
p {
    line-height: 1.6em;
    word-spacing: 0.1em;
    text-align: justify;
    text-indent: 20px;
}

p.intro::first-letter {
    font-size: 200%;
    font-weight: bold;
    color: var(--heading);
}

h1 {
    color: var(--heading);
    font-size: 40px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    word-spacing: 0.1em;
    text-align: left;
    text-shadow: 1px 1px 0px #000000;
    margin: 0 0 10px;
}

h2 {
    color: var(--accent);
    font-size: 24px;           /* was "24" — CSS needs a unit, so it was ignored */
    letter-spacing: 0.1em;
    word-spacing: 0.1em;
    text-shadow: 1px 1px 0px #c4c4c4;
    border-bottom: 3px solid var(--heading);
    display: inline-block;
    padding-bottom: 4px;
    margin-top: 0;
}

h3 {
    color: var(--text);
    font-size: 20px;           /* was "24" with no unit */
    letter-spacing: 0.05em;
    margin: 0 0 8px;
}

/* ==========================================================
   LINKS  (order matters: link, visited, hover, active)
   ========================================================== */
a:link {
    color: var(--link);
    text-decoration: none;
}

a:visited {
    color: var(--link-visited);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a.active {
    color: var(--link-active);
}

/* ==========================================================
   HEADER + NAVIGATION
   ========================================================== */
.site-header {
    position: sticky;
    top: 0;
    background-color: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.logo:link,
.logo:visited {
    color: var(--heading);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(135deg, #ffffff 0%, var(--bg) 100%);
}

/* text on the left, photo on the right */
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-photo {
    width: 280px;
    height: 350px;            /* taller than wide = portrait rectangle */
    flex-shrink: 0;           /* stops the photo getting squashed */
    object-fit: cover;        /* crops the photo to fill the shape without stretching */
    border-radius: 24px;      /* rounded corners; bigger number = rounder */
    border: 5px solid #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tagline {
    color: var(--muted);
    font-weight: normal;
    margin-bottom: 30px;
}

.button:link,
.button:visited {
    display: inline-block;
    background-color: var(--heading);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
}

.button:hover {
    background-color: var(--link-hover);
    text-decoration: none;
}

/* ==========================================================
   QUOTE BOX  (your p.one)
   ========================================================== */
p.one {
    border-top-left-radius: 80px 50px;
    border: thin solid black;
    background-color: var(--surface);
    padding: 20px;
    margin: 30px 20px;
    text-align: center;
    text-indent: 0;
    font-style: italic;
    box-shadow: 0 0 10px #b7b7b7;
}

/* ==========================================================
   BOOK QUOTE  (About page)
   ========================================================== */
.quote {
    margin: 50px auto 20px;
    text-align: center;
}

/* the short teal line above the quote */
.quote::before {
    content: "";              /* ::before needs content, even if empty */
    display: block;
    width: 140px;
    height: 3px;
    margin: 0 auto 30px;      /* "auto" left and right centers it */
    background-color: var(--heading);
}

.quote blockquote {
    margin: 0 0 16px;
    font-family: Georgia, "Times New Roman", serif;   /* a serif font for the quote itself */
    font-style: italic;
    font-size: 22px;
    line-height: 1.25em;
    color: var(--text);
}

.quote figcaption {
    font-size: 16px;
    color: var(--muted);
}

.quote figcaption a:link,
.quote figcaption a:visited {
    color: var(--heading);
}

/* ==========================================================
   SKILLS TABLE
   ========================================================== */
table.skills {
    width: 100%;
    border-collapse: collapse;  /* border-spacing only works without collapse; collapse looks cleaner */
    background-color: var(--surface);
    box-shadow: 0 0 10px #d7d7d7;
    /* removed list-style-position — it only applies to lists, not tables */
}

table.skills th,
table.skills td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e6e6e6;
}

/* th with scope="row" = the label on the left of each row */
th {
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--heading);
    width: 30%;
}

/* every other row gets a light background (no extra class needed) */
table.skills tr:nth-child(even),
tr.even {
    background-color: var(--row-alt);
}

/* was "tr.hover" — that targets a CLASS named hover.
   ":hover" (with a colon) is the pseudo-class that reacts to the mouse. */
table.skills tr:hover {
    background-color: var(--row-hover);
}

/* skills shown as little "pills" */
ul.tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

ul.tags li {
    background-color: var(--bg);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 14px;
}

/* ==========================================================
   RESUME ENTRIES
   ========================================================== */
hr {
    border: none;
    border-top: 2px solid var(--heading);
    margin: 0 0 24px;
}

main h2 {
    margin-top: 40px;
    border-bottom: none;     /* the <hr> underneath does the job here */
}

.entry {
    background-color: var(--surface);
    padding: 20px 24px;
    border-radius: 8px;
    border-left: 4px solid var(--heading);
    box-shadow: 0 0 10px #d7d7d7;
    margin-bottom: 20px;
}

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.entry-head h3 {
    margin: 0;
}

.place {
    color: var(--muted);
    font-style: italic;
}

/* role title on the left, dates on the right */
.role-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;          /* dates drop below the title on narrow screens */
    gap: 4px 16px;
    margin: 14px 0 6px;
}

p.role {
    font-weight: bold;
    color: var(--accent);
    text-indent: 0;
    margin: 0;
}

.dates {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;      /* keeps "Sep 2023 – Present" on one line */
}

.entry ul {
    margin-top: 0;
    line-height: 1.6em;
}

.entry ul ul {
    list-style-type: circle;
}

/* ==========================================================
   CARDS (articles + contact)
   ========================================================== */
p.lead {
    text-indent: 0;
    text-align: left;
    color: var(--muted);
    font-size: 18px;
}

.article-list {
    display: grid;
    gap: 20px;
}

.article-list time {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.article-list h3 {
    margin-top: 6px;
}

.read-more {
    font-weight: bold;
}

.contact-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px #d7d7d7;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card p {
    text-indent: 0;
    text-align: left;
    color: var(--muted);
}

/* ==========================================================
   BOOKSHELF
   ========================================================== */
.shelf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background-color: var(--surface);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px #d7d7d7;
    margin-bottom: 20px;
}

.stat {
    color: var(--muted);
}

.stat strong {
    font-size: 28px;
    color: var(--heading);
    margin-right: 6px;
}

.book-grid {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* 4 books per row */
    gap: 28px 20px;
}

.book h3 {
    font-size: 16px;
    margin: 12px 0 2px;
    line-height: 1.3em;
}

/* book-shaped box: 2 wide by 3 tall */
.cover {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 4px 8px 8px 4px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    /* placeholder colour, shown until you add a cover image */
    background: linear-gradient(160deg, var(--heading), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.book:hover .cover {
    transform: translateY(-4px);
}

/* Favorites: jewel tones */
#favorites .book:nth-child(4n+1) .cover { background: linear-gradient(160deg, #809FBC, #415770); }
#favorites .book:nth-child(4n+2) .cover { background: linear-gradient(160deg, #b8891a, #6b4e00); }
#favorites .book:nth-child(4n+3) .cover { background: linear-gradient(160deg, #9b2335, #5c0f1f); }
#favorites .book:nth-child(4n+4) .cover { background: linear-gradient(160deg, #ff6a13, #b3360c); }


/* Fantasy & Science Fiction: cosmic */
#fantasy .book:nth-child(4n+1) .cover { background: linear-gradient(160deg, #4fa3d8, #123a6b); }
#fantasy .book:nth-child(4n+2) .cover { background: linear-gradient(160deg, #d8a45a, #7a3b12); }
#fantasy .book:nth-child(4n+3) .cover { background: linear-gradient(160deg, #81C82A, #E94191); }
#fantasy .book:nth-child(4n+4) .cover { background: linear-gradient(160deg, #5c7a8a, #1e2c35); }

/* #E94191, #f1e78f */
/* #EC60AF, #FEF303 */
/* #6fa80f, #142208 */

/* Fiction: classic, muted */
#fiction .book:nth-child(4n+1) .cover { background: linear-gradient(160deg, #c98f5a, #6e3f33); }
#fiction .book:nth-child(4n+2) .cover { background: linear-gradient(160deg, #6f9475, #33452f); }
#fiction .book:nth-child(4n+3) .cover { background: linear-gradient(160deg, #2b3a8f, #0b0f33); }
#fiction .book:nth-child(4n+4) .cover { background: linear-gradient(160deg, #8a9a5b, #3d4a26); }

/* Non-Fiction: modern */
#nonfiction .book:nth-child(4n+1) .cover { background: linear-gradient(160deg, #264653, #132a33); }
#nonfiction .book:nth-child(4n+2) .cover { background: linear-gradient(160deg, #e4572e, #a4161a); }
#nonfiction .book:nth-child(4n+3) .cover { background: linear-gradient(160deg, #E50914, #000000); }
#nonfiction .book:nth-child(4n+4) .cover { background: linear-gradient(160deg, #c0c4c8, #5f6670); }


/* Light Novels & Manga: bright */
#manga .book:nth-child(4n+1) .cover { background: linear-gradient(160deg, #9b7fd4, #3d2366); }
#manga .book:nth-child(4n+2) .cover { background: linear-gradient(160deg, #A17244, #8E8542); }
#manga .book:nth-child(4n+3) .cover { background: linear-gradient(160deg, #d00000, #6a0000); }
#manga .book:nth-child(4n+4) .cover { background: linear-gradient(160deg, #f48c06, #9d4e00); }

/* #8E8542, #9A8242 */
/* #828B65, #C59660 */

/* the title printed on the placeholder cover */
.cover-title {
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.05em;
    line-height: 1.3em;
}

/* the real cover image sits on top of the placeholder */
.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

p.author {
    color: var(--muted);
    font-size: 14px;
    text-indent: 0;
    text-align: left;
    margin: 0 0 6px;
}

p.takeaway {
    font-style: italic;
    font-size: 14px;
    line-height: 1.5em;
    text-indent: 0;
    text-align: left;
    margin: 0;
}

/* ==========================================================
   SINGLE ARTICLE PAGE
   ========================================================== */
.post {
    max-width: 700px;         /* shorter lines are easier to read */
    margin: 0 auto;
    font-size: 18px;
}

.post p {
    line-height: 1.75em;
    text-align: left;         /* justified text is harder to read in long articles */
    text-indent: 0;
}

.back-link {
    display: inline-block;
    font-weight: bold;
    margin-bottom: 24px;
}

.post-header {
    border-bottom: 2px solid var(--heading);
    margin-bottom: 30px;
    padding-bottom: 10px;
}

.post-header h1 {
    font-size: 34px;
    line-height: 1.2em;
    text-transform: none;     /* long titles in ALL CAPS are hard to read */
}

.post-meta {
    color: var(--muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.post-summary {
    font-size: 20px;
    color: var(--muted);
    font-style: italic;
}

.post h2 {
    margin-top: 40px;
    margin-bottom: 0;
    border-bottom: none;
}

.post ul,
.post ol {
    line-height: 1.75em;
}

.post blockquote {
    margin: 30px 0;
    padding: 16px 24px;
    background-color: var(--surface);
    border-left: 4px solid var(--heading);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 20px;
}

.post figure {
    margin: 30px 0;
}

.post figure img {
    width: 100%;
    border-radius: 8px;
    background-color: var(--surface);
}

.post figcaption {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
}

.post-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #cccccc;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
    background-color: #222222;
    color: #dddddd;
    text-align: center;
    padding: 20px;
}

.site-footer p {
    text-align: center;
    text-indent: 0;
    margin: 0;
}

.credits {
    text-transform: capitalize;
}

/* ==========================================================
   SMALL SCREENS (phones)
   ========================================================== */
@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    h1 {
        font-size: 30px;
    }

    p {
        text-align: left;   /* justified text leaves big gaps on narrow screens */
    }

    /* on phones: photo on top, text underneath */
    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-photo {
        width: 220px;
        height: 275px;
    }

    .hero h1 {
        text-align: center;
    }

    /* smaller quote on phones */
    .quote blockquote {
        font-size: 30px;
    }

    /* 2 books per row on phones */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* stack the skills table: label on top, tags below */
    table.skills th,
    table.skills td {
        display: block;
        width: 100%;
    }

    table.skills th {
        border-bottom: none;
        padding-bottom: 0;
    }
}