/* =========================================================================
   Ansh Poonia — warm & playful, light only.
   A single hand-written stylesheet for the whole site. No build step.

   Sections:
     1.  Design tokens (colours, type scale, spacing)
     2.  Reset & base elements
     3.  Layout (page wrap, site header, footer)
     4.  Links, pills & buttons
     5.  Home: hero + portrait + about + updates
     6.  Egg rating (shared content component)
     7.  Blog index: cards
     8.  Blog post: article, callouts, code/quote, ratings
     9.  Paper-grain overlay
     10. Responsive + reduced-motion
   ========================================================================= */

/* 1. Design tokens ------------------------------------------------------- */

:root {
    /* Warm, light palette — light theme only */
    --paper:       #fdf7ee;   /* page background, warm cream            */
    --paper-2:     #f8f0e1;   /* deeper cream band / sunken sections    */
    --card:        #fffcf7;   /* card & panel surface                   */
    --sunk:        #f4ead8;   /* code blocks                            */

    --ink:         #2b2620;   /* warm near-black, headings + strong text*/
    --ink-2:       #4c4438;   /* body text                              */
    --muted:       #776b59;   /* dates, captions (AA on cream)          */

    --line:        #eadfcb;   /* hairline borders                       */

    --accent:      #b5430d;   /* clay/rust — links (AA on cream)        */
    --accent-2:    #97380a;   /* darker clay — text on honey tints      */

    --honey:       #f4b73e;   /* egg-yolk yellow (matches the egg SVGs) */
    --honey-deep:  #e59a12;   /* yolk outline / shadow                  */
    --honey-soft:  rgba(244, 183, 62, 0.18);  /* pill / highlight tint  */
    --honey-tint:  rgba(244, 183, 62, 0.34);  /* hover tint             */
    --blush:       #eba77f;   /* soft warm peach, decorative only       */

    /* Type */
    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans:  "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

    /* Shape & rhythm */
    --radius:   14px;
    --radius-s: 9px;
    --maxw:     48rem;
    --shadow:   0 10px 30px rgba(120, 88, 36, 0.13);
    --shadow-s: 0 4px 14px rgba(120, 88, 36, 0.10);
}

/* 2. Reset & base -------------------------------------------------------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    font-weight: 400;
    font-size: clamp(15.5px, 0.95rem + 0.25vw, 17.5px);
    line-height: 1.66;
    color: var(--ink-2);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

::selection { background: var(--honey-tint); color: var(--ink); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); margin: 0 0 0.35rem; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.8rem); margin: 2.4rem 0 0.7rem; }
h3 { font-size: clamp(1.18rem, 1.02rem + 0.6vw, 1.38rem); margin: 2rem 0 0.5rem; }
h4 { font-size: 1.06rem; margin: 1.7rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

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

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

ul, ol { margin: 0.6em 0 1.1em 1.2em; padding-left: 0.4em; }
li { margin-bottom: 0.35em; }
ul li::marker { color: var(--honey-deep); }
ul.tight { margin-left: 0.6em; padding-left: 0.6em; }

hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: 2.5rem 0;
}

/* 3. Layout -------------------------------------------------------------- */

.wrap {
    position: relative;
    z-index: 1;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 0 clamp(1.1rem, 4vw, 1.75rem);
}

/* Skip link for keyboard users */
.skip {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 100;
    background: var(--card);
    color: var(--accent);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-s);
}
.skip:focus { left: 0.6rem; top: 0.6rem; }

/* Site header --------------------------------------------------- */
.site-head {
    position: relative;
    z-index: 2;
}
.site-head__inner {
    max-width: var(--maxw);
    margin-inline: auto;
    padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1.1rem, 4vw, 1.75rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.12rem;
    color: var(--ink);
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark {
    width: auto;
    height: 1.65rem;
    transition: transform 0.3s ease;
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.08); }

.nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
}
.nav a {
    color: var(--ink-2);
    text-decoration: none;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.nav a:hover { background: var(--honey-soft); color: var(--accent-2); text-decoration: none; }
.nav a[aria-current="page"] {
    color: var(--accent-2);
    background: var(--honey-soft);
}

/* roomier tap targets on touch devices */
@media (pointer: coarse) {
    .nav a { padding-block: 0.5rem; }
    .pill  { padding-block: 0.6em; }
}

/* Footer -------------------------------------------------------- */
.site-footer {
    margin-top: 4rem;
    padding-block: 1.5rem 3rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    justify-content: space-between;
}
.site-footer .snoopy-icon { height: 1.6em; width: auto; vertical-align: -0.5em; }
.site-footer a { color: var(--accent); }

/* 4. Links, pills & buttons --------------------------------------------- */

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.18s ease;
}
a:hover { text-decoration: underline; text-underline-offset: 2px; }

a:focus-visible,
.pill:focus-visible,
.blog-card-link:focus-visible,
.brand:focus-visible,
.nav a:focus-visible {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
    border-radius: 5px;
    text-decoration: none;
}

/* Pill links — used for the home contact row */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.3rem 0 0;
    padding: 0;
    list-style: none;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--honey-soft);
    color: var(--accent-2);
    padding: 0.5em 0.9em;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.94rem;
    white-space: nowrap;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.pill:hover {
    background: var(--honey-tint);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-s);
}
.pill svg { width: 1em; height: 1em; }

/* 5. Home ---------------------------------------------------------------- */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 5vw, 2.5rem);
    align-items: center;
    padding: clamp(1rem, 4vw, 2.5rem) 0 0.5rem;
}

.hero__tagline {
    font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.18rem);
    color: var(--muted);
    margin: 0;
}
.hero__tagline strong { color: var(--ink-2); font-weight: 600; }

/* Playful yolk underline under the name */
.title-rule { position: relative; display: inline-block; }
.title-rule::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.12em;
    width: 100%;
    height: 0.18em;
    background: var(--honey);
    border-radius: 999px;
    transform: scaleX(0.55);
    transform-origin: left;
}

/* --- The portrait, on a warm halo --- */
.hero__art {
    position: relative;
    width: min(70vw, 230px);
    aspect-ratio: 1;
    margin: 0 auto;
}
.hero__art .glow {
    position: absolute;
    inset: -18%;
    background: radial-gradient(circle at 50% 52%,
                rgba(244, 183, 62, 0.40) 0%,
                rgba(244, 183, 62, 0.16) 38%,
                transparent 68%);
    border-radius: 50%;
    z-index: 0;
}
.hero__photo {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    border: 5px solid var(--card);
    box-shadow: var(--shadow);
    transform: rotate(2deg);
    transition: transform 0.3s ease;
}
.hero__art:hover .hero__photo { transform: rotate(0) scale(1.02); }

@media (min-width: 40rem) {
    .hero {
        grid-template-columns: 1.45fr 1fr;
        padding-top: clamp(1.5rem, 4vw, 3rem);
    }
    .hero__copy { order: 1; }
    .hero__art  { order: 2; width: min(34vw, 250px); }
}

/* About block (bio — the portrait lives in the hero) */
.about {
    margin-top: clamp(1.5rem, 5vw, 2.5rem);
}

/* Updates — a plain bulleted list (markers pick up the honey ::marker colour) */
.updates {
    margin: 0.8rem 0 0 1.2rem;
    padding-left: 0.4em;
}
.updates li {
    margin-bottom: 0.85rem;
}

/* 6. Egg rating (shared) ------------------------------------------------- */

.egg-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
}
.egg-icon {
    height: 1.1em;
    width: 1.1em;
    vertical-align: middle;
}
/* eggs wiggle when their blog card is hovered */
.blog-card-link:hover .egg-icon { animation: egg-wiggle 0.6s ease-in-out; }
.blog-card-link:hover .egg-icon:nth-child(2) { animation-delay: 0.06s; }
.blog-card-link:hover .egg-icon:nth-child(3) { animation-delay: 0.12s; }
.blog-card-link:hover .egg-icon:nth-child(4) { animation-delay: 0.18s; }
.blog-card-link:hover .egg-icon:nth-child(5) { animation-delay: 0.24s; }
@keyframes egg-wiggle {
    0%, 100% { transform: rotate(0); }
    30%      { transform: rotate(-13deg); }
    60%      { transform: rotate(10deg); }
}

/* 7. Blog index — cards -------------------------------------------------- */

.lede {
    font-size: clamp(1.02rem, 0.97rem + 0.35vw, 1.18rem);
    color: var(--ink-2);
}
.lede strong { color: var(--accent-2); }

.blog-card-link {
    display: block;
    color: inherit;
    margin-bottom: 1.1rem;
    border-radius: var(--radius);
}
.blog-card-link:hover { text-decoration: none; }

.blog-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem 1.4rem 1.35rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.blog-card::before {            /* warm accent spine on the left */
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--honey);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.blog-card-link:hover .blog-card {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--honey);
}
.blog-card-link:hover .blog-card::before { opacity: 1; }

.blog-card__title {
    font-family: var(--serif);
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}
.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0.5rem 0 0.7rem;
    flex-wrap: wrap;
}
.blog-card__desc { margin: 0; }
.blog-card__review {
    margin: 0.9rem 0 0;
    padding: 0.85rem 1.05rem;
    background: var(--honey-soft);
    border-left: 3px solid var(--honey);
    border-radius: var(--radius-s);
    font-style: italic;
    color: var(--ink-2);
}
.blog-card__review strong { font-style: normal; color: var(--accent-2); }

.date {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.86rem;
    color: var(--muted);
}
.dot { color: var(--line); }

/* 8. Blog post ----------------------------------------------------------- */

.crumbs {
    font-size: 0.92rem;
    color: var(--muted);
    margin: 0 0 0.6rem;
}
.crumbs a { color: var(--accent); }
.crumbs .sep { color: var(--line); margin: 0 0.35rem; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin: 0.4rem 0 1.5rem;
}

/* Verdict note at the top of a post */
.verdict {
    margin: 0 0 2rem;
    padding: 1rem 1.2rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--honey);
    border-radius: var(--radius-s);
    font-style: italic;
    color: var(--ink-2);
}
.verdict strong { font-style: normal; color: var(--accent-2); }

.post p { color: var(--ink-2); }
.post a { font-weight: 500; }

/* Code / quote blocks (the model transcripts) */
.code {
    background: var(--sunk);
    border: 1px solid var(--line);
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-s);
    font-family: var(--mono);
    font-size: 0.84rem;
    line-height: 1.6;
    font-weight: 300;
    color: var(--ink);
    margin: 1.2rem 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* an inline pull/aside callout */
.callout {
    margin: 1.4rem 0;
    padding: 1rem 1.2rem;
    background: var(--honey-soft);
    border-radius: var(--radius-s);
}

.center { text-align: center; color: var(--muted); letter-spacing: 0.3em; }
.indent { padding-left: 1.1rem; }

/* Ratings table at the close of a post */
.ratings {
    border-collapse: collapse;
    margin: 0.5rem 0 1.5rem;
    font-size: 0.97rem;
    text-align: left;
}
.ratings th, .ratings td { padding: 0.3rem 1.5rem 0.3rem 0; border-bottom: 1px solid var(--line); }
.ratings thead th {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.ratings tbody th { font-weight: 400; color: var(--ink-2); }
.ratings tbody tr:last-child th,
.ratings tbody tr:last-child td { border-bottom: 0; }
.ratings td:last-child { color: var(--accent-2); font-weight: 600; font-family: var(--mono); }

/* 9. Paper-grain overlay ------------------------------------------------- */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 10. Responsive & reduced-motion --------------------------------------- */

@media (max-width: 30rem) {
    .hero__art { width: min(58vw, 190px); }
    .blog-card { padding: 1.05rem 1.1rem 1.15rem; }
    .code { padding: 0.8rem 0.9rem; }
    .nav a { padding: 0.3rem 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
}
