/* -----------------------------------------------
    BASE
----------------------------------------------- */

html {
    font-size: 62.5%; /* 1rem = 10px */
    scroll-behavior: smooth;
}

body {
    font-family: Charter, Georgia, serif;
    line-height: 1.75;
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: #f4f4f4;
    color: #111;
}

/* -----------------------------------------------
    SKIP LINK
----------------------------------------------- */

.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
    text-decoration: none;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0 0 1rem;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    display: block;
}

/* -----------------------------------------------
    ACCESSIBILITY & FOCUS STYLES
----------------------------------------------- */

:focus-visible {
    outline: 2px solid #2a5558;
    outline-offset: 2px;
    border-radius: 2px;
}

/* -----------------------------------------------
    PARAGRAPHS & LINKS
----------------------------------------------- */

p {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

a {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

a:hover {
    text-decoration: none;
}

/* -----------------------------------------------
    HEADINGS
----------------------------------------------- */

h1, h2, h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

h1 {
    font-family: Charter, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    font-size: 3.2rem;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 2rem;
    color: #111;
    letter-spacing: 0.01em;
    font-weight: 400;
}

h2 {
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: #666;
    margin: 5.5rem 0 2rem 0;
    text-transform: uppercase;
}

h3 {
    font-size: 2.2rem;
    color: #111;
}

/* -----------------------------------------------
    SECTIONS
----------------------------------------------- */

section {
    margin-bottom: 3rem;
}

section:last-child {
    margin-bottom: 0;
}

/* -----------------------------------------------
    SECTION LINK (article breadcrumb)
----------------------------------------------- */

.section-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.section-link a {
    color: #555;
    text-decoration: none;
    text-transform: lowercase;
}

.section-link a::before {
    content: '← ';
}

.section-link a:hover {
    color: #111;
}

/* -----------------------------------------------
    ARTICLE LIST DESCRIPTIONS
----------------------------------------------- */

section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

section li {
    margin-bottom: 2.2rem;
}

section li br {
    display: none;
}

section li:last-child {
    margin-bottom: 0;
}

li a {
    font-size: 1.8rem;
    transition: color 0.4s ease;
}

.description {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.4rem;
    color: #888;
    display: block;
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* -----------------------------------------------
    SITE TITLE
----------------------------------------------- */

.site-title {
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.site-title a {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #222;
    text-decoration: none;
}

.site-title a:hover {
    color: #111;
}

/* -----------------------------------------------
    TOP NAVIGATION
----------------------------------------------- */

nav {
    margin-bottom: 5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    padding: 0;
    margin: 0;
}

nav a {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    text-transform: lowercase;
    letter-spacing: 0.15em;
    color: #333;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid transparent;
}

nav a:hover {
    color: #111;
    border-bottom-color: #adadad;
}

nav a[aria-current="page"] {
    color: #111;
    border-bottom-color: #111;
}

/* -----------------------------------------------
    PAGE FOOTER
----------------------------------------------- */

/* -----------------------------------------------
    HOMEPAGE HERO
----------------------------------------------- */

.homepage > section:first-child {
    text-align: center;
    padding: 6rem 0 5rem;
    margin-bottom: 5rem;
    border-bottom: 1px solid #ddd;
}

.homepage > section:first-child h1 {
    font-size: 4.8rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

/* "make up a photograph" */
.homepage > section:first-child p:first-of-type {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.3rem;
    color: #999;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 4rem;
}

/* "light / time / awareness" */
.homepage > section:first-child p:nth-of-type(2) {
    font-size: 2.6rem;
    line-height: 2;
    letter-spacing: 0.12em;
    margin: 0 auto 4rem;
}

/* The poem: "a photograph is not made by a camera..." */
.homepage > section:first-child p:nth-of-type(n+3) {
    font-size: 1.7rem;
    color: #555;
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

/* -----------------------------------------------
    PAGE TRANSITIONS
----------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
    main {
        animation: pageFadeIn 0.35s ease;
    }

    @keyframes pageFadeIn {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* -----------------------------------------------
    FOOTER
----------------------------------------------- */

footer {
    margin-top: 8rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
    color: #444;
    text-align: center;
}

footer a {
    color: #444;
    text-decoration: none;
}

footer a:hover {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

footer p {
    font-size: 1.4rem;
    letter-spacing: 0.03rem;
    color: #444;
}

/* -----------------------------------------------
    ARTICLE FOOTER (next / previous navigation)
----------------------------------------------- */

.article-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.article-footer p {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}

.article-footer p:last-child {
    margin-bottom: 0;
}

.article-footer a {
    color: #111;
    text-decoration: none;
}

.article-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

/* Homepage CTA — "begin with light →" */
.homepage .article-footer {
    margin-top: 6rem;
}

.homepage .article-footer a {
    font-size: 1.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #111;
    padding-bottom: 0.2rem;
}

.homepage .article-footer a:hover {
    text-decoration: none;
    border-bottom-color: transparent;
}

/* -----------------------------------------------
    SECTION END (cross-section handoff)
----------------------------------------------- */

.section-end {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.section-end a {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    color: #111;
    text-decoration: none;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #111;
    padding-bottom: 0.2rem;
}

.section-end a:hover {
    border-bottom-color: transparent;
}

/* -----------------------------------------------
    VISITED ARTICLES (hub pages)
----------------------------------------------- */

section li a.visited {
    color: #aaa;
}

/* -----------------------------------------------
    SECTION PROGRESS
----------------------------------------------- */

.section-progress {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.3rem;
    color: #aaa;
    letter-spacing: 0.05em;
}

/* -----------------------------------------------
    UTILITY CLASSES
----------------------------------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* -----------------------------------------------
    GALLERY
----------------------------------------------- */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.art-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin: 3rem auto;
    box-sizing: border-box;
}

.gallery-card {
    display: flex;
    flex-direction: column;
}

.gallery-item {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #e8e8e8;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.art-caption {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.4rem;
    color: #555;
    margin: 0.75rem 0 0;
    line-height: 1.4;
}

/* -----------------------------------------------
    MOBILE
----------------------------------------------- */

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2.4rem;
    }

    h2 {
        font-size: 1.2rem;
        margin-top: 3rem;
    }

    p {
        font-size: 1.6rem;
    }

    nav a {
        font-size: 1.4rem;
    }

    nav ul {
        gap: 1.5rem;
    }

    .site-title a {
        font-size: 1.2rem;
    }

    .description {
        font-size: 1.4rem;
    }

    li a {
        font-size: 1.8rem;
    }

    footer {
        margin-top: 5rem;
    }
}

/* -----------------------------------------------
    DARK MODE
----------------------------------------------- */

@media (prefers-color-scheme: dark) {
    body {
        background: #010b00;
        color: #fff;
    }

    a {
        color: #bababa;
    }

    h1 {
        color: #f0f0f0;
    }

    h2 {
        color: #888;
    }

    h3 {
        color: #e0e0e0;
    }

    nav {
        border-bottom-color: #2a2a2a;
    }

    nav a {
        color: #aaa;
        text-transform: lowercase;
    }

    nav a:hover,
    nav a[aria-current="page"] {
        color: #e0e0e0;
        border-bottom-color: #444;
    }

    li a {
        color: #f0f0f0;
    }

    .site-title a {
        color: #aaa;
    }

    .site-title a:hover {
        color: #e0e0e0;
    }

    .description {
        color: #666;
    }

    .article-footer {
        border-top-color: #2a2a2a;
    }

    .article-footer a {
        color: #e0e0e0;
    }

    .article-footer a:hover {
        color: #fff;
    }

    .homepage .article-footer a {
        border-bottom-color: #e0e0e0;
    }

    .homepage .article-footer a:hover {
        border-bottom-color: transparent;
    }

    .homepage > section:first-child {
        border-bottom-color: #2a2a2a;
    }

    .homepage > section:first-child p:first-of-type {
        color: #555;
    }

    .homepage > section:first-child p:nth-of-type(n+3) {
        color: #888;
    }

    .section-end {
        border-top-color: #2a2a2a;
    }

    .section-end a {
        color: #e0e0e0;
        border-bottom-color: #e0e0e0;
    }

    .section-end a:hover {
        border-bottom-color: transparent;
    }

    section li a.visited {
        color: #444;
    }

    footer {
        border-top-color: #2a2a2a;
        color: #888;
    }

    footer a {
        color: #aaa;
    }

    footer a:hover {
        color: #e0e0e0;
    }

    footer p {
        color: #888;
    }

    .gallery-item {
        background: #1a1a1a;
    }

    .art-caption {
        color: #aaa;
    }

    .section-link a {
        color: #aaa;
    }

    .section-link a:hover {
        color: #e0e0e0;
    }
}

/* -----------------------------------------------
    CONTACT FORM
----------------------------------------------- */

:root {
    --color-text: #111;
    --color-bg: #f4f4f4;
    --color-border: #767676;
    --color-focus: #2a5558;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-text: #f0f0f0;
        --color-bg: #1a1a1a;
        --color-border: #555;
    }
}

.contact-form {
    max-width: 450px;
}

.form-group br {
    display: none;
}

.form-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    padding: 1.2rem 0;
    margin-bottom: 2rem;
}

.form-success {
    color: #2a5558;
}

.form-error {
    color: #a00;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

input[type="text"],
input[type="email"],
textarea {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: transparent;
    color: var(--color-text);
    width: 100%;
    box-sizing: border-box;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

button {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--color-text);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 0.75rem 2rem;
    cursor: pointer;
    width: fit-content;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

button:hover {
    border-color: var(--color-text);
}
