/* =====================================================================
   SUMI MATCHA — site styles

   Almost everything you'll want to tweak lives in the :root block below.
   Change a value there once and it updates everywhere on the site.
   ===================================================================== */

/* ---- Self-hosted fonts ------------------------------------------------
   Served from wwwroot/fonts so no visitor data ever goes to Google
   (GDPR). To change fonts, drop new .woff2 files in wwwroot/fonts and
   update these blocks plus the --font-* variables below. */
@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/fraunces.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/fraunces-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("../fonts/outfit.woff2") format("woff2");
}

:root {
    /* ---- COLORS ----
       Change these to re-theme the whole site. */
    --color-bg-top:     #f7ede8;   /* warm cream at the top of the page    */
    --color-bg-bottom:  #ecd3ce;   /* dusty pink at the bottom             */
    --color-ink:        #41312c;   /* darkest text (headings, brand)       */
    --color-text:       #5c4a47;   /* main warm brown text                 */
    --color-muted:      #937973;   /* lighter text (subtext, links, notes) */
    --color-accent:     #66773f;   /* matcha green for buttons/links       */
    --color-accent-deep:#50602f;   /* darker matcha (hovers, italics)      */
    --color-accent-ink: #fffdf9;   /* text drawn on top of the accent      */
    --color-surface:    #fffdf9;   /* input box / card background          */
    --color-error:      #b1554f;   /* validation error text                */

    /* Background blob tints (the soft drifting shapes behind the page) */
    --blob-green: rgba(148, 166, 106, 0.45);
    --blob-pink:  rgba(231, 173, 165, 0.55);
    --blob-cream: rgba(255, 247, 235, 0.9);

    /* ---- FONTS ----
       The font *families* are loaded in Pages/Shared/_Layout.cshtml.
       If you change a family here, update the <link> there too. */
    --font-heading: "Fraunces", "Georgia", serif;        /* editorial serif */
    --font-body:    "Outfit", system-ui, sans-serif;     /* clean body text */

    --font-size-heading: clamp(3rem, 9.5vw, 5.75rem);
    --font-size-subtext: clamp(1.05rem, 2.6vw, 1.3rem);

    /* ---- LAYOUT ----  (spacing + sizing knobs) */
    --max-width: 720px;
    --radius:    999px;
    --gap:       0.75rem;
    --shadow-soft:  0 18px 45px -18px rgba(92, 60, 52, 0.35);
    --shadow-lift:  0 10px 25px -10px rgba(80, 96, 47, 0.55);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, var(--color-bg-top) 0%, var(--color-bg-bottom) 100%) fixed;
    color: var(--color-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Fine film-grain overlay across the whole page — adds texture so the
   gradient doesn't look flat. Delete this block for a perfectly clean look. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
    color: inherit;
}

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

/* ---- Decorative background blobs -------------------------------------
   Three big, blurred, slowly drifting shapes that sit behind the content.
   Tints come from the --blob-* variables in :root. */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    animation: blob-drift 16s ease-in-out infinite alternate;
}

.blob-a {
    width: 48vmax;
    height: 48vmax;
    top: -18vmax;
    right: -14vmax;
    background: radial-gradient(circle at 35% 35%, var(--blob-green), transparent 70%);
}

.blob-b {
    width: 44vmax;
    height: 44vmax;
    bottom: -20vmax;
    left: -12vmax;
    background: radial-gradient(circle at 60% 40%, var(--blob-pink), transparent 70%);
    animation-delay: -6s;
    animation-duration: 20s;
}

.blob-c {
    width: 34vmax;
    height: 34vmax;
    top: 30%;
    left: 28%;
    background: radial-gradient(circle, var(--blob-cream), transparent 65%);
    animation-delay: -11s;
    animation-duration: 24s;
}

@keyframes blob-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vmax, -3vmax, 0) scale(1.08); }
}

/* Content layers sit above the backdrop */
.site-header,
.site-main,
.site-footer {
    position: relative;
    z-index: 1;
}

/* ---- Top navigation bar ---------------------------------------------- */
.site-header {
    padding: 1.75rem 2.25rem;
}

.brand {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    color: var(--color-ink);
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.7;
}

.brand-dot {
    color: var(--color-accent);
}

/* ---- Centered hero area ---------------------------------------------- */
.site-main {
    flex: 1;
    display: flex;
    padding: 2rem 1.5rem;
    text-align: center;
}

/* margin:auto centers the hero like align-items/justify-content would, but
   still lets tall content (e.g. the privacy policy) scroll without clipping */
.hero {
    width: 100%;
    max-width: var(--max-width);
    margin: auto;
}

/* Gentle staggered entrance for everything inside the hero */
.hero > * {
    animation: rise-in 0.8s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}

.hero > *:nth-child(2) { animation-delay: 0.08s; }
.hero > *:nth-child(3) { animation-delay: 0.16s; }
.hero > *:nth-child(4) { animation-delay: 0.24s; }
.hero > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Small uppercase label above the heading */
.hero-kicker {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.42em;
    text-indent: 0.42em; /* visually re-centers letter-spaced text */
    text-transform: uppercase;
    color: var(--color-accent);
}

.hero-heading {
    font-family: var(--font-heading);
    font-size: var(--font-size-heading);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--color-ink);
    margin: 0 0 1.25rem;
    text-wrap: balance;
}

/* The italic word inside the heading, e.g. "brewing" */
.hero-heading em {
    font-style: italic;
    font-weight: 500;
    color: var(--color-accent-deep);
}

.hero-subtext {
    font-size: var(--font-size-subtext);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-muted);
    margin: 0 auto 2.25rem;
    max-width: 32rem;
    text-wrap: balance;
}

/* ---- Matcha bowl illustration ----------------------------------------
   The little bowl with rising steam above the heading (inline SVG in
   Pages/Index.cshtml). Colors inherit from the variables below. */
.hero-bowl {
    width: 96px;
    height: auto;
    margin-bottom: 0.75rem;
    color: var(--color-muted); /* steam color */
}

.hero-bowl .bowl-body {
    fill: var(--color-surface);
    stroke: var(--color-ink);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.hero-bowl .bowl-foot {
    fill: var(--color-ink);
}

.hero-bowl .bowl-tea {
    fill: var(--color-accent);
    stroke: var(--color-ink);
    stroke-width: 2.5;
}

.hero-bowl .steam path {
    animation: steam-rise 2.8s ease-in-out infinite;
}

.hero-bowl .steam-2 { animation-delay: 0.5s; }
.hero-bowl .steam-3 { animation-delay: 1s; }

@keyframes steam-rise {
    0%   { opacity: 0;   transform: translateY(5px); }
    35%  { opacity: 0.9; }
    100% { opacity: 0;   transform: translateY(-7px); }
}

/* ---- Email signup form ------------------------------------------------
   The input and button live together inside one white "capsule". */
.signup-form {
    margin: 0 auto;
    max-width: 480px;
}

.signup-row {
    display: flex;
    gap: 0.375rem;
    padding: 0.375rem;
    background: var(--color-surface);
    border: 1px solid rgba(92, 74, 71, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.signup-row:focus-within {
    border-color: rgba(102, 119, 63, 0.55);
    box-shadow: var(--shadow-soft), 0 0 0 4px rgba(102, 119, 63, 0.16);
}

.email-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.8rem 0.75rem 0.8rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}

.email-input::placeholder {
    color: rgba(92, 74, 71, 0.4);
}

.signup-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    background: var(--color-accent);
    color: var(--color-accent-ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.signup-button svg {
    transition: transform 0.2s ease;
}

.signup-button:hover {
    background: var(--color-accent-deep);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lift);
}

.signup-button:hover svg {
    transform: translateX(3px);
}

.signup-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* On very narrow screens the capsule splits into stacked pills */
@media (max-width: 480px) {
    .signup-row {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: var(--gap);
        box-shadow: none;
    }

    .signup-row:focus-within {
        box-shadow: none;
    }

    .email-input {
        background: var(--color-surface);
        border: 1px solid rgba(92, 74, 71, 0.18);
        padding: 0.95rem 1.25rem;
        box-shadow: var(--shadow-soft);
    }

    .email-input:focus {
        border-color: rgba(102, 119, 63, 0.55);
        box-shadow: var(--shadow-soft), 0 0 0 4px rgba(102, 119, 63, 0.16);
    }

    .signup-button {
        justify-content: center;
        padding: 0.95rem 1.5rem;
    }
}

.field-error {
    display: block;
    margin-top: 0.75rem;
    color: var(--color-error);
    font-size: 0.95rem;
}

.field-error:empty {
    display: none;
}

.signup-note {
    margin: 1rem auto 0;
    max-width: 26rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--color-muted);
    opacity: 0.85;
}

.signup-note-link {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.signup-note-link:hover {
    color: var(--color-accent-deep);
}

/* ---- Thank-you (signed up) state -------------------------------------- */
.success-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-accent-ink);
    box-shadow: var(--shadow-lift);
    animation: pop-in 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes pop-in {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

/* Draw the checkmark stroke after the circle pops in */
.success-check {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: draw-check 0.45s ease-out 0.35s forwards;
}

@keyframes draw-check {
    to { stroke-dashoffset: 0; }
}

/* ---- Privacy policy / long-form article pages -------------------------- */
.hero--article {
    padding: 1.5rem 0 3rem;
}

/* Slightly smaller heading for article pages */
.hero-heading--small {
    font-size: clamp(2.5rem, 7vw, 4rem);
}

.policy {
    max-width: 38rem;
    margin: 1.5rem auto 0;
    text-align: left;
}

.policy h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--color-ink);
    margin: 2.25rem 0 0.6rem;
}

.policy h2:first-child {
    margin-top: 0;
}

.policy p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* ---- Contact page ---------------------------------------------------- */
.contact-email {
    color: var(--color-accent-deep);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 100% 1.5px;
    transition: background-size 0.25s ease;
    white-space: nowrap;
}

.contact-email:hover {
    background-size: 0% 1.5px;
}

/* ---- Footer ----------------------------------------------------------- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 2.25rem;
}

.footer-copy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
    opacity: 0.8;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s ease, transform 0.15s ease;
}

.footer-links a:hover {
    color: var(--color-ink);
}

/* Logo links (Instagram, TikTok) — the SVG inherits the link color */
.footer-icon {
    display: inline-flex;
    align-items: center;
}

.footer-icon:hover {
    transform: translateY(-2px);
}

.footer-icon svg {
    display: block;
}

/* ---- Small screens --------------------------------------------------- */
@media (max-width: 480px) {
    .site-header,
    .site-footer {
        padding: 1.25rem 1.25rem;
    }

    .site-footer {
        justify-content: center;
    }

    .footer-copy {
        width: 100%;
        text-align: center;
        order: 2;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
        gap: 1.25rem;
    }
}

/* ---- Reduced motion ---------------------------------------------------
   Respect users who turn off animations at the OS level. */
@media (prefers-reduced-motion: reduce) {
    .blob,
    .hero > *,
    .hero-bowl .steam path,
    .success-mark,
    .success-check {
        animation: none;
    }

    .success-check {
        stroke-dashoffset: 0;
    }

    .hero-bowl .steam path {
        opacity: 0.6;
    }
}
