/* ================================================
   DESIGN TOKENS
   ================================================ */
:root {
    --bg:           #FAFAF8;
    --bg-hover:     #F2F1EF;
    --fg:           #1A1A1A;
    --fg-2:         #5C5C5C;
    --fg-3:         #999999;
    --border:       #D8D8D4;
    --pill-bg:      #2C2C2C;
    --pill-fg:      #FFFFFF;

    --font-d: 'Bodoni Moda', 'Georgia', serif;
    --font-b: 'Hanken Grotesk', 'Helvetica Neue', sans-serif;

    --max-w:  1140px;
    --gutter: clamp(1.25rem, 5vw, 4rem);

    --ease:   cubic-bezier(.25,.46,.45,.94);
    --dur:    .35s;
}

/* ================================================
   RESET & BASE
   ================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font-b);
    font-weight: 400;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
    text-underline-offset: .2em;
    transition: color var(--dur) var(--ease);
}

ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }

/* --- Browser surfaces --- */
::selection { background: var(--fg); color: var(--bg); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-2); }

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

/* ================================================
   LAYOUT
   ================================================ */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding: 6rem 0;
    border-top: 1px solid var(--border);
}

.section__pill {
    display: inline-block;
    background: var(--pill-bg);
    color: var(--pill-fg);
    font-family: var(--font-b);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .18em;
    padding: .55rem 1.4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.section__meta {
    font-size: .75rem;
    font-weight: 400;
    letter-spacing: .14em;
    color: var(--fg-2);
    margin-bottom: 3.5rem;
}

/* ================================================
   NAVIGATION
   ================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem var(--gutter);
    background: var(--bg);
    transition: box-shadow var(--dur) var(--ease);
}

.nav.scrolled { box-shadow: 0 1px 0 var(--border); }

.nav__logo {
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .18em;
    color: var(--fg-2);
}

.nav__links { display: flex; gap: 2.5rem; }

.nav__link {
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .14em;
    color: var(--fg-3);
    position: relative;
    padding-bottom: 2px;
}

.nav__link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0;
    height: 1px;
    background: var(--fg);
    transition: width var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link.active { color: var(--fg); }
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; }
.nav__toggle span {
    display: block;
    width: 20px;
    height: 1px;
    background: var(--fg);
    transition: transform var(--dur) var(--ease);
}

/* ================================================
   SCROLL INDICATOR
   ================================================ */
.scroll-ind {
    position: fixed;
    right: 1.75rem;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: center;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.scroll-ind__text {
    font-size: .5625rem;
    font-weight: 500;
    letter-spacing: .22em;
    color: var(--fg-3);
    white-space: nowrap;
}

.scroll-ind__line {
    width: 2.5rem;
    height: 1px;
    background: var(--border);
}

/* ================================================
   HERO
   ================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
}

.hero__grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 3rem;
}

.hero__label {
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .2em;
    color: var(--fg-2);
    margin-bottom: 1.5rem;
}

.hero__name {
    font-family: var(--font-d);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 400;
    font-variation-settings: 'opsz' 12;
    line-height: 1.05;
    letter-spacing: .02em;
    margin-bottom: 2rem;
}

.hero__intro {
    max-width: 38ch;
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--fg-2);
    margin-bottom: 2rem;
}

.hero__links {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8125rem;
    font-weight: 500;
}

.hero__links a { text-decoration: underline; text-underline-offset: .25em; }
.hero__links a:hover { color: var(--fg-2); }

.dot { color: var(--fg-3); user-select: none; }

.hero__meta {
    text-align: right;
    font-size: .6875rem;
    font-weight: 400;
    letter-spacing: .14em;
    color: var(--fg-3);
    line-height: 1.8;
    flex-shrink: 0;
}

/* Hero entrance */
.anim-hero {
    opacity: 0;
    transform: translateY(1.5rem);
    animation: heroIn .9s var(--ease) forwards;
    animation-delay: calc(var(--d) * .15s + .2s);
}

@keyframes heroIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================
   EXPERIENCE
   ================================================ */
.exp {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
}

.exp:last-child { border-bottom: 1px solid var(--border); }

.exp__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.exp__company {
    font-family: var(--font-d);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
}

.exp__company a { text-decoration: underline; text-decoration-thickness: 1px; }
.exp__company a:hover { color: var(--fg-2); }

.exp__role {
    font-size: .8125rem;
    color: var(--fg-2);
    margin-top: .25rem;
}

.exp__date {
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .14em;
    color: var(--fg-3);
    white-space: nowrap;
    padding-top: .4rem;
}

.exp__bullets {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 65ch;
}

.exp__bullets li {
    position: relative;
    padding-left: 1.25rem;
    font-size: .875rem;
    line-height: 1.65;
    color: var(--fg-2);
}

.exp__bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .6em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--fg-3);
}

/* ================================================
   PROJECT INDEX TABLE
   ================================================ */
.idx { margin-bottom: 5rem; }

.idx__head,
.idx__row {
    display: grid;
    grid-template-columns: 4rem 1fr 10rem 5rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.idx__head {
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: .16em;
    color: var(--fg-3);
    border-bottom-width: 1px;
}

.idx__row {
    font-size: .875rem;
    font-weight: 400;
    letter-spacing: .08em;
    color: var(--fg);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    text-decoration: none;
    cursor: pointer;
}

.idx__row:hover {
    background: var(--bg-hover);
}

.idx__c--num {
    font-size: .75rem;
    color: var(--fg-3);
    font-weight: 400;
}

.idx__c--name {
    font-weight: 500;
    letter-spacing: .1em;
}

.idx__c--type {
    font-size: .6875rem;
    letter-spacing: .14em;
    color: var(--fg-2);
}

.idx__c--year {
    text-align: right;
    font-size: .75rem;
    color: var(--fg-3);
}

.idx__foot {
    padding: 1rem 0;
    font-size: .625rem;
    letter-spacing: .14em;
    color: var(--fg-3);
}

/* --- Hover preview (disabled) --- */
.preview {
    display: none;
}

/* ================================================
   PROJECT DETAIL CARDS
   ================================================ */
.pcards { display: flex; flex-direction: column; gap: 0; }

.pc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4.5rem 0;
    border-top: 1px solid var(--border);
    align-items: center;
}

.pc:last-child { border-bottom: 1px solid var(--border); }

.pc--rev .pc__vis { order: -1; }

.pc__num {
    display: block;
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .16em;
    color: var(--fg-3);
    margin-bottom: 1rem;
}

.pc__title {
    font-family: var(--font-d);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.pc__desc {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--fg-2);
    max-width: 50ch;
    margin-bottom: 1.5rem;
}

.pc__scope {
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: .16em;
    color: var(--fg-3);
    margin-bottom: 1.75rem;
}

.pc__link {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .1em;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--fg);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.pc__link:hover { color: var(--fg-2); border-color: var(--fg-3); }

.pc__vis {
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.pc__vis img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}

.pc:hover .pc__vis img { transform: scale(1.03); }

/* Gradient fallbacks when images haven't loaded */
.pc__vis--remind  { background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); }
.pc__vis--chithhi { background: linear-gradient(135deg, #2d3436, #636e72, #2d3436); }
.pc__vis--dsa2z   { background: linear-gradient(135deg, #1a332e, #2d6a4f, #3d6b5e); }
.pc__vis--toenail { background: linear-gradient(135deg, #3d1c02, #8b5e3c, #6b3a2a); }

/* ================================================
   BLOG / WRITINGS
   ================================================ */
.blog-list { display: flex; flex-direction: column; }

.bl {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--dur) var(--ease);
}

.bl:first-child { border-top: 1px solid var(--border); }

.bl:hover { background: var(--bg-hover); padding-left: .75rem; padding-right: .75rem; }

.bl__num {
    font-size: .75rem;
    color: var(--fg-3);
    font-weight: 400;
}

.bl__title {
    font-family: var(--font-d);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.35;
}

.bl__src {
    font-size: .6875rem;
    color: var(--fg-3);
    letter-spacing: .06em;
    margin-top: .25rem;
}

.bl__arrow {
    font-size: 1rem;
    color: var(--fg-3);
    transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.bl:hover .bl__arrow { transform: translateX(4px); color: var(--fg); }

/* ================================================
   ACHIEVEMENTS
   ================================================ */
.ach-list { display: flex; flex-direction: column; gap: 0; }

.ach {
    display: flex;
    gap: 2rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    align-items: flex-start;
}

.ach:last-child { border-bottom: 1px solid var(--border); }

.ach__badge {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    font-family: var(--font-d);
    font-size: 1rem;
    font-weight: 500;
    color: var(--fg);
}

.ach__title {
    font-family: var(--font-d);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: .5rem;
}

.ach__desc {
    font-size: .875rem;
    line-height: 1.65;
    color: var(--fg-2);
    max-width: 55ch;
}

/* ================================================
   SKILLS
   ================================================ */
.sk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 4rem;
}

.sk { padding: 2rem 0; border-top: 1px solid var(--border); }

.sk__cat {
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .18em;
    color: var(--fg-3);
    margin-bottom: .75rem;
}

.sk__list {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--fg-2);
}

.sk__links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.sk__links a {
    font-size: .875rem;
    text-decoration: underline;
    text-underline-offset: .25em;
    color: var(--fg-2);
}

.sk__links a:hover { color: var(--fg); }

/* ================================================
   CONTACT
   ================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.ci {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: color var(--dur) var(--ease);
}

.ci:nth-child(-n+2) { border-top: 1px solid var(--border); }
.ci:nth-child(odd) { padding-right: 2rem; }
.ci:nth-child(even) { padding-left: 2rem; border-left: 1px solid var(--border); }

.ci__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: border-color var(--dur) var(--ease);
}

.ci:hover .ci__icon { border-color: var(--fg); }

.ci__text {
    font-size: .75rem;
    font-weight: 400;
    letter-spacing: .1em;
    color: var(--fg-2);
    transition: color var(--dur) var(--ease);
}

.ci:hover .ci__text { color: var(--fg); }

/* ================================================
   FOOTER
   ================================================ */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer__tag {
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: .18em;
    color: var(--fg-3);
}

.footer__name {
    font-family: var(--font-d);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: .08em;
}

.footer__copy {
    font-size: .625rem;
    letter-spacing: .12em;
    color: var(--fg-3);
}

/* ================================================
   MOBILE OVERLAY
   ================================================ */
.mob-overlay {
    position: fixed;
    inset: 0;
    z-index: 850;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease);
}

.mob-overlay.open { opacity: 1; pointer-events: auto; }

.mob-overlay__link {
    font-family: var(--font-d);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: .04em;
}

/* ================================================
   SCROLL REVEAL
   ================================================ */
.reveal {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
    .hero__grid { flex-direction: column; align-items: flex-start; }
    .hero__meta { text-align: left; }

    .pc { grid-template-columns: 1fr; }
    .pc--rev .pc__vis { order: 0; }
    .pc__vis { aspect-ratio: 16/10; }

    .sk-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .ci:nth-child(even) { padding-left: 0; border-left: none; }
    .ci:nth-child(-n+2) { border-top: none; }
    .ci:first-child { border-top: 1px solid var(--border); }

    .idx__head,
    .idx__row {
        grid-template-columns: 3rem 1fr auto;
    }
    .idx__c--type { display: none; }
}

@media (max-width: 640px) {
    .nav__links { display: none; }
    .nav__toggle { display: flex; }
    .scroll-ind { display: none; }

    .hero { min-height: 85vh; }
    .hero__name { font-size: clamp(2rem, 10vw, 3.5rem); }
    .hero__intro { font-size: .875rem; }

    .section { padding: 4rem 0; }
    .section__meta { margin-bottom: 2.5rem; }

    .pc { padding: 3rem 0; gap: 2rem; }
    .pc__title { font-size: 1.5rem; }

    .bl { grid-template-columns: 2.5rem 1fr auto; gap: 1rem; }
    .bl__title { font-size: 1rem; }

    .ach { flex-direction: column; gap: 1.25rem; }

    .footer__row { flex-direction: column; align-items: flex-start; }
}

/* --- Hamburger open state --- */
.nav__toggle.open span:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}
.nav__toggle.open span:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}
