/* abhaychaturvedi.com — editorial / image-first theme
   Inspired by meiwensee.com. Sans-serif, generous whitespace, italic accents.
   Single shared stylesheet. Light by default with a system-driven dark variant. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --bg: #fafaf6;
    --fg: #1a1a18;
    --muted: #6f6c64;
    --rule: #e2dfd6;
    --accent: #6f6c64;
    --link: #1a1a18;
    --link-hover: #6f6c64;
    --max-w: 1100px;
    --max-w-prose: 720px;
    --gap: 1.5rem;
    --radius: 0px;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
    --font-serif: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
    --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14130f;
        --fg: #ece9df;
        --muted: #908b80;
        --rule: #2a2823;
        --accent: #b8b3a6;
        --link: #ece9df;
        --link-hover: #b8b3a6;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
}

a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* Body-text links (paragraphs, list items) get a visible underline so they
   look clickable. Nav, buttons, image cards, and section rows handle their
   own affordance via hover states. */
main p a,
main li a {
    border-bottom-color: var(--rule);
}
main p a:hover,
main li a:hover {
    border-bottom-color: var(--fg);
}

em, .italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

.site-header {
    border-bottom: 0;
    padding-top: 1.4rem;
}
.site-header .inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.5rem 1.75rem 1.25rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 2rem;
}
.site-header .brand {
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--fg);
    border: 0;
}
.site-header .brand:hover { color: var(--muted); }
.site-header nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.site-header nav a {
    color: var(--fg);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border: 0;
}
.site-header nav a:hover,
.site-header nav a.is-active {
    color: var(--muted);
}

main {
    max-width: var(--max-w-prose);
    margin: 0 auto;
    padding: 4rem 1.75rem 5rem;
}

main.wide {
    max-width: var(--max-w);
}

h1, h2, h3 {
    font-family: var(--font-sans);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0 0 0.6em;
}
h1 { font-size: 2.4rem; font-weight: 500; }
h2 { font-size: 1.45rem; font-weight: 500; margin-top: 2.5rem; }
h3 { font-size: 1.05rem; font-weight: 500; }

p { margin: 0 0 1.1em; }

.lede {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.55;
}

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

hr.rule {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 3rem 0;
}

.button {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--fg);
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.button:hover {
    background: var(--fg);
    color: var(--bg);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-family: var(--font-sans);
    font-size: 1rem;
    border-radius: 0;
}
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-bottom-color: var(--fg);
}
textarea { min-height: 110px; resize: vertical; }
label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--muted);
    margin: 1.4rem 0 0.3rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.site-footer {
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 3rem;
}
.site-footer .inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.4rem 1.75rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    letter-spacing: 0.04em;
}

/* Editorial hero on home */
.hero {
    padding: 2rem 0 1.5rem;
    max-width: 920px;
}
.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: -0.018em;
    margin-bottom: 0;
}
.hero h1 em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

/* Featured photo strip on home — always 4 columns on desktop, 2 on mobile */
.feature-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 3rem 0;
}
@media (max-width: 720px) {
    .feature-strip { grid-template-columns: repeat(2, 1fr); }
}
.feature-strip a {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--rule);
    border: 0;
}
.feature-strip a:hover { border: 0; }
.feature-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0;
}
.feature-strip img.loaded { opacity: 1; }
.feature-strip a:hover img { transform: scale(1.04); }

/* Section list — replaces section grid on home */
.section-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 3rem;
    border-top: 1px solid var(--rule);
}
.section-list a.section-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.25rem 0.25rem;
    border-bottom: 1px solid var(--rule);
    border-top: 0;
    border-left: 0;
    border-right: 0;
    color: var(--fg);
    text-decoration: none;
    transition: padding 0.18s ease;
}
.section-list a.section-row:hover {
    padding-left: 0.75rem;
    border-bottom-color: var(--fg);
}
.section-list .row-title {
    font-size: 1.1rem;
    font-weight: 500;
}
.section-list .row-desc {
    color: var(--muted);
    font-size: 0.92rem;
    text-align: right;
    flex: 0 1 60%;
    margin-left: 1rem;
}

/* Photography gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.gallery a {
    display: block;
    overflow: hidden;
    background: var(--rule);
    aspect-ratio: 4 / 3;
    border: 0;
}
.gallery a:hover { border: 0; }
.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}
.gallery img.loaded { opacity: 1; }
.gallery a:hover img { transform: scale(1.03); }

.gallery-stats {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Category filter pills */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.cat-btn {
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--fg);
    padding: 0.45rem 0.95rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
}
.cat-btn:hover {
    border-color: var(--fg);
}
.cat-btn.is-active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}
.cat-btn .cat-count {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}
.cat-btn.is-active .cat-count {
    color: rgba(255, 255, 255, 0.55);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 19, 15, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}
.lightbox button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: #fafaf6;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    font-family: var(--font-sans);
}
.lightbox button:hover { opacity: 1; }
.lightbox .lb-prev { left: 0.5rem; }
.lightbox .lb-next { right: 0.5rem; }
.lightbox .lb-close { top: 0.5rem; right: 0.5rem; transform: none; font-size: 1.5rem; }
.lightbox .lb-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(250, 250, 246, 0.6);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Resume page */
.resume-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.resume-embed {
    width: 100%;
    height: 80vh;
    min-height: 520px;
    border: 1px solid var(--rule);
    background: var(--bg);
}

/* Contact + Guestbook layouts */
.col-narrow { max-width: 600px; }
.contact-links {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2.5rem;
}
.contact-links li {
    margin: 0;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}
.contact-links li:first-child { border-top: 1px solid var(--rule); }

.guestbook-entry {
    border-top: 1px solid var(--rule);
    padding: 1.25rem 0;
}
.guestbook-entry:first-child { border-top: 0; padding-top: 0; }
.guestbook-entry .meta {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.guestbook-entry .body {
    white-space: pre-wrap;
    color: var(--fg);
}

.flash {
    padding: 0.85rem 1rem;
    background: #f0eee5;
    color: #4a4730;
    border: 1px solid #c8c2a8;
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.flash.error { background: #f5e3dc; color: #6b2818; border-color: #d8a89a; }
@media (prefers-color-scheme: dark) {
    .flash { background: #2a2820; color: #d4cfa6; border-color: #4a4530; }
    .flash.error { background: #2e1f1a; color: #d8b1a4; border-color: #5a3a2c; }
}
