/* ==========================================================================
   nosyt.css : site foundation
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   Change a value here and it updates everywhere it is used.
   -------------------------------------------------------------------------- */
:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #6b6b6b;
    --color-border: #e5e5e5;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --content-max: 1200px;   /* widest the main content is allowed to get */
    --gutter: 24px;          /* left/right breathing room */
    --gap: 24px;             /* space between grid items */
    --space-section: 60px;   /* space below the main content */

    --logo-width: 80px;
    --showcase-ratio: 4 / 3; /* shape of the featured image */
    --ticker-height: 44px;
    --ticker-speed: 9s; /* lower = faster scroll */
    --ticker-color: #000000;
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.5;
}

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

a {
    color: inherit;
}

a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   3. Page layout
   The wrapper is a full-height column: header on top, main stretches to fill
   the middle, footer sits at the bottom even on short pages.
   -------------------------------------------------------------------------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding-bottom: var(--ticker-height);  /* reserve space for the fixed ticker */
}

/* --------------------------------------------------------------------------
   4. Header and logo
   -------------------------------------------------------------------------- */
.logo-container {
    width: 100%;
    padding: 40px var(--gutter);
    text-align: center;
}

.logo-link {
    display: inline-block;
}

.main-logo {
    display: block;
    width: var(--logo-width);
    height: auto;
}

/* --------------------------------------------------------------------------
   5. Main content
   -------------------------------------------------------------------------- */
.content-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: var(--content-max);
    padding: 0 var(--gutter) var(--space-section);
}

/* One large, centered showcase image. */
.image-showcase-grid {
    display: flex;
    justify-content: center;
    width: 100%;
}

.showcase-frame {
    display: inline-block;   /* hugs the image's own size, no extra hit area */
    max-width: 533px;        /* 1/3 bigger than the original 400px */
}

/* Sized to the image's own (now-trimmed) proportions - no cropping. */
.showcase-image {
    display: block;
    width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    width: 100%;
    padding: 24px var(--gutter);
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   7. Mobile: tighten the spacing and shrink the featured image
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --gutter: 16px;
        --space-section: 40px;
    }

    .showcase-frame {
        max-width: min(453px, 100%);   /* 1/3 bigger than the original 340px */
    }

    .product-stack {
        flex-wrap: wrap;
        row-gap: calc(var(--gap) * 2);
    }
}


/* --------------------------------------------------------------------------
   8. Bottom ticker: sliding Instagram + email strip
   -------------------------------------------------------------------------- */
.ticker-bar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--ticker-height);
    background-color: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;   /* info sits still, centered at the bottom */
    z-index: 10;
    pointer-events: none;   /* clicks pass through the empty strip... */
}

.ticker-track {
    width: 100%;
}

/* three columns: handle | dot | email. The dot sits in the exact center of the
   screen, lined up under "nosyt", with each contact hugging it on its own side. */
.ticker-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    white-space: nowrap;
}

.ticker-content a {
    pointer-events: auto;   /* only the text itself is clickable */
}

.ticker-content a:first-child {
    justify-self: end;
}

.ticker-content a:last-child {
    justify-self: start;
}

.ticker-content a {
    color: var(--ticker-color);
    text-decoration: none;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.ticker-content a:hover {
    text-decoration: underline;
}

.ticker-dot {
    color: var(--ticker-color);
    opacity: 0.6;
    margin: 0 16px;
}

@keyframes ticker-scroll {
    from {
        /* fully off-screen to the right */
        transform: translateX(100vw);
    }
    to {
        /* fully off-screen to the left (100% = its own width) - the restart
           snap is invisible because both ends are off the visible screen */
        transform: translateX(-100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   9. Book spread: two pages side by side, at 1/3 size with real margin
      between them (in place of the earlier edge-to-edge spine look)
   -------------------------------------------------------------------------- */
.book-spread {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: calc(var(--gap) * 4);   /* the "good margin" between the two pages */
    width: 100%;
}

.book-page {
    flex: 0 1 300px;   /* roughly 1/3 of the old 1000px spread, per page */
    max-width: 300px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.book-page-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 640px) {
    .book-page {
        flex-basis: 240px;
        max-width: 240px;
    }
}

/* --------------------------------------------------------------------------
   10. Product stack: images stacked vertically, centered
   -------------------------------------------------------------------------- */
.product-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;   /* equal gap: edge-to-image, image-to-image, image-to-edge */
    width: 100%;
    padding: calc(var(--space-section) * 2) 0 var(--space-section);   /* extra room above the top */
}

.showcase-frame--small {
    max-width: 267px;   /* 2/3 of the standard 400px frame, on laptop/desktop */
}

@media (max-width: 768px) {
    .showcase-frame--small {
        max-width: 100%;   /* let it scale to fit a phone screen instead of staying fixed */
    }
}

/* --------------------------------------------------------------------------
   11. Back-to-home icon, top-left corner
   -------------------------------------------------------------------------- */
.back-icon {
    position: fixed;
    top: 48px;
    left: 48px;
    z-index: 20;
    display: inline-block;
}

.back-icon-image {
    display: block;
    width: 80px;   /* laptop/desktop size */
    height: auto;
}

/* the circle logo used on the products page. The image is trimmed tight to the
   logo itself, so the gap from the top and from the left edge is exactly equal. */
.back-icon-image.back-icon-image--logo {
    width: 80px;
}

@media (max-width: 768px) {
    .back-icon {
        top: 20px;
        left: 20px;
    }

    .back-icon-image {
        width: 44px;   /* smaller on phones so it doesn't dominate the screen */
    }

    .back-icon-image.back-icon-image--logo {
        width: 44px;
    }
}

/* --------------------------------------------------------------------------
   12. Page detail: a top PNG with the photo spread stacked underneath
   -------------------------------------------------------------------------- */
.page-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--space-section) * 1.5);
    width: 100%;
    padding: calc(var(--space-section) * 2) 0 var(--space-section);
}

/* --------------------------------------------------------------------------
   13. Glow-on-hover effect
   -------------------------------------------------------------------------- */
.glow-on-hover {
    transition: filter 0.3s ease, transform 0.3s ease;
}

.glow-on-hover:hover {
    filter: drop-shadow(0 0 20px rgba(142, 73, 25, 0.85))
            drop-shadow(0 0 40px rgba(142, 73, 25, 0.5));
    transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   14. Homepage layout: welcome image on top, cam thumbnail below-right
   -------------------------------------------------------------------------- */
.homepage-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: calc(var(--gap) * 2);
}

.cam-row {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding-right: var(--gutter);
}

.cam-toggle {
    position: relative;
    display: inline-block;
    width: 180px;
}

.cam-image {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.4s ease;
}

.cam-image--back {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.cam-toggle:hover .cam-image--front {
    opacity: 0;
}

.cam-toggle:hover .cam-image--back {
    opacity: 1;
}

@media (max-width: 768px) {
    .cam-toggle {
        width: 120px;
    }
}

/* --------------------------------------------------------------------------
   15. Video page
   -------------------------------------------------------------------------- */
.video-frame {
    width: 100%;
    max-width: 800px;
}

.video-player {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}


/* ==========================================================================
   Archive opening page
   Smaller photo centered on the page. Hover fades it to black and
   reveals the "archive" label.
   ========================================================================== */
:root {
    --font-archive: "Heiti SC", "Heiti TC", "STHeiti", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --archive-dim: 0.5;            /* photo brightness on hover: 0 = pure black, 1 = no dimming */
    --archive-photo-width: 54vw;   /* photo size on desktop; make smaller/larger here */
}

.archive-home .archive-stage {
    position: fixed;
    inset: 0;   /* photo centers on the full screen */
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-hero {
    position: relative;
    display: block;
    width: var(--archive-photo-width);
    max-width: 1080px;
    background: #000;
    line-height: 0;
    cursor: pointer;
}

.archive-hero-image {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.6s ease;
}

.archive-hero:hover .archive-hero-image,
.archive-hero:focus-visible .archive-hero-image {
    filter: brightness(var(--archive-dim));
}

.archive-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28%;                     /* logo size relative to the photo */
    height: auto;
    filter: invert(1);              /* logo file is black; this shows it white against the dark photo */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.archive-hero:hover .archive-logo,
.archive-hero:focus-visible .archive-logo {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Menu: a "menu" button at the top that drops a panel of links below it
   Opens on hover (desktop) and on tap/click (phones).
   -------------------------------------------------------------------------- */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 15;
    padding-left: calc(var(--gutter) + 5vw);   /* nudged 5% of the screen toward the center */
    font-family: var(--font-archive);
    text-transform: lowercase;
    text-align: left;
}

.menu-button {
    appearance: none;
    background: none;
    border: 0;
    margin: 0;
    padding: 28px 0 12px;
    font: inherit;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--color-text);
    cursor: pointer;
}

/* links hang straight down from the word "menu", no box around them */
.menu-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0 12px;
    visibility: hidden;
}

.menu-panel a {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-decoration: none;
    color: var(--color-text);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu.is-open .menu-panel,
.menu:focus-within .menu-panel {
    visibility: visible;
}

.menu.is-open .menu-panel a,
.menu:focus-within .menu-panel a {
    opacity: 1;
    transform: translateY(0);
}

/* each link drops a beat after the one above it */
.menu-panel a:nth-child(2) { transition-delay: 0.05s; }
.menu-panel a:nth-child(3) { transition-delay: 0.10s; }
.menu-panel a:nth-child(4) { transition-delay: 0.15s; }

@media (hover: hover) {
    .menu:hover .menu-panel {
        visibility: visible;
    }
    .menu:hover .menu-panel a {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-panel a:hover {
    opacity: 0.55 !important;
}

/* --------------------------------------------------------------------------
   Top bar text: "nosyt" in the middle, coordinates (Salt Lake City) at right
   -------------------------------------------------------------------------- */
.top-title,
.top-coords {
    position: fixed;
    top: 0;
    padding-top: 28px;
    z-index: 15;
    font-family: var(--font-archive);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--color-text);
    pointer-events: none;
}

.top-title {
    left: 50%;
    transform: translateX(-50%);
}

.top-coords {
    right: calc(var(--gutter) + 5vw);   /* nudged 5% of the screen toward the center */
}

@media (max-width: 640px) {
    .top-coords {
        font-size: 0.7rem;
        letter-spacing: 0.05em;
        padding-top: 31px;
    }
}

@media (max-width: 640px) {
    .ticker-content a { font-size: 0.75rem; }
    .ticker-dot { margin: 0 8px; }
}

/* --------------------------------------------------------------------------
   Full-screen variant of the opening page (preview)
   Photo covers the whole screen, all top text is white.
   To go back to the framed photo, remove "archive-home--full" from the
   <body> tag in index.html.
   -------------------------------------------------------------------------- */
.archive-home--full {
    background: #000;
}

.archive-home--full .archive-hero {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
}

.archive-home--full .archive-hero-image {
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.archive-home--full .archive-logo {
    width: 15vw;
}

.archive-home--full .menu-button,
.archive-home--full .menu-panel a,
.archive-home--full .top-title,
.archive-home--full .top-coords {
    color: #ffffff;
}
