/* Home v2 — dark editorial. Serif display + mono labels, one accent,
   Apple-window motif for project cards. Loaded after style.css and
   overrides its gradient-era typography. */

body.home-v2 {
    --ink: #f2f2ef;
    --ink-soft: rgba(242, 242, 239, 0.72);
    --ink-faint: rgba(242, 242, 239, 0.45);
    --coal: #0a0b0e;
    --panel: rgba(22, 23, 28, 0.72);
    --hairline: rgba(242, 242, 239, 0.14);
    --acc: #7c8cff;
    --acc-dim: rgba(124, 140, 255, 0.16);
    --serif: 'Instrument Serif', Georgia, serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    background-color: var(--coal);
    color: var(--ink);
}

body.home-v2 main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.hero-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
    min-height: 92vh;
    padding: 120px 0 3rem;
}

.hero-copy {
    text-align: left;
}

.hero-kicker {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.3em;
    color: var(--acc);
    margin-bottom: 1.25rem;
}

/* Kill the gradient-text era */
body.home-v2 h1,
.hero-name {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.8rem, 5.6vw, 4.8rem);
    white-space: nowrap;
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--ink);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--ink);
    animation: none;
    margin: 0 0 1.25rem;
    text-align: left;
}

.hero-tagline {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.35rem, 2.8vw, 1.7rem);
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

.hero-sub {
    max-width: 480px;
    color: var(--ink-faint);
    font-size: 1.08rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
}

.hero-sub a {
    color: var(--acc);
    text-decoration: none;
    border-bottom: 1px solid var(--acc-dim);
}

.hero-ctas {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn-primary,
.btn-ghost {
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--ink);
    color: #0a0b0e;
    border: 1px solid var(--ink);
}

.btn-primary:hover {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--ink-soft);
    border: 1px solid var(--hairline);
}

.btn-ghost:hover {
    border-color: var(--acc);
    color: var(--ink);
    transform: translateY(-1px);
}

.hero-hint {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
}

.hero-hint-arrow {
    color: var(--acc);
    margin-right: 0.4rem;
}

/* Chat window sits in the hero grid; loosen the old centering */
.hero-v2 .imessage-window {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    justify-self: end;
}

/* ------------------------------------------------------------------ */
/* iMessage-faithful chat skin                                         */
/* ------------------------------------------------------------------ */

body.home-v2 .chat-messages {
    background: #0b0b0d; /* solid, so bubble tails mask cleanly */
    padding: 1rem 0.9rem;
}

body.home-v2 .message-content {
    padding: 0.55rem 0.9rem;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.35;
}

/* Received: iOS dark-mode gray, tail bottom-left */
body.home-v2 .message.assistant .message-content {
    background: #3a3a3c;
    color: #fff;
    border-radius: 20px;
}

body.home-v2 .message.assistant .message-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -7px;
    width: 20px;
    height: 20px;
    background: #3a3a3c;
    border-bottom-right-radius: 16px 14px;
}

body.home-v2 .message.assistant .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 10px;
    height: 20px;
    background: #0b0b0d;
    border-bottom-right-radius: 10px;
}

/* Sent: iMessage blue, tail bottom-right */
body.home-v2 .message.user .message-content {
    background: #0a84ff;
    color: #fff;
    border-radius: 20px;
}

body.home-v2 .message.user .message-content::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -7px;
    width: 20px;
    height: 20px;
    background: #0a84ff;
    border-bottom-left-radius: 16px 14px;
}

body.home-v2 .message.user .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 10px;
    height: 20px;
    background: #0b0b0d;
    border-bottom-left-radius: 10px;
}

/* No tail on the typing indicator, just the gray bubble */
body.home-v2 .typing-indicator .message-content::before,
body.home-v2 .typing-indicator .message-content::after {
    display: none;
}

body.home-v2 .delivered {
    align-self: flex-end;
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    margin: -0.2rem 0.4rem 0.5rem 0;
    animation: messageAppear 0.3s ease-out;
}

/* Input bar: iOS pill + blue send-up button */
body.home-v2 .chat-input-container {
    background: #101012;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.7rem 0.8rem;
}

body.home-v2 .chat-input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.15rem 0.2rem 0.15rem 0.4rem;
    align-items: center;
}

body.home-v2 .chat-input:focus-within {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    transform: none;
}

body.home-v2 .chat-input input {
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
}

body.home-v2 .chat-input button {
    background: #0a84ff;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 0.8rem;
}

body.home-v2 .chat-input button:hover {
    transform: none;
    box-shadow: none;
    background: #2f97ff;
}

body.home-v2 .chat-header {
    background: rgba(16, 16, 18, 0.9);
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 1rem 0.5rem;
}

body.home-v2 .chat-header span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
}

body.home-v2 .assistant-avatar {
    width: 38px;
    height: 38px;
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

.section-v2 {
    padding: 4.5rem 0 1rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.28em;
    color: var(--ink-faint);
}

.section-lede {
    color: var(--ink-faint);
    font-size: 0.95rem;
    margin: -0.5rem 0 1.5rem;
}

.section-link,
.scroll-hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--acc);
    text-decoration: none;
}

.scroll-hint {
    color: var(--ink-faint);
}

/* ------------------------------------------------------------------ */
/* Projects — horizontal scroll of mac windows                         */
/* ------------------------------------------------------------------ */

.proj-track {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 0.25rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--acc-dim) transparent;
}

.proj-track::-webkit-scrollbar {
    height: 6px;
}

.proj-track::-webkit-scrollbar-thumb {
    background: var(--acc-dim);
    border-radius: 3px;
}

.proj-card {
    flex: 0 0 340px;
    scroll-snap-align: start;
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.proj-card:hover {
    transform: translateY(-4px);
    border-color: var(--acc);
}

.proj-chrome {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid var(--hairline);
}

.proj-dots {
    display: flex;
    gap: 6px;
}

.proj-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.proj-dots span:nth-child(1) { background: #ff5f56; }
.proj-dots span:nth-child(2) { background: #ffbd2e; }
.proj-dots span:nth-child(3) { background: #27c93f; }

.proj-repo {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proj-body {
    padding: 1.1rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex-grow: 1;
}

.proj-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.45rem;
    line-height: 1.15;
}

.proj-trophy {
    font-size: 0.95rem;
    margin-left: 0.3rem;
}

.proj-desc {
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.55;
    flex-grow: 1;
}

.proj-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--acc);
    padding-top: 0.4rem;
    border-top: 1px solid var(--hairline);
}

.proj-meta .stars {
    color: var(--ink-faint);
}

.gh-sync {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--ink-faint);
    letter-spacing: 0.05em;
}

/* Projects page: full grid with repo preview images */
.projects-hero {
    padding-top: 130px;
}

.projects-title {
    margin-bottom: 0.75rem;
}

.projects-hero .section-lede {
    max-width: 560px;
    margin-bottom: 2rem;
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.proj-shot {
    border-bottom: 1px solid var(--hairline);
    background: rgba(0, 0, 0, 0.4);
}

.proj-shot img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    display: block;
}

.more-link {
    margin-top: 1.75rem;
}

.nav-links a.nav-active {
    color: var(--acc, #7c8cff);
}

/* ------------------------------------------------------------------ */
/* Writing teaser                                                      */
/* ------------------------------------------------------------------ */

.writing-list {
    display: flex;
    flex-direction: column;
}

.writing-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 1.25rem;
    align-items: baseline;
    padding: 1.1rem 0.25rem;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s ease;
}

.writing-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.writing-date {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
}

.writing-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.2;
}

.writing-row:hover .writing-title {
    color: var(--acc);
}

.writing-arrow {
    font-family: var(--mono);
    color: var(--ink-faint);
}

/* ------------------------------------------------------------------ */
/* About + photo strip                                                 */
/* ------------------------------------------------------------------ */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.about-card p {
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-card a {
    color: var(--acc);
    text-decoration: none;
    border-bottom: 1px solid var(--acc-dim);
}

.about-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.about-tags span {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
}

.photo-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scroll-snap-type: x proximity;
}

.polaroid {
    flex: 0 0 210px;
    scroll-snap-align: start;
    background: #f5f4ef;
    border-radius: 4px;
    padding: 0.55rem 0.55rem 0.7rem;
    transform: rotate(-1.4deg);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.polaroid:nth-child(2n) {
    transform: rotate(1.6deg);
}

.polaroid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #ddd;
}

.polaroid figcaption {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: #3c3d42;
    padding-top: 0.5rem;
    line-height: 1.4;
}

.polaroid-slot {
    opacity: 0.65;
    border: 1px dashed rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ */
/* Contact + footer                                                    */
/* ------------------------------------------------------------------ */

body.home-v2 .contact {
    text-align: center;
    padding: 5rem 0 4rem;
}

.contact-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    margin-bottom: 0.75rem;
    color: var(--ink);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--ink);
}

body.home-v2 .contact p {
    color: var(--ink-faint);
    max-width: 460px;
    margin: 0 auto 1.75rem;
}

body.home-v2 .contact-btn {
    font-family: var(--mono);
    font-size: 0.85rem;
    background: var(--ink);
    color: #0a0b0e;
    padding: 0.85rem 1.6rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s ease, transform 0.15s ease;
}

body.home-v2 .contact-btn:hover {
    background: var(--acc);
    color: #fff;
    transform: translateY(-1px);
}

body.home-v2 footer {
    border-top: 1px solid var(--hairline);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-faint);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 980px) {
    .hero-v2 {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        min-height: auto;
        padding-top: 105px;
    }

    .hero-v2 .imessage-window {
        justify-self: center;
        max-width: 560px;
    }

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

@media (max-width: 560px) {
    body.home-v2 h1,
    .hero-name {
        white-space: normal;
    }

    .proj-card {
        flex-basis: 82vw;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-ghost {
        text-align: center;
    }

    .writing-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .writing-arrow {
        display: none;
    }
}
