/* =========================================================
   COLOR PALETTE AND DESIGN VARIABLES
   ========================================================= */

:root {
    /* Colors taken from your coastal palette */
    --cream: #FCF5EA;
    --pink: #F1CED3;
    --navy: #355469;
    --blue: #64A8C8;
    --sky: #ABCFE0;
    --lavender: #E7E4F3;

    /*
       Semantic variables describe how colors are used.

       This makes it easier to change the design later.
       For example, changing --background changes every
       element that uses var(--background).
    */
    --background: var(--navy);
    --surface: var(--sky);
    --text: var(--cream);
    --text-dark: var(--navy);
    --accent: var(--blue);
    --highlight: var(--pink);
    --paper: var(--lavender);
    --card: var(--cream);
}


/* =========================================================
   GLOBAL PAGE SETTINGS
   ========================================================= */

/*
   Apply border-box sizing to every element.

   With border-box, padding and borders are included
   inside the element's declared width and height.
*/
* {
    box-sizing: border-box;
}


/*
   Smoothly animate movement when following links
   such as href="#projects".
*/
html {
    scroll-behavior: smooth;
}


/* Main page styling */
body {
    /* Remove the browser's default outer spacing */
    margin: 0;

    /* Make the page at least as tall as the screen */
    min-height: 100vh;

    /*
       Prevent horizontally overflowing objects,
       such as the large floating name, from creating
       a horizontal scrollbar.
    */
    overflow-x: hidden;

    background: var(--background);
    color: var(--text);

    /*
       The browser tries Arial first.
       If Arial is unavailable, it tries Helvetica,
       followed by the default sans-serif font.
    */
    font-family: Arial, Helvetica, sans-serif;
}


/* =========================================================
   SITE HEADER AND NAVIGATION
   ========================================================= */

.site-header {
    /*
       Keep the header in the normal page layout while
       allowing z-index to control its stacking order.
    */
    position: relative;
    z-index: 10;

    /*
       Place the logo and navigation beside each other.
    */
    display: flex;

    /*
       Push the logo to the left and navigation to the right.
    */
    justify-content: space-between;

    /* Vertically align the logo and navigation */
    align-items: center;

    /*
       Use 90% of the viewport width, but never exceed 1200px.
    */
    width: min(1200px, 90%);

    /*
       0 gives no top/bottom margin.
       auto centers the header horizontally.
    */
    margin: 0 auto;

    /* Add 24px of space above and below the header contents */
    padding: 24px 0;
}


/* Website name shown in the upper-left corner */
.logo {
    color: var(--cream);
    font-weight: 700;
    text-decoration: none;
}


/* Navigation link container */
nav {
    display: flex;

    /* Place 28px between each navigation link */
    gap: 28px;
}


/* Individual navigation links */
nav a {
    color: var(--cream);
    text-decoration: none;

    /*
       Animate color and movement instead of changing
       them instantly.
    */
    transition:
        color 180ms ease,
        transform 180ms ease;
}


/* Navigation link behavior when hovered */
nav a:hover {
    color: var(--pink);

    /* Move the link upward by 2px */
    transform: translateY(-2px);
}


/* =========================================================
   HERO SECTION
   ========================================================= */

.hero {
    /*
       Create a positioning context for objects inside
       the hero section.
    */
    position: relative;

    /*
       Creates an isolated stacking context so hero layers
       do not unexpectedly overlap elements outside the hero.
    */
    isolation: isolate;

    overflow: visible;

    /*
       Build a two-column layout:
       left side = introduction
       right side = large floating name
    */
    display: flex;

    /*
       The first column receives slightly more space.

       minmax(0, 1.25fr):
       Can shrink to zero and receives 1.25 shares.

       minmax(340px, 0.6fr):
       Stays at least 340px wide and receives 0.6 shares.
    */
   
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);

    /* Vertically center the two columns */
    align-items: center;

    /* Space between the columns */
    gap: 40px;

    /* Match the width and alignment of the header */
    width: min(1200px, 90%);
    margin: 0 auto;

    /*
       svh means "small viewport height."

       The hero fills approximately one screen,
       minus space used by the header.
    */
    min-height: calc(100svh - 80px);
}


/* Contains the eyebrow, heading, description, and buttons */
.hero-content {
    position: relative;

    /*
       Place the content above the decorative floating name.
    */
    z-index: 2;

    /*
       Prevent the content from becoming excessively wide
       on large monitors.
    */
    max-width: 780px;
}


/*
   Small uppercase category-style text, such as:

   ENGINEER · PROGRAMMER · BUILDER
*/
.eyebrow {
    color: var(--sky);

    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;

    /* Increase spacing between letters */
    letter-spacing: 0.15em;

    /* Display the text in uppercase */
    text-transform: uppercase;
}


/*
   Override the normal eyebrow color only when an eyebrow
   is inside the projects section.

   The darker color is more readable against the light
   projects background.
*/
.projects .eyebrow {
    color: var(--navy);
}


/* Main hero heading */
.hero h1 {
    /*
       Top margin: 18px
       Left/right margin: 0
       Bottom margin: 24px
    */
    margin: 18px 0 24px;

    /*
       Responsive font size:

       Minimum: 3.5rem
       Preferred: 5.4% of viewport width
       Maximum: 6rem
    */
    font-size: clamp(3.5rem, 5.4vw, 6rem);

    /*
       Tight line spacing makes the large heading
       feel more compact.
    */
    line-height: 0.95;

    /*
       Slight negative letter spacing pulls large
       letters closer together.
    */
    letter-spacing: -0.045em;
}


/* Paragraph beneath the main heading */
.hero-description {
    max-width: 620px;
    font-size: 1.15rem;

    /* Add comfortable vertical spacing between text lines */
    line-height: 1.6;
}


/* Container holding both hero buttons */
.buttons {
    display: flex;
    gap: 14px;
    margin-top: 30px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button {
    /*
       Inline-block allows the link to behave like an
       inline element while accepting padding and sizing.
    */
    display: inline-block;

    padding: 14px 22px;

    border: 2px solid var(--blue);
    border-radius: 6px;

    background: var(--blue);
    color: var(--navy);

    font-weight: 700;
    text-decoration: none;

    /*
       Smoothly animate all button states that change
       during hover.
    */
    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}


/*
   Secondary button variation.

   It keeps the normal button dimensions but has
   a transparent background.
*/
.button.secondary {
    border-color: var(--cream);

    background: transparent;
    color: var(--cream);
}


/* Hover behavior for primary and secondary buttons */
.button:hover {
    /* Move the button upward */
    transform: translateY(-4px);

    background: var(--pink);
    border-color: var(--pink);

    /*
       Add a solid offset shadow:
       6px right, 6px down, no blur.
    */
    box-shadow: 6px 6px 0 var(--sky);
}


/* Additional hover behavior specific to the secondary button */
.button.secondary:hover {
    background: var(--lavender);
    border-color: var(--lavender);
    color: var(--navy);
}


/*
   Keyboard accessibility.

   focus-visible normally appears when a visitor navigates
   using Tab rather than clicking with the mouse.
*/
.button:focus-visible,
nav a:focus-visible,
.logo:focus-visible {
    outline: 3px solid var(--pink);

    /* Move the outline away from the element by 4px */
    outline-offset: 4px;
}


/* =========================================================
   INTERACTIVE FLOATING NAME
   ========================================================= */

/* Large decorative name fixed to the viewport as a watermark */
.floating-name {
    position: fixed;

    /* Anchor the watermark to the bottom-right of the screen */
    right: clamp(0.5rem, 3vw, 2.5rem);
   bottom: clamp(1rem, 5vh, 4rem);


    /*
       Keep it behind important content but still visible
       across the page.
    */
    z-index: 1;

    font-size: clamp(5rem, 9vw, 9rem);
    font-weight: 900;
    line-height: 0.68;
    letter-spacing: -0.06em;
    text-align: right;

    color: rgba(231, 228, 243, 0.24);
   opacity: 0.24;
   

    pointer-events: none;
    user-select: none;

    transition:
        transform 180ms ease-out,
        opacity 180ms ease;
}


/*
   Display each name as its own line.

   Without display: block, both spans would normally
   appear beside each other.
*/
.floating-name span {
    display: block;
}


/*
   JavaScript moves James and Obergh independently.

   This makes each movement transition smoothly.
*/
.first-name,
.last-name {
    transition: transform 180ms ease-out;
}


/* =========================================================
   PROJECTS SECTION
   ========================================================= */

.projects {
    /* Make the projects section at least one screen tall */
    min-height: 100vh;

    /*
       100px top/bottom padding.
       5% left/right padding.
    */
    padding: 100px 5%;

    background: var(--sky);
    color: var(--navy);
}


/* Centers the project content and limits its width */
.projects-inner {
    width: min(1200px, 100%);
    margin: 0 auto;
}


/* Grid holding all project cards */
.project-grid {
    display: grid;

    /*
       Create three equal-width columns.
    */
    grid-template-columns: repeat(3, 1fr);

    /* Space between cards */
    gap: 24px;
}


/* Individual project card */
.project-card {
    min-height: 260px;
    padding: 28px;

    border: 2px solid var(--navy);
    border-radius: 10px;

    background: var(--cream);
    color: var(--navy);

    /*
       Smooth the card's movement, color, and shadow.
    */
    transition:
        transform 200ms ease,
        background 200ms ease,
        box-shadow 200ms ease;
}

/*
   Make the entire project card clickable without
   displaying the normal anchor underline or color.
*/
.project-card-link {
    display: block;

    color: inherit;
    text-decoration: none;
}


/*
   Give the card content a vertical layout so the
   "View project" text can remain near the bottom.
*/
.project-card {
    display: flex;
    flex-direction: column;

    min-height: 280px;
    padding: 28px;

    border: 2px solid var(--navy);
    border-radius: 10px;

    background: var(--cream);
    color: var(--navy);

    transition:
        transform 200ms ease,
        background 200ms ease,
        box-shadow 200ms ease;
}


/*
   Push the final link label toward the bottom
   of the card.
*/
.project-link-text {
    margin-top: auto;
    padding-top: 28px;

    font-weight: 700;
}


/*
   Move and recolor a project card when the link
   containing it is hovered.
*/
.project-card-link:hover .project-card {
    transform: translate(-6px, -6px);

    background: var(--lavender);
    box-shadow: 10px 10px 0 var(--pink);
}


/*
   Provide visible keyboard focus for people
   navigating with the Tab key.
*/
.project-card-link:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 6px;
}


/*
   Give the final "All Projects" card a slightly
   different starting color.
*/
.project-card-more {
    background: var(--pink);
}


/* =========================================================
   MOBILE AND TABLET LAYOUT
   ========================================================= */

/*
   Apply these rules only when the viewport is
   900px wide or narrower.
*/

/* =========================================================
   COMPLETE PROJECTS PAGE
   ========================================================= */

.projects-page {
    min-height: 100vh;
    padding: 80px 5% 120px;

    background: var(--sky);
    color: var(--navy);
}

/* =========================================================
   FEATURED WRITING — HOMEPAGE
   ========================================================= */

/*
   Featured Writing reuses the Projects layout, grid,
   cards, hover effects, and typography.

   Only the section background and final card color differ.
*/
.featured-writing {
    background: var(--lavender);
}


/*
   The general eyebrow color is pale, so override it
   inside this light-colored section.
*/
.featured-writing .eyebrow {
    color: var(--navy);
}


/*
   Give the final All Writing card its own palette color.
*/
.writing-card-more {
    background: var(--pink);
}


/*
   Make sure the section stays above the fixed watermark.
*/
.featured-writing {
    position: relative;
    z-index: 2;
}

/*
   Introductory heading at the top of Projects,
   About, Writing, and similar pages.
*/
.page-heading {
    width: min(1200px, 100%);
    margin: 0 auto 100px;
}


.page-heading h1 {
    margin: 12px 0;

    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.055em;
}


.page-heading p:not(.eyebrow) {
    max-width: 650px;

    font-size: 1.2rem;
    line-height: 1.6;
}


/*
   Each category gets its own separated section.
*/
.project-category {
    width: min(1200px, 100%);
    margin: 0 auto 110px;
}


.project-category h2 {
    margin-top: 10px;

    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: -0.035em;
}


.projects-page .eyebrow {
    color: var(--navy);
}

/* =========================================================
   INDIVIDUAL PROJECT PAGES
   ========================================================= */

.project-page {
    min-height: 100vh;
    padding: 70px 5% 120px;

    background: var(--cream);
    color: var(--navy);
}


.project-hero {
    width: min(1000px, 100%);
    margin: 0 auto 100px;
}


.project-hero .eyebrow {
    color: var(--navy);
}


.project-hero h1 {
    max-width: 900px;
    margin: 16px 0 28px;

    font-size: clamp(4rem, 9vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.055em;
}


.project-summary {
    max-width: 750px;

    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.55;
}


.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;

    margin-top: 40px;
    padding-top: 24px;

    border-top: 2px solid var(--navy);

    font-family: monospace;
    font-size: 0.9rem;
}


.project-body {
    width: min(780px, 100%);
    margin: 0 auto;
}


.project-body section {
    margin-bottom: 80px;
}


.project-body h2 {
    margin-bottom: 18px;

    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.035em;
}


.project-body p,
.project-body li {
    font-size: 1.1rem;
    line-height: 1.8;
}


.project-body pre {
    overflow-x: auto;

    padding: 24px;
    margin: 32px 0;

    border: 2px solid var(--navy);
    border-radius: 8px;

    background: var(--navy);
    color: var(--cream);
}


.project-body code {
    font-family:
        Consolas,
        "Courier New",
        monospace;
}


.project-footer {
    width: min(780px, 100%);
    margin: 100px auto 0;
}

/* =========================================================
   WRITING INDEX PAGE
   ========================================================= */

/*
   Light background for the complete Writing page.
*/
.writing-page {
    position: relative;
    z-index: 2;

    min-height: 100vh;
    padding: 80px 5% 120px;

    background: var(--sky);
    color: var(--navy);
}


/*
   Introductory heading at the top of the page.
*/
.writing-heading {
    width: min(1200px, 100%);
    margin: 0 auto 110px;
}


.writing-heading h1 {
    margin: 12px 0 24px;

    font-size: clamp(4.5rem, 11vw, 10rem);
    line-height: 0.84;
    letter-spacing: -0.06em;
}


.writing-introduction {
    max-width: 680px;

    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.65;
}


/*
   One category of writing, such as Technical Explanations.
*/
.writing-category {
    width: min(1200px, 100%);
    margin: 0 auto 120px;
}


.writing-category h2 {
    margin: 10px 0 38px;

    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
}


/*
   Dark eyebrow text is more readable against the light page.
*/
.writing-page .eyebrow {
    color: var(--navy);
}


/*
   Responsive article-card layout.
*/
.writing-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(300px, 1fr));

    gap: 26px;
}


/*
   Complete clickable article card.
*/
.writing-card {
    display: flex;

    min-height: 340px;
    padding: 32px;

    border: 2px solid var(--navy);
    border-radius: 12px;

    background: var(--cream);
    color: var(--navy);
    text-decoration: none;

    transition:
        transform 200ms ease,
        background 200ms ease,
        box-shadow 200ms ease;
}


/*
   Make the article inside the link fill the card.
*/
.writing-card article {
    display: flex;
    flex-direction: column;

    width: 100%;
}


/*
   Move linked cards when hovered.
*/
a.writing-card:hover {
    transform: translate(-6px, -6px);

    background: var(--lavender);
    box-shadow: 10px 10px 0 var(--pink);
}


/*
   Date and category row.
*/
.writing-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 34px;

    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/*
   Article title.
*/
.writing-card h3 {
    margin: 0 0 22px;

    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}


/*
   Article description.
*/
.writing-card p {
    margin: 0;

    font-size: 1.05rem;
    line-height: 1.65;
}


/*
   Keep the Read article link at the card's bottom.
*/
.writing-card-action {
    margin-top: auto;
    padding-top: 36px;

    font-weight: 700;
}


/*
   Visible outline for keyboard navigation.
*/
.writing-card:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 6px;
}


/*
   Non-clickable placeholder card.
*/
.writing-card-placeholder {
    flex-direction: column;

    background: var(--pink);
}

/* =========================================================
   INDIVIDUAL ARTICLE PAGE
   ========================================================= */

.article-page {
    position: relative;
    z-index: 2;

    min-height: 100vh;
    padding: 70px 5% 130px;

    background: var(--cream);
    color: var(--navy);
}


/*
   Article title and introductory information.
*/
.article-header {
    width: min(950px, 100%);
    margin: 0 auto 110px;
}


.article-back-link {
    display: inline-block;
    margin-bottom: 70px;

    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}


.article-back-link:hover {
    text-decoration: underline;
}


.article-header .eyebrow {
    color: var(--navy);
}


.article-header h1 {
    max-width: 950px;
    margin: 18px 0 30px;

    font-size: clamp(3.8rem, 8vw, 7.5rem);
    line-height: 0.9;
    letter-spacing: -0.055em;
}


.article-subtitle {
    max-width: 760px;

    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.6;
}


/*
   Author, date, and reading-time information.
*/
.article-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;

    margin-top: 45px;
    padding-top: 24px;

    border-top: 2px solid var(--navy);

    font-family: monospace;
    font-size: 0.9rem;
}


/*
   Keep article text at a comfortable reading width.
*/
.article-body {
    width: min(760px, 100%);
    margin: 0 auto;
}


/*
   Space between major sections.
*/
.article-body section {
    margin-bottom: 80px;
}


.article-body h2 {
    margin: 0 0 22px;

    font-size: clamp(2.1rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}


.article-body h3 {
    margin: 45px 0 16px;

    font-size: clamp(1.4rem, 3vw, 2rem);
}


.article-body p,
.article-body li {
    font-size: 1.12rem;
    line-height: 1.85;
}


.article-body p {
    margin: 0 0 26px;
}


.article-body li {
    margin-bottom: 10px;
}


/*
   Code block styling.
*/
.article-body pre {
    overflow-x: auto;

    margin: 34px 0;
    padding: 26px;

    border: 2px solid var(--navy);
    border-radius: 10px;

    background: var(--navy);
    color: var(--cream);
}


.article-body code {
    font-family:
        Consolas,
        "Courier New",
        monospace;

    line-height: 1.6;
}
.article-body code {
    font-family:
        Consolas,
        "Courier New",
        monospace;

    line-height: 1.6;
}


/* =========================================================
   ARTICLE IMAGES
   ========================================================= */

.article-image {
    width: 100%;
    margin: 34px 0;
}

.article-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;

    border: 2px solid var(--navy);
    border-radius: 10px;
}

.article-image figcaption {
    margin-top: 10px;

    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}


/* Footer beneath an article */
.article-footer {
    width: min(760px, 100%);
    margin: 110px auto 0;
}

/*
   Footer beneath an article.
*/
.article-footer {
    width: min(760px, 100%);
    margin: 110px auto 0;
}

/*
   Make every image inside an article responsive.
   The image may shrink, but it will not exceed
   the width of the article body.
*/
.article-body img {
    display: block;

    width: 100%;
    max-width: 100%;
    height: auto;

    margin: 34px 0;

    border: 2px solid var(--navy);
    border-radius: 10px;
}

/* Responsive embedded video */
.video-embed {
    width: 100%;
    margin: 34px 0;

    /* Keeps the video at a standard 16:9 ratio */
    aspect-ratio: 16 / 9;

    overflow: hidden;
    border: 2px solid var(--navy);
    border-radius: 12px;
}

.video-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================================================
   ARTICLE AND PROJECT IMAGES
   ========================================================= */

/*
   Container for an image and its caption.
*/
.article-image,
.project-image {
    width: 100%;
    margin: 40px 0;
}


/*
   Make images resize with the page rather than
   overflowing on narrow screens.
*/
.article-image img,
.project-image img {
    display: block;

    width: 100%;
    height: auto;

    border: 2px solid var(--navy);
    border-radius: 12px;
}


/*
   Caption displayed underneath the image.
*/
.article-image figcaption,
.project-image figcaption {
    margin-top: 12px;

    color: var(--navy);

    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 900px) {
    /*
       Temporarily hide desktop navigation.

       Later, this can be replaced with a mobile menu button.
    */
    nav {
        display: none;
    }


    /*
       Change the desktop grid into a vertical flex layout.
    */
    .hero {
        display: flex;
        flex-direction: column;

        align-items: flex-start;
        justify-content: center;

        padding: 70px 0 40px;
    }


    /* Adjust heading size for smaller displays */
    .hero h1 {
        font-size: clamp(3.4rem, 12vw, 5.5rem);
    }


    /*
       On smaller screens, position the floating name
       behind the hero content.
    */
.floating-name {
    right: -5%;
    bottom: 3%;

    font-size: clamp(5rem, 22vw, 9rem);
    opacity: 0.10;
}


    /*
       Change project cards from three columns
       to one vertical column.
    */
    .project-grid {
        grid-template-columns: 1fr;
    }

   .writing-page {
    padding-top: 60px;
}

.writing-heading {
    margin-bottom: 80px;
}

.writing-heading h1 {
    font-size: clamp(4rem, 20vw, 7rem);
}

.writing-grid {
    grid-template-columns: 1fr;
}

.writing-card {
    min-height: 300px;
}

.writing-card-meta {
    flex-direction: column;
    gap: 6px;
}

.article-page {
    padding-top: 50px;
}

.article-back-link {
    margin-bottom: 50px;
}

.article-header {
    margin-bottom: 80px;
}

.article-header h1 {
    font-size: clamp(3.3rem, 14vw, 5.5rem);
}

.article-details {
    flex-direction: column;
}
   
}
