/* =============================================================================
   SITE STYLESHEET
   =============================================================================
   
   HOW THIS FILE IS ORGANIZED:
   1.  CSS Variables (colors, sizes, fonts — edit these to restyle the whole site)
   2.  Reset & Base Styles
   3.  Splash Page
   4.  Main Layout (header, margins, content area)
   5.  Scroll Indicator Menu (the floating image that acts as a scrollbar)
   6.  Navigation Dropdown
   7.  Footer
   8.  Footer — Writing Link (tongue slide effect)
   9.  Footer — Instagram Link
   10. Footer — Contact Popup
   11. Tablet Styles (max-width: 1024px)
   12. Phone Styles (max-width: 600px)
   
   TO CHANGE COLORS: edit the variables in section 1.
   TO CHANGE FONTS: edit --font-body and --font-display in section 1.
   TO CHANGE SPACING: edit the spacing variables in section 1.
   ============================================================================= */


/* =============================================================================
   1. CSS VARIABLES — Edit these to restyle the whole site
   =============================================================================
   CSS variables start with -- and are used throughout the file with var(--name).
   Change a value here and it updates everywhere on the site automatically.
   ============================================================================= */

:root {

  /* --- COLORS ---
     Background and text are currently black and white.
     To add an accent color, define it here and use it below. */
  --color-bg:           #ffffff;   /* Main page background */
  --color-text:         #111111;   /* Main text color */
  --color-header-bg:    #ffffff;   /* Header/nav bar background (tablet + phone) */
  --color-rule:         #000000;   /* The horizontal break line on tablet/phone */
  --color-menu-bg:      #ffffff;   /* Dropdown menu background */
  --color-menu-border:  #000000;   /* Dropdown menu border color */
  --color-overlay:      rgba(0,0,0,0.55); /* Contact popup dark background overlay */
  --color-popup-bg:     #ffffff;   /* Contact popup box background */
  --color-btn-bg:       #111111;   /* Copy email button background */
  --color-btn-text:     #ffffff;   /* Copy email button text */

  /* --- TYPOGRAPHY ---
     Using system fonts by default so no external requests needed.
     To use a Google Font: add a <link> tag in each HTML file's <head>,
     then replace the font name below. Example: 'Playfair Display', serif */
  --font-body:          Georgia, 'Times New Roman', serif;
  --font-display:       Georgia, 'Times New Roman', serif;
  --font-ui:            Helvetica, Arial, sans-serif; /* Used for buttons, labels */

  /* --- SPACING ---
     These control margins and padding throughout the layout.
     --margin-side is the left/right margin on desktop (the blank space beside content). */
  --margin-side:        160px;   /* Left + right margin on desktop */
  --margin-side-tablet: 32px;   /* Left + right margin on tablet */
  --margin-side-phone:  18px;   /* Left + right margin on phone */
  --footer-padding:     32px;   /* Top + bottom padding inside footer */

  /* --- SCROLL INDICATOR (the floating menu image) ---
     These control the size and position of the floating menu image on desktop. */
  --indicator-size:     140px;   /* Width and height of the menu image */
  --indicator-right:    40px;   /* Distance from the right edge of the viewport */
  --indicator-top-min:  24px;   /* Closest it can get to the top of the viewport */
  --indicator-top-max:  24px;   /* Closest it can get to the bottom (measured from bottom) */

  /* --- NAVIGATION DROPDOWN ---
     Controls the look of the menu that appears when you click/hover the indicator. */
  --nav-item-padding:   14px 24px;  /* Padding inside each nav link */
  --nav-font-size:      1rem;       /* Font size of nav links */
  --nav-min-width:      180px;      /* Minimum width of the dropdown box */

  /* --- SMOOTH SCROLL ---
     Controls the scroll speed/feel on desktop.
     TO DISABLE smooth scrolling: comment out the line in section 2 below
     that says scroll-behavior: smooth; */

  /* --- TRANSITIONS ---
     Controls how fast animations happen. */
  --transition-speed:   0.3s;  /* General transition speed */
  --tongue-speed:       0.45s; /* How fast the tongue/slide image deploys */
  --menu-speed:         0.28s; /* How fast the nav dropdown opens */
}


/* =============================================================================
   2. RESET & BASE STYLES
   Removes browser default spacing and sets up the foundation.
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box; /* Makes width calculations predictable */
  margin: 0;
  padding: 0;
}

html {
  /* SMOOTH SCROLL: this is what makes the page glide instead of jump.
     To disable it, delete or comment out the line below. */
  scroll-behavior: smooth;

  /* Prevent horizontal scrollbar caused by overflow elements */
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

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


/* =============================================================================
   3. SPLASH PAGE (splash.html)
   Full-screen image or video. Click/tap anywhere to go to main page.
   The splash is a separate HTML file so it only shows on first visit to the site.
   ============================================================================= */

/* The splash page body — no scroll, no overflow */
body.splash-page {
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  /* Lock to portrait on mobile — handled by JS + CSS below */
}

/* The full-screen wrapper that captures clicks */
.splash-wrapper {
  position: fixed;
  inset: 0; /* shorthand for top:0; right:0; bottom:0; left:0 */
  cursor: pointer;
  z-index: 1;
}

/* The image version of the splash */
.splash-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* Fill the screen, crop edges before letterboxing */
  object-position: center; /* Default focal point — overridden per breakpoint in JS */
  z-index: 0;
}

/* The video version of the splash */
.splash-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;  /* Same fill behavior as the image */
  z-index: 0;
}

/* PORTRAIT LOCK MESSAGE
   Shows only on phones/tablets that are in landscape.
   The JS (splash.js) controls showing/hiding this. */
.rotate-message {
  display: none; /* Hidden by default — JS shows it when needed */
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 100;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 1rem;
  text-align: center;
  padding: 2rem;
}


/* =============================================================================
   4. MAIN LAYOUT
   The outer structure of every page except the splash.
   A content column centered in the viewport with equal side margins.
   ============================================================================= */

/* The main page wrapper — everything sits inside this */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The centered content column.
   padding-right reserves space so content doesn't slide under the scroll indicator. */
.content-column {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--margin-side);
  padding-right: var(--margin-side);
  overflow: hidden; /* clips anything that tries to exceed the column width */
  flex: 1;
}

/* Generic section spacing — wrap page sections in <section class="page-section"> */
.page-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

/* Placeholder content block — replace with real content */
.placeholder-block {
  background: #f5f5f5;
  border: 1px dashed #ccc;
  padding: 48px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 32px;
}


/* =============================================================================
   5. SCROLL INDICATOR MENU IMAGE
   The floating image in the right margin that acts as a custom scroll indicator.
   It moves vertically as you scroll — top of page = top of margin,
   bottom of page = bottom of margin.
   
   DESKTOP ONLY — on tablet/phone it becomes a fixed top-right image instead.
   ============================================================================= */

/* The indicator container — positioned by JavaScript (scroll-indicator.js) */
.scroll-indicator {
  position: fixed;
  right: var(--indicator-right);
  top: var(--indicator-top-min); /* Starting position — JS updates this on scroll */
  width: 140px;
  height: 108px;
  z-index: 500; /* Above page content, below popup */
  cursor: pointer;

  /* Movement is handled entirely by the JS lerp animation in scroll-indicator.js.
     To tune the lag/inertia feel, edit LERP_FACTOR in scroll-indicator.js.
     DO NOT add a CSS transition here — it will fight with the JS and cause jitter. */
  transition: none;
}

/* The actual image inside the indicator */
.scroll-indicator img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Shows the full image, no cropping */
  display: block;
  /* TO MAKE IT ROUND: add border-radius: 50%; */
  image-rendering: -webkit-optimize-contrast;
  -webkit-transform: translateZ(0);
  transform: translateZ(0); /* ADD THIS LINE */
}

/* Hover state — subtle feedback that it's clickable */
.scroll-indicator:hover img {
  opacity: 1;
  transition: opacity var(--transition-speed);
}


/* =============================================================================
   6. NAVIGATION DROPDOWN
   Appears when the scroll indicator is clicked or hovered.
   
   Drops DOWN when the indicator is in the top half of the viewport.
   Opens UP when the indicator is in the bottom half of the viewport.
   This is controlled by JavaScript adding .menu-up or .menu-down class.
   
   The top border of the dropdown matches the header color on tablet/phone.
   On desktop there is no visible header so it uses the menu background color.
   
   TO ADD A NEW NAV ITEM: go to each HTML file and add an <a> tag inside
   the <nav class="nav-dropdown"> element. The CSS handles the rest automatically.
   ============================================================================= */

/* The dropdown container */
.nav-dropdown {
  position: absolute;

  /* Positioned to the LEFT of the indicator image */
  right: 0;

  min-width: var(--nav-min-width);
  background: var(--color-menu-bg);

  /* Four-sided border on desktop — cleaner than three-sided at full width */
  border: none;
  right: 0;
  left:auto;

  /* Hidden by default */
  opacity: 0;
  pointer-events: none; /* Unclickable when hidden */
  transform: scaleY(0);
  transform-origin: top center; /* Collapse from top when dropping down */

  /* The deployment animation — feels like it's being unfolded */
  transition:
    opacity      var(--menu-speed) ease,
    transform    var(--menu-speed) cubic-bezier(0.4, 0, 0.2, 1);

  overflow: hidden;
}

/* MENU DROPS DOWN — indicator is in top half of screen */
.scroll-indicator.menu-down .nav-dropdown {
  top: calc(100% + 4px); /* Just below the indicator image */
  bottom: auto;
  transform-origin: top center;
  border-top: 2px solid var(--color-header-bg); /* Top border matches header color */
}

/* MENU OPENS UP — indicator is in bottom half of screen */
.scroll-indicator.menu-up .nav-dropdown {
  bottom: calc(100% + 4px); /* Just above the indicator image */
  top: auto;
  transform-origin: bottom center;
  border: none;
}

/* OPEN STATE — triggered by JS adding .nav-open class to .scroll-indicator */
.scroll-indicator.nav-open .nav-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: scaleY(1);
}

/* Individual nav links
   TO ADD A LINK: <a href="page.html" class="nav-item">Label</a> */
.nav-item {
  display: block;
  padding: var(--nav-item-padding);
  font-family: var(--font-ui);
  font-size: var(--nav-font-size);
  color: var(--color-text);
  text-align: right;
  border-bottom:none; /* Subtle separator between items */
  transition: background var(--transition-speed);
  white-space: nowrap; /* Prevent nav items from wrapping */
}

.nav-item:last-child {
  border-bottom: none; /* Remove separator from last item */
}

.nav-item:hover {
  background: transparent;
  text-decoration: underline;
}


/* =============================================================================
   7. FOOTER
   Three zones: left (writing link), center (empty), right (instagram + contact).
   Uses the side margins as spacing guides — footer padding matches --margin-side.
   
   The footer is shared across all pages.
   ============================================================================= */

.site-footer {
  width: 100%;
  padding-top: var(--footer-padding);
  padding-bottom: var(--footer-padding);
  padding-left: var(--margin-side);
  padding-right: var(--margin-side);
 border-top: none;  /* change from: border-top: 1px solid var(--color-rule); */

  /* Three-column layout: left | center | right */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left zone — writing subdomain link with tongue effect */
.footer-left {
  display: flex;
  align-items: center;
}

/* Right zone — instagram and contact, right-aligned */
.footer-right {
  display: flex;
  align-items: center;
  gap: 24px; /* Space between instagram and contact */
  justify-content: flex-end;
}

/* Center zone — currently empty, reserved for future use */
.footer-center {
  flex: 1; /* Takes up available space between left and right */
}


/* =============================================================================
   8. FOOTER — WRITING LINK (tongue slide effect)
   
   HOW IT WORKS:
   - A container clips overflow so the tongue image is hidden below
   - On hover (desktop) or long-press (mobile), the tongue slides down into view
   - Once deployed, it stays visible until page reload (JS handles this)
   - The tongue eventually will look like it's sliding out of a mouth
   
   TO CHANGE THE TRIGGER IMAGE: replace placeholder-mouth.png
   TO CHANGE THE TONGUE IMAGE: replace placeholder-tongue.png
   TO CHANGE SLIDE DIRECTION: currently slides DOWN. The CSS uses translateY.
   ============================================================================= */

/* Outer wrapper — the clipping boundary */
.writing-link {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  /* Clip the tongue so it's invisible until deployed */
  overflow: visible; /* We use JS to clip instead so hover area stays large */
}

/* The main "mouth" image — always visible */
.writing-link-main {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 2; /* Sits above the tongue */
  image-rendering: -webkit-optimize-contrast;
  -webkit-transform: translateZ(0);
  transform: translateZ(0); /* ADD THIS LINE */
}

/* The "tongue" image — starts hidden behind the mouth image */
.writing-link-tongue {
  width: 7px; /* Narrower than the mouth — adjust to match your artwork */
  /* Height will be auto based on image aspect ratio */
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  -webkit-transform: translateZ(0);
  transform: translateZ(0); /* ADD THIS LINE */

  position: absolute;
  top: 58%; /* Start position — partially behind the mouth image */
  left: 9.5%;
  transform: translateX(-50%) translateY(-100%); /* Hidden above clip boundary */
  z-index: 1; /* Behind the mouth image */

  /* The slide animation */
  transition: transform var(--tongue-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
  /* cubic-bezier gives a slight bounce at the end — remove and use ease-out for no bounce */
}
.writing-link.tongue-deployed .writing-link-main {
  pointer-events: none;
}

/* DEPLOYED STATE — JS adds .tongue-deployed to .writing-link */
.writing-link.tongue-deployed .writing-link-tongue {
  transform: translateX(-50%) translateY(-40%); /* Slides into view below the mouth */
}

/* The actual link — wraps the whole writing-link element */
.writing-link-anchor {
  display: block;
  color: inherit;
  text-decoration: none;
}


/* =============================================================================
   9. FOOTER — INSTAGRAM LINK
   A placeholder image that links to your Instagram profile.
   TO UPDATE: replace href in HTML with your Instagram URL.
   TO CHANGE IMAGE: replace placeholder-instagram.png
   ============================================================================= */

.instagram-link {
  display: block;
  width: 36px;
  height: 36px;
  transition: opacity var(--transition-speed);
}

.instagram-link:hover {
  opacity: 0.7;
}

.instagram-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* =============================================================================
   10. FOOTER — CONTACT BUTTON + POPUP
   
   HOW IT WORKS:
   - A small contact image/icon in the footer right zone
   - Clicking it opens a popup overlay
   - The popup shows your email address
   - A button copies the email to clipboard
   - Clicking outside the popup or the X closes it
   
   TO CHANGE YOUR EMAIL: update the email in index.html inside .contact-email
   ============================================================================= */

/* The contact trigger — image or text in the footer */
.contact-trigger {
  display: block;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: opacity var(--transition-speed);
}

.contact-trigger:hover {
  opacity: 0.7;
}

.contact-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The dark overlay behind the popup */
.contact-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed);
}

/* Open state — JS adds .contact-open to .contact-overlay */
.contact-overlay.contact-open {
  opacity: 1;
  pointer-events: all;
}

/* The popup box */
.contact-popup {
  background: var(--color-popup-bg);
  padding: 40px 48px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  position: relative;

  /* Subtle entrance animation */
  transform: translateY(12px);
  transition: transform var(--transition-speed);
}

.contact-overlay.contact-open .contact-popup {
  transform: translateY(0);
}

/* Close button (the X in the corner) */
.contact-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.4rem;
  cursor: pointer;
  font-family: var(--font-ui);
  color: #888;
  background: none;
  border: none;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition-speed);
}

.contact-close:hover {
  color: var(--color-text);
}

/* The email address displayed in the popup */
.contact-email {
  font-family: var(--font-ui);
  font-size: 1rem;
  margin-bottom: 24px;
  word-break: break-all; /* Prevents long emails from overflowing */
}

/* The "Copy Email" button */
.copy-email-btn {
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  padding: 10px 24px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity var(--transition-speed);
}

.copy-email-btn:hover {
  opacity: 0.75;
}

/* Confirmation message shown after copy */
.copy-confirm {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #555;
  margin-top: 10px;
  height: 1em; /* Reserve space so layout doesn't jump */
  transition: opacity var(--transition-speed);
}


/* =============================================================================
   11. TABLET STYLES — screens up to 1024px wide
   
   WHAT CHANGES ON TABLET:
   - Side margins narrow
   - The scroll indicator becomes a fixed image in the top-right corner
   - The scroll indicator does NOT move down the page — it stays put
   - The nav menu always drops DOWN on tablet
   - A horizontal rule appears between the header area and content
   - The scroll indicator shrinks slightly
   ============================================================================= */

@media (max-width: 1024px) {

  /* Narrower side margins */
  :root {
    --margin-side: var(--margin-side-tablet);
    --indicator-size: 44px; /* Slightly smaller indicator */
  }

  /* On tablet/phone the scroll indicator is fixed at the top right — does not scroll */
  .scroll-indicator {
    position: fixed;
    top: 16px !important; /* Override JS positioning — always at top */
    right: 16px;
    width: 64px;  /* Smaller on tablet — same ratio as desktop (140x108) */
    height: 50px;
    transition: none;
  }

  /* The header rule line — white above, black line, white below */
  .header-rule {
    display: block; /* Hidden on desktop, shown here */
    width: 100%;
    height: 1px;
    background: var(--color-rule);
    margin-top: 72px; /* Push down below the fixed indicator */
    margin-bottom: 0;
  }

  /* Content column uses tablet margins — equal padding both sides */
  .content-column {
    padding-left: var(--margin-side-tablet);
    padding-right: var(--margin-side-tablet);
    padding-top: 24px; /* Space below the rule line */
  }

  /* Footer uses tablet margins */
  .site-footer {
    padding-left: var(--margin-side-tablet);
    padding-right: var(--margin-side-tablet);
  }

  /* Nav always drops down on tablet */
  .scroll-indicator.menu-up .nav-dropdown {
    bottom: auto;
    top: calc(100% + 4px);
    transform-origin: top center;
    border-top: 2px solid var(--color-header-bg);
    border-bottom: 1px solid var(--color-menu-border);
  }
}


/* =============================================================================
   12. PHONE STYLES — screens up to 600px wide
   
   WHAT CHANGES ON PHONE:
   - Margins narrow further
   - Text fills the screen with minimal side margins
   - Footer stacks if needed
   ============================================================================= */

@media (max-width: 600px) {

  :root {
    --footer-padding: 24px;
  }

  /* Phone indicator — smaller but same ratio */
  .scroll-indicator {
    width: 48px;
    height: 37px;
  }

  /* Phone margins */
  .content-column {
    padding-left: var(--margin-side-phone);
    padding-right: var(--margin-side-phone);
  }

  .site-footer {
    padding-left: var(--margin-side-phone);
    padding-right: var(--margin-side-phone);
  }

  /* Stack footer on very narrow screens if needed */
  /* Uncomment the block below if your footer items overlap on small phones:
  .site-footer {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  .footer-right {
    width: 100%;
    justify-content: flex-start;
  }
  */

  /* Contact popup takes more of the screen on small phones */
  .contact-popup {
    padding: 32px 24px;
  }
}
