/* Krutik Shah — portfolio theme (dark, purple accent, mono details) */

:root {
    --bg: #0D1117;
    --surface: #161B22;
    --surface-2: #21262D;
    --titlebar: #12171E;
    --border: #30363D;
    --text: #E6EDF3;
    --text-2: #C9D1D9;
    --muted: #9198A1;
    --faint: #7D8590;
    --accent: #A78BFA;
    --accent-soft: #C4B5FD;
    --glow: rgba(167, 139, 250, 0.16);
    --sans: 'Geist', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(rgba(201, 209, 217, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

main { flex: 1 0 auto; }

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

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-weight: 600; color: var(--text); }
p { margin: 0; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.mono { font-family: var(--mono); }

/* ---------- Nav ---------- */

.nav {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.brand {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .cursor { font-family: var(--mono); font-weight: 400; color: var(--accent); }

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(22, 27, 34, 0.8);
    font-family: var(--mono);
    font-size: 13px;
}
.nav-links a {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav-links a.nav-resume { color: var(--accent); }
.nav-links a.nav-resume:hover { color: var(--accent-soft); }

@media (max-width: 600px) {
    .nav { flex-direction: column; align-items: stretch; }
    .brand { text-align: center; }
    .nav-links { justify-content: center; font-size: 12px; border-radius: 18px; }
    .nav-links a { padding: 10px 8px; flex: 1 1 auto; text-align: center; }
    .nav-links .ext { display: none; }
}

/* ---------- Shared bits ---------- */

.glow {
    position: absolute;
    left: 50%;
    width: 900px;
    height: 620px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, var(--glow) 0%, transparent 65%);
    pointer-events: none;
}

.label {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

.status-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 14px;
    border-radius: 999px;
}

.dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 14px 24px;
    border-radius: 10px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, filter 0.2s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent); color: var(--bg); filter: brightness(1.12); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-2);
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 6px;
}

.section { padding-top: 120px; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 32px;
}
.section-head > div { display: flex; flex-direction: column; gap: 10px; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.025em; }

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

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 28px;
    padding-top: clamp(48px, 9vw, 112px);
    padding-bottom: 72px;
}
.hero .glow { top: -140px; }

.avatar {
    position: relative;
    width: 136px;
    height: 136px;
    padding: 4px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 0 0 6px rgba(13, 17, 23, 0.9), 0 0 40px var(--glow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.hero h1 {
    position: relative;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.035em;
    max-width: 860px;
}
.hero h1 .hl { color: var(--accent); }

.hero .lead {
    position: relative;
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 560px;
}

.hero .btn-row { position: relative; justify-content: center; margin-top: 4px; }

/* Smaller page header (projects / contact) */
.page-head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding-top: clamp(40px, 7vw, 80px);
    padding-bottom: 56px;
}
.page-head .glow { top: -220px; }
.page-head h1 {
    position: relative;
    font-size: clamp(36px, 6vw, 60px);
    letter-spacing: -0.035em;
    line-height: 1.05;
}
.page-head p { position: relative; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 560px; }
.page-head .label { position: relative; }

/* ---------- Terminal ---------- */

.terminal {
    max-width: 760px;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    overflow: hidden;
}
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--titlebar);
}
.terminal-bar span:not(.terminal-title) {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--border);
}
.terminal-title {
    flex: 1;
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
    margin-right: 38px;
}
.terminal-body {
    padding: 22px 24px 24px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.9;
    overflow-x: auto;
}
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body dl { margin: 0; }
.terminal-body .row { display: flex; gap: 16px; white-space: nowrap; }
.terminal-body dt { flex: 0 0 96px; color: var(--faint); }
.terminal-body dd { margin: 0; color: var(--text-2); }
.caret {
    display: inline-block;
    width: 9px;
    height: 17px;
    vertical-align: -3px;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 600px) {
    .terminal-body { font-size: 12.5px; padding: 18px 16px 20px; }
    .terminal-body .row { flex-direction: column; gap: 0; white-space: normal; margin-bottom: 6px; }
    .terminal-body dt { flex: none; }
}

/* ---------- Project cards ---------- */

.card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); }

.featured { display: flex; flex-wrap: wrap; margin-bottom: 16px; }
.featured-media { flex: 1 1 420px; min-height: 280px; background: var(--bg); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-body {
    flex: 1 1 360px;
    padding: clamp(24px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}
.featured-body .meta { display: flex; justify-content: space-between; gap: 12px; }
.featured-body .meta .ok { color: var(--accent); }
.featured-body h3 { font-size: 28px; letter-spacing: -0.02em; }
.featured-body p { font-size: 16px; line-height: 1.65; color: var(--muted); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 16px;
}

.project { display: flex; flex-direction: column; }
.project-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-body { flex: 1; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.project-body h3 { font-size: 20px; letter-spacing: -0.015em; }
.project-body p { flex: 1; font-size: 15px; line-height: 1.6; color: var(--muted); }

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: var(--mono);
    font-size: 13px;
}
.project-body .links { padding-top: 12px; border-top: 1px solid var(--surface-2); }
.links a { padding: 4px 0; }

.more { margin-top: 28px; text-align: center; }

/* ---------- About ---------- */

.about { display: flex; flex-wrap: wrap; gap: 40px; }
.about-head { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; }
.about-head h2 { font-size: clamp(28px, 3.5vw, 36px); letter-spacing: -0.025em; }
.about-body {
    flex: 999 1 480px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--muted);
}

/* ---------- CTA ---------- */

.cta {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    padding: clamp(36px, 7vw, 72px) clamp(20px, 5vw, 48px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.cta .glow { top: auto; bottom: -260px; width: 700px; height: 420px; }
.cta > *:not(.glow) { position: relative; }
.cta h2 { font-size: clamp(30px, 4.5vw, 48px); letter-spacing: -0.03em; }
.cta .btn-row { justify-content: center; }

/* ---------- Contact form ---------- */

.form-card {
    max-width: 640px;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 18px;
    padding: clamp(24px, 5vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.field label .opt { color: var(--faint); }
.field input,
.field textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}
.form-card .btn { width: 100%; }

.socials { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
.socials a {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    color: var(--text-2);
    font-size: 20px;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 56px;
    padding-bottom: 40px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .caret { animation: none; }
    .card, .card:hover { transition: none; transform: none; }
}

/* ---------- Photography ---------- */

.photo-page { --ph-gap: 6px; }

/* Hero: title + two portrait drone films */
.ph-hero {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(32px, 6vw, 72px) var(--gutter) 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(32px, 6vw, 80px);
}
.ph-hero .glow { top: -200px; left: 30%; }
.ph-hero-text {
    position: relative;
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.ph-hero-text h1 {
    font-size: clamp(52px, 9vw, 120px);
    font-weight: 500;
    line-height: 0.92;
    letter-spacing: -0.045em;
}
.ph-hero-text .lead { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 440px; }
.ph-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}
.ph-stats b { color: var(--text-2); font-weight: 500; }

.ph-films {
    position: relative;
    flex: 0 1 auto;
    display: flex;
    gap: 14px;
    margin: 0 auto;
}
.ph-film {
    margin: 0;
    width: clamp(150px, 21vw, 290px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ph-film:nth-child(2) { margin-top: 64px; }
.ph-film video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: block;
}
.ph-film figcaption { display: flex; justify-content: space-between; gap: 8px; }
.ph-film figcaption .ok { color: var(--accent); }

.ph-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}
.ph-toggle:hover { color: var(--text); }

/* Intro: photographer portrait + text */
.ph-intro {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(80px, 11vw, 140px) var(--gutter) clamp(48px, 7vw, 72px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(28px, 5vw, 56px);
}
.ph-intro img {
    flex: 0 0 auto;
    width: clamp(160px, 22vw, 220px);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin: 0 auto;
}
.ph-intro-text { flex: 1 1 340px; display: flex; flex-direction: column; gap: 14px; }
.ph-intro h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 500; letter-spacing: -0.03em; }
.ph-intro p { font-size: 17px; line-height: 1.7; color: var(--muted); }

/* Category tabs */
.ph-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 28px;
    padding: 0 var(--gutter) 28px;
}
.ph-tabs[hidden] { display: none; }
.ph-tab {
    min-height: 44px;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.ph-tab:hover { color: var(--text); }
.ph-tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ph-tab .n { color: var(--faint); margin-left: 4px; }

/* Edge-to-edge gallery (portrait-friendly: 4 columns on wide screens) */
.ph-gallery {
    columns: 4 280px;
    column-gap: var(--ph-gap);
    padding: 0 var(--ph-gap);
}
.photo {
    position: relative;
    margin: 0 0 var(--ph-gap);
    break-inside: avoid;
    overflow: hidden;
    border-radius: 4px;
    background: var(--surface);
}
.photo[hidden] { display: none; }
.photo button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.photo img { width: 100%; height: auto; transition: transform 0.6s ease; }
.photo:hover img { transform: scale(1.025); }
.photo figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 48px 16px 14px;
    background: linear-gradient(to top, rgba(8, 10, 14, 0.85), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.photo:hover figcaption,
.photo:focus-within figcaption { opacity: 1; }
.photo-title { font-size: 15px; font-weight: 500; color: var(--text); }

.ph-outro { padding-top: clamp(64px, 10vw, 112px); }

.empty { max-width: 640px; margin: 0 auto; }

/* Lightbox */
.lightbox {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(8, 10, 14, 0.97);
    color: var(--text);
}
.lightbox::backdrop { background: rgba(8, 10, 14, 0.97); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--gutter);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
}
.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 clamp(8px, 6vw, 88px);
}
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px var(--gutter) 24px;
    text-align: center;
}
.lb-btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 18px;
    cursor: pointer;
}
.lb-btn:hover { color: var(--accent); border-color: var(--accent); }
.lb-btn[hidden] { display: none; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: var(--gutter); }
.lb-next { right: var(--gutter); }

@media (max-width: 600px) {
    .photo-page { --ph-gap: 4px; }
    .ph-gallery { columns: 2; }
    .ph-films { width: 100%; gap: 10px; }
    .ph-film { flex: 1 1 0; width: auto; }
    .ph-film:nth-child(2) { margin-top: 40px; }
    .ph-intro { text-align: center; }
    .photo figcaption { display: none; }
    .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
    .lightbox-stage { padding-bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .photo img { transition: none; }
    .photo:hover img { transform: none; }
}
