/* -------------- general css - for all pages -------------- */
/* styled after dev.ashars.co.uk, in a light theme */

/*
COLOURS
--------
--bg      page background
--fg      main text
--muted   labels, notes and quieter text
--rule    faint decorative dividers
--line    lines people need to see: inputs and progress tracks (3:1 on --bg)
--soft    slightly lighter panels (upload box hover, thumbnails)
--accent  buttons and highlights
--danger  errors
--------
*/

:root{
    color-scheme: light;
    --bg: #f8f5ef;
    --fg: #1d1b17;
    --muted: #6b665b;
    --rule: #e3ded3;
    --line: #8f897c;
    --soft: #efeae1;
    --accent: #1d1b17;
    --danger: #a8402c;
    --nav-h: 4.25rem;
    --serif: "Times New Roman", Times, Georgia, serif;
    --pad: clamp(1.25rem, 5vw, 4rem);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

body{
    background: var(--bg);
    color: var(--fg);
    font-family: var(--serif);
    font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
    line-height: 1.6;
    text-align: center;
    -webkit-font-smoothing: antialiased;
}

/* private pages stay hidden until general.js has checked the passkey, so nothing flashes */
body[data-private]:not(.ready) main{
    visibility: hidden;
}

a{
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}

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

h1, h2, h3{
    font-weight: 400;
    letter-spacing: -.01em;
}

h2{
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
}

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

.muted{
    color: var(--muted);
}



/* -------------- layout -------------- */

.page{
    min-height: calc(100svh - 2.5rem);
    max-width: 62rem;
    margin-inline: auto;
    padding: clamp(2rem, 6vh, 4rem) var(--pad) 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page.center{
    justify-content: center;
}

/* a view is one screen of a page - only one is shown at a time */
.view{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.intro{
    max-width: 30rem;
    margin-top: 2.5rem;
    color: var(--muted);
}

.footer-note{
    margin-top: 3rem;
    font-size: .85rem;
}

/* the thin bar at the very bottom: version on the left, credit on the right */
.footer-bar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    height: 2.5rem;
    padding: 0 var(--pad);
    border-top: 1px solid var(--rule);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

.footer-bar a{
    border: 0;
    transition: color .3s var(--ease);
}

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

.version{
    letter-spacing: .15em;
    text-transform: none;
    opacity: .8;
}



/* -------------- logo and date -------------- */

.logo{
    display: block;
    width: clamp(11rem, 8rem + 18vw, 17rem);
    height: auto;
    /* the logo file is black on transparent - used as it is on the light theme */
}

.logo.small{
    width: 5rem;
}

.logo-link{
    display: inline-block;
    border: 0;
    margin-bottom: clamp(1rem, 4vh, 2.5rem);
}

.tagline{
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: .85rem;
    letter-spacing: .4em;
    color: var(--muted);
}

.tagline::before,
.tagline::after{
    content: "";
    width: 2.5rem;
    height: 1px;
    background: var(--rule);
}

.date-label{
    margin-top: .6rem;
    font-size: .7rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: .8;
}



/* "Hello, Sarah." under the date, and the small "Not Sarah?" link */
.greeting{
    margin-top: 1.75rem;
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

.not-you{
    margin-top: .35rem;
    font-size: .65rem;
}

/* the home page boxes: upload first, then the three days - side by side, full width */
.page.home{
    max-width: none;
}

.tiles{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(.75rem, 1.5vw, 1.25rem);
    width: 100%;
    margin-top: clamp(2rem, 6vh, 3.5rem);
}

.tile{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    min-height: clamp(8rem, 18vh, 11rem);
    padding: 1.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}

.tile:hover{
    transform: translateY(-3px);
    background: var(--soft);
    border-color: var(--accent);
}

.tile-title{
    font-size: clamp(1.05rem, .9rem + .6vw, 1.4rem);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.tile-caption{
    font-size: .75rem;
    letter-spacing: .25em;
    color: var(--muted);
}

/* the upload box stands out */
.tile-main{
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.tile-main .tile-caption{
    color: var(--bg);
    opacity: .75;
}

.tile-main:hover{
    background: var(--accent);
    opacity: .9;
}

/* two by two on small tablets */
@media (max-width: 760px){
    .tiles{
        grid-template-columns: repeat(2, 1fr);
    }
}

/* a vertical list on phones - name on the left, date on the right */
@media (max-width: 640px){
    .tiles{
        grid-template-columns: 1fr;
        gap: .6rem;
    }

    .tile{
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        min-height: 0;
        padding: 1.15rem 1.25rem;
        border-radius: 14px;
        text-align: left;
    }

    .tile-title{
        font-size: 1rem;
    }

    .tile-caption{
        font-size: .68rem;
        white-space: nowrap;
    }
}



/* -------------- buttons -------------- */

.btn{
    display: inline-block;
    font-size: .95rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .75rem 2rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    cursor: pointer;
    transition: transform .3s var(--ease), opacity .3s var(--ease);
}

.btn.ghost{
    background: transparent;
    color: var(--fg);
}

.btn.small{
    font-size: .75rem;
    padding: .45rem 1.2rem;
}

.btn:hover{
    transform: translateY(-2px);
    opacity: .85;
}

.btn:active{
    transform: translateY(0);
}

.btn:disabled{
    opacity: .4;
    cursor: default;
    transform: none;
}

.actions{
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

/* a button that looks like a small underlined link */
.textlink{
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0;
    cursor: pointer;
}

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

.eyebrow{
    font-size: .75rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--muted);
}



/* -------------- forms -------------- */

.form{
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 26rem;
    margin-top: 2rem;
}

.form label{
    display: grid;
    gap: .4rem;
}

.form label span{
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.form .btn{
    justify-self: center;
}

input{
    color: var(--fg);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: .6rem 0;
    text-align: center;
}

input:focus{
    outline: 0;
    border-color: var(--accent);
}

input::placeholder{
    color: var(--muted);
    opacity: .8;
}

/* stops safari and chrome painting autofilled boxes pale yellow or blue */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
    -webkit-text-fill-color: var(--fg);
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    caret-color: var(--fg);
    transition: background-color 9999s;
}

.reveal-toggle{
    justify-self: center;
    margin-top: -.75rem;
    font-size: .7rem;
}

.error{
    color: var(--danger);
    font-size: .95rem;
}

/* hidden box only bots fill in */
.hp{
    position: absolute;
    left: -9999px;
}



/* -------------- nav bar -------------- */
/* DIOGO on the left, KHADIJA on the right, the links in between.
   on phones the names stay at the top and the links become a bar along the bottom */

.nav{
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem var(--pad);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
}

.nav-name{
    justify-self: start;
    font-size: .85rem;
    letter-spacing: .35em;
    text-transform: uppercase;
}

.nav-name:last-child{
    justify-self: end;
    /* letter-spacing adds space after the last letter - this lines it up with the edge */
    margin-right: -.35em;
}

.nav-links{
    display: flex;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.nav-links a{
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid transparent;
    padding-bottom: .15rem;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"]{
    color: var(--fg);
    border-color: var(--accent);
}

.nav svg{
    display: none;
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 640px){
    body:has(.nav){
        padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    }

    /* the top bar keeps just the names. no blur here - it would trap the bottom bar inside it */
    .nav{
        grid-template-columns: 1fr 1fr;
        padding: .85rem var(--pad);
        padding-top: max(.85rem, env(safe-area-inset-top));
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-name{
        font-size: .75rem;
    }

    .nav-links{
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        gap: 0;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg);
        border-top: 1px solid var(--rule);
    }

    .nav-links a{
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: .3rem;
        height: var(--nav-h);
        padding: 0;
        font-size: .62rem;
        letter-spacing: .15em;
        border: 0;
    }

    .nav svg{
        display: block;
    }

    .page{
        min-height: calc(100svh - 2.5rem - var(--nav-h) - 3rem);
    }
}



/* -------------- motion -------------- */

.rise{
    animation: rise .9s var(--ease) both;
}

.rise.d1{ animation-delay: .15s; }
.rise.d2{ animation-delay: .3s; }
.rise.d3{ animation-delay: .45s; }

@keyframes rise{
    from{ opacity: 0; transform: translateY(1.5rem); }
}

@media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
        animation: none !important;
        transition: none !important;
    }
}
