/* =========================================================================
   Tanmay Patange — Personal Site
   Warm, editorial, welcoming
   ========================================================================= */

:root {
    --bg:         #FDFAF6;
    --bg-warm:    #F5EFE6;
    --ink:        #1E1B18;
    --ink-mid:    #4A4540;
    --ink-soft:   #8A837A;
    --rule:       #E4DDD4;
    --accent:     #7B5544;   /* warm, earthy — personal without being corporate */

    --font-serif: 'Lora', Georgia, serif;
    --font-sans:  'Inter', system-ui, sans-serif;

    --w: 1080px;
    --pad: clamp(1.5rem, 6vw, 5rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.75;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body { overflow-x: hidden; }

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

a { color: inherit; text-decoration: none; }

em { font-style: italic; }

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(253, 250, 246, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    
    /* Hardware acceleration to prevent backdrop-filter flashing when URL rewrites */
    transform: translateZ(0);
    will-change: transform, backdrop-filter;
}

.nav {
    max-width: var(--w);
    margin: 0 auto;
    padding: 0 var(--pad);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.nav-contact {
    font-size: 0.85rem;
    color: var(--ink-mid);
    font-weight: 400;
    transition: color 0.2s;
}

.nav-contact:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
    max-width: var(--w);
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) var(--pad) clamp(4rem, 10vw, 8rem);
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(3rem, 7vw, 7rem);
    align-items: stretch;
}

/* Photo */
.hero-photo-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}

.hero-photo-wrap::after {
    content: '';
    position: absolute;
    inset: 12px -12px -12px 12px;   /* offset shadow behind the photo */
    background: var(--bg-warm);
    z-index: -1;
}

.hero-photo {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    object-position: top center;
    position: relative;
    z-index: 1;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.6s ease;
}

.hero-photo-wrap:hover .hero-photo {
    filter: grayscale(0%);
}

/* Text */
.hero-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-name {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.hero-role {
    font-size: 0.8rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 2rem;
}

.hero-bio {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--ink-mid);
    line-height: 1.85;
    max-width: 46ch;
    margin-bottom: 2.5rem;
    font-style: italic;
    font-weight: 400;
}

.cta {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 3px;
    align-self: flex-start;
    transition: color 0.2s, border-color 0.2s;
}

.cta:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── About / Services ── */
.about {
    background: var(--bg-warm);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: clamp(4rem, 8vw, 7rem) var(--pad);
}

.about-inner {
    max-width: var(--w);
    margin: 0 auto;
}

.about-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem 5rem;
}

/* .about-item has no extra styles — layout comes from the grid parent */

.about-item-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.about-item p {
    font-size: 0.95rem;
    color: var(--ink-mid);
    line-height: 1.8;
}

.about-item p em {
    font-style: italic;
    color: var(--ink);
}

/* ── Footer ── */
.footer {
    padding: clamp(5rem, 9vw, 8rem) var(--pad) 3rem;
}

.footer-grid {
    max-width: var(--w);
    margin: 0 auto 4rem;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: stretch;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.footer-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    color: var(--ink);
}

.footer-sub {
    font-size: 1rem;
    color: var(--ink-mid);
    max-width: 44ch;
    line-height: 1.75;
}

.footer-email {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-style: italic;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 2px;
    margin-top: 0.5rem;
    transition: opacity 0.2s;
}

.footer-email:hover { opacity: 0.7; }

.footer-socials {
    display: flex;
    gap: 1.25rem;
    margin-top: auto; /* Push to bottom to align with the left column */
    padding-top: 1.5rem;
}

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    transition: color 0.25s ease, transform 0.25s ease;
}

.footer-social svg {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.footer-social:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ── Newsletter ── */
.footer-newsletter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.6rem;
    height: 100%;
}

.newsletter-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}

.newsletter-desc {
    font-size: 1rem;
    color: var(--ink-mid);
    max-width: 44ch;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    width: 100%;
    max-width: 400px;
}

.newsletter-input-wrap {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.3s ease;
}

.newsletter-input-wrap:focus-within {
    border-color: var(--accent);
}

#newsletter-email {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--ink);
    background: transparent;
    border: none;
    padding: 0.75rem 0;
    outline: none;
}

#newsletter-email::placeholder {
    color: var(--ink-soft);
    font-style: italic;
}

#newsletter-submit {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    border: none;
    padding: 0.65rem 1.4rem;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
    white-space: nowrap;
}

#newsletter-submit:hover {
    background: #634438;
    transform: translateY(-1px);
}

#newsletter-submit:active {
    transform: translateY(0);
}

.newsletter-msg {
    font-size: 0.85rem;
    margin-top: 0.75rem;
    min-height: 1.2em;
    color: var(--ink-mid);
    font-style: italic;
}

.newsletter-msg.success {
    color: #4a7a5a;
}

.newsletter-msg.error {
    color: #9a4a3a;
}

.footer-geo {
    max-width: var(--w);
    margin: 0 auto;
    border-top: 1px solid var(--rule);
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.footer-geo a {
    color: var(--ink-soft);
    transition: color 0.2s;
}

.footer-geo a:hover {
    color: var(--accent);
}

.footer-geo .footer-geo-sep {
    color: var(--rule);
}

.footer-copy {
    max-width: var(--w);
    margin: 0 auto;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* ── Scroll reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ── Interactive Email Widget ── */
.title-block {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 6rem;
    padding: 0 2rem;
}

.title-block h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.title-block p {
    font-size: 1.25rem;
    color: var(--ink-mid);
    max-width: 50ch;
    margin: 0 auto;
}

.canvas {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 4rem;
}

.mockup-wrapper {
    position: relative;
    width: 650px;
}

.email-mockup {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 10;
}

.mac-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
}

.mac-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.email-meta {
    padding: 1.5rem;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
    color: var(--ink-mid);
}

.e-row {
    position: relative;
    margin-bottom: 0.5rem;
}

.e-row-body {
    position: relative;
    margin-bottom: 1.75rem;
}

.e-row-body:last-child {
    margin-bottom: 0;
}

.meta-flex {
    display: flex;
    align-items: flex-start;
}

.meta-label {
    width: 85px;
    color: var(--ink-soft);
    flex-shrink: 0;
    padding-top: 2px;
}

.meta-value {
    color: var(--ink);
    font-weight: 500;
}

.meta-subject {
    font-weight: 700;
    color: var(--ink);
    line-height: 1.5;
}

.blur-email {
    filter: blur(5px);
    opacity: 0.6;
    user-select: none;
    background: #ccc;
    color: transparent;
    border-radius: 4px;
}

.email-body {
    padding: 2rem 1.5rem 3rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
}

.hl {
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
    position: relative;
    z-index: 2;
    background: rgba(209, 73, 73, 0.12);
    border-bottom: 2px solid rgba(209, 73, 73, 0.4);
}

.note-left {
    position: absolute;
    right: 100%;
    margin-right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 5;
}

.note-right {
    position: absolute;
    left: 100%;
    margin-left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 5;
}

.hand-text {
    font-family: 'Caveat', cursive;
    font-size: 1.85rem;
    color: #D14949;
    line-height: 1.1;
    white-space: nowrap;
    font-weight: 600;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.02);
}

.rot-1 { transform: rotate(-3deg); }
.rot-2 { transform: rotate(2deg); }
.rot-3 { transform: rotate(-1deg); }
.rot-4 { transform: rotate(4deg); }
.rot-5 { transform: rotate(-4deg); }
.rot-6 { transform: rotate(1deg); }

.hand-text.multi {
    white-space: normal;
    width: 180px;
    text-align: center;
}

.hand-curve {
    overflow: visible;
    flex-shrink: 0;
    opacity: 0.9;
}

.note-interactive {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.note-hidden {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(-50%) scale(0.9);
}

.note-active {
    opacity: 1 !important;
    pointer-events: auto;
    cursor: pointer;
    z-index: 100;
    animation: shakeMe 2s cubic-bezier(.36,.07,.19,.97) infinite;
}

.note-done {
    opacity: 1 !important;
    pointer-events: none;
}

@keyframes shakeMe {
    0%, 100% { transform: translateY(-50%) scale(1) rotate(0deg); }
    10%, 30%, 50% { transform: translateY(-50%) scale(1.03) rotate(-2deg); }
    20%, 40% { transform: translateY(-50%) scale(1.03) rotate(2deg); }
    60% { transform: translateY(-50%) scale(1) rotate(0deg); }
}

.cursor {
    display: inline-block;
    width: 2px;
    background: var(--ink);
    animation: blink 0.7s infinite;
    margin-left: 2px;
    height: 1.1em;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 1250px) {
    .mockup-wrapper {
        width: 100%;
        max-width: 700px;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    .note-left,
    .note-right {
        position: relative;
        width: 100%;
        top: 0;
        transform: none;
        right: 0;
        left: 0;
        margin: 0 0 1rem 0;
        justify-content: flex-start;
    }
    .note-hidden {
        transform: scale(0.9);
    }
    .hand-curve {
        display: none;
    }
    .email-mockup {
        order: -1;
    }
}

@media (max-width: 750px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-photo-wrap::after {
        inset: 8px -8px -8px 8px;
    }

    .hero-photo {
        max-height: 400px;
        width: 100%;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .nav-contact { display: none; }
}
