/* ============================================
   MYRTLE CROSS — shared stylesheet
   All pages link to this one file.
   Change something here, it changes everywhere.
   ============================================ */

/* --- COLOUR PALETTE ---
   Tweak these variables to retheme the whole site at once.
   --bg-fallback : shown before hills image loads, or if missing
   --text        : main body text
   --accent      : links, highlights
   --muted       : secondary text, dates, labels
   --overlay     : dark layer over hills image (controls readability)
*/
:root {
  --bg-fallback: #2a2e1e;       /* dark olive green — feels like the hills at dusk */
  --text: #2b1d0e;              /* dark dark brown — reads well against the hills */
  --accent: #5c3d1e;            /* deeper brown for links */
  --muted: #6b5040;             /* mid-brown for secondary text */
  --overlay: rgba(200, 195, 185, 0.25);   /* light warm grey, subtle */
  --max-width: 680px;           /* how wide content gets before it stops expanding */
  --font: 'Space Mono', monospace;
}

/* --- CUSTOM CURSOR ---
   A '+' crosshair cursor that follows the mouse.
   The JavaScript to move it lives in each HTML page (just 4 lines).
   mix-blend-mode: difference means it inverts against whatever's behind it — stays visible on hills or text. */
*, *::before, *::after {
  cursor: url('images/chisel-cursor.png') 0 13, auto !important;
}

#cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--text);
  mix-blend-mode: difference;
  user-select: none;
  transition: transform 0.05s ease;
}

/* --- RESET ---
   Strips browser default weirdness. Very standard, don't worry about it. */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- BODY / BACKGROUND ---
   The hills image sits here, fixed, covering the whole page.
   Drop your image into images/hills.jpg and it will appear. */
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-fallback);   /* fallback until image loads */
  background-image:
    linear-gradient(var(--overlay), var(--overlay)),  /* dark overlay */
    url('images/hills.jpg');              /* your hills */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;           /* hills don't scroll — they stay put */
  min-height: 100vh;
  line-height: 1.7;
}

/* --- MAIN CONTENT WRAPPER ---
   Centres content and stops it getting too wide on big screens. */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;  /* top / sides / bottom */
}

/* --- TYPOGRAPHY --- */
h1 {
  font-size: 1.4rem;
  font-weight: normal;          /* monospace fonts look better not bold */
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: 0.3rem;
}

h2 {
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
  margin-bottom: 2rem;
}

h3 {
  font-size: 0.9rem;
  font-weight: normal;
  text-transform: lowercase;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.2rem;
  font-size: 0.92rem;
}

/* --- LINKS ---
   All links across the site share this look.
   Underline is kept — it's semantic and retro. */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
}

/* --- HORIZONTAL RULE ---
   A subtle divider. Use <hr> to separate sections. */
hr {
  border: none;
  border-top: 1px solid var(--muted);
  opacity: 0.4;
  margin: 2.5rem 0;
}

/* --- SITE HEADER ---
   The small persistent label at the top of every page. */
.site-header {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin-bottom: 3rem;
}

.site-header a {
  color: var(--muted);
  text-decoration: none;
}

.site-header a:hover {
  color: var(--accent);
}

/* --- NAV BREADCRUMB ---
   e.g.  myrtle cross / writing
   Simple text trail back to index. */
.breadcrumb {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 3rem;
  letter-spacing: 0.06em;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

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

/* --- INDEX NAV (landing page links) ---
   The big navigation list on index.html */
.index-nav {
  list-style: none;
  margin-top: 3rem;
}

.index-nav li {
  margin-bottom: 1rem;
}

.index-nav a {
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.index-nav a::before {
  content: '→ ';
  color: var(--muted);
}

.index-nav a:hover::before {
  color: var(--accent);
}



.tape {
  background-color: rgba(245, 240, 224, 0.75);
  padding: 0.1em 0.5em;
}

.writing-list .title a,
.writing-list .meta,
.breadcrumb {
  background-color: rgba(245, 240, 224, 0.75);
  padding: 0.1em 0.4em;
  display: inline-block;
}

/* --- WRITING LIST ---
   Used on writing.html — list of links with date/venue */
.writing-list {
  list-style: none;
}

.writing-list li {
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(138, 138, 122, 0.2);
}

.writing-list li:last-child {
  border-bottom: none;
}

.writing-list .title a {
  font-size: 0.95rem;
  text-decoration: underline;
}

.writing-list .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* --- GALLERY WALL ---
   Used on art.html — images in a loose grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item a {
  text-decoration: none;
  display: block;
}

.gallery-item img {
  width: 100%;
  display: block;
  filter: brightness(0.9);   /* very slightly toned — looks more considered than full brightness */
  transition: filter 0.2s;
}

.gallery-item img:hover {
  filter: brightness(1);
}

.gallery-item .caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-transform: lowercase;
}

/* --- BLOG POSTS ---
   Used on forging-fragments/blog.html */
.post {
  margin-bottom: 4rem;
}

.post-date {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.post-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.post img {
  max-width: 100%;
  margin: 1rem 0;
  display: block;
}

/* --- FOOTER --- */
footer {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(138, 138, 122, 0.25);
}

footer a {
  color: var(--muted);
}


/* ============================================
   INDEX PAGE STYLES
   Everything below only affects index.html.
   ============================================ */

body.index-page {
  overflow-x: hidden;
}

/* Freeform canvas — the full-page scatter field */
.canvas {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 2rem;
}

/* TITLE — straight (no rotation), top left */
.site-title {
  position: absolute;
  top: 4vh;
  left: 7vw;
  font-size: clamp(1rem, 2vw, 1.8rem);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--text);
}

/* Tagline sits below the title */
.tagline {
  display: block;
  font-size: 0.6em;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  font-style: italic;
}

/* NAV LINKS — scattered with tape-strip white backgrounds */
.nav-link {
  z-index: 5;    /* add this — links always above photos */
  position: absolute;
  font-family: var(--font);
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  text-decoration: none;
  color: #111;                        /* dark text on the white tape */
  letter-spacing: 0.05em;
  text-transform: lowercase;
  white-space: nowrap;
  background-color: #f5f0e0;          /* masking tape off-white */
  padding: 0.1em 0.5em;
  transition: background-color 0.15s;
}

.nav-link:hover {
  background-color: #fff;
}

.nav-link::before {
  content: '-> ';
  color: var(--muted);
}

/* Individual link positions.
   Change top/left to move a link. Change rotate() to tilt it. */
.link-art         { top: 300px; left: 55vw;  transform: rotate(1deg);    }
.link-writing     { top: 420px; left: 10vw;  transform: rotate(-2.5deg); }
.link-coding      { top: 560px; left: 58vw;  transform: rotate(0.8deg);  }
.link-other       { top: 500px; left: 15vw;  transform: rotate(6deg);   }
.link-instagram   { top: 480px; left: 76vw;  transform: rotate(2deg);    }
.link-shop        { top: 120px; left: 80vw;  transform: rotate(-1.5deg); }
.link-ff          { top: 370px; left: 30vw;  transform: rotate(1.5deg);  }
.link-substack    { top: 450px; left: 60vw;  transform: rotate(-1deg);   }
.link-about       { top: 140px; left: 35vw;  transform: rotate(-5deg);    }

/* DRAGGABLE PHOTOS
   Starting positions — change top/left to move where each photo starts.
   Width controls size. Rotation gives the scattered feel. */
.photo {
  position: absolute;
  z-index: 2;    /* already set — photos sit here */
  box-shadow: 2px 3px 10px rgba(0,0,0,0.25);
  user-select: none;
  z-index: 2;
  /* cursor handled globally — shows grab when over a photo */
}

.photo:active {
  box-shadow: 4px 6px 16px rgba(0,0,0,0.35);
}

.photo-01 {
  width: 200px;
  top: 200px;
  left: 42vw;
  transform: rotate(-2deg);
}

.photo-02 {
  width: 170px;
  top: 440px;
  left: 38vw;
  transform: rotate(4deg);
}

.photo-03 {
  width: 190px;
  top: 320px;
  left: 72vw;
  transform: rotate(-1.5deg);
}

.photo-04 {
  width: 180px;
  top: 150px;
  left: 60vw;
  transform: rotate(2deg);
}

.photo-05 {
  width: 250px;
  top: 130px;
  left: 10vw;
  transform: rotate(-5deg);
}

.photo-06 {
  width: 100px;
  top: 140px;
  left: 85vw;
  transform: rotate(-2deg);
}

/* Updated stamp — fixed bottom left */
.updated {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font);
}

/* Mobile fallback — everything stacks on small screens */
@media (max-width: 480px) {
  .site-title,
  .nav-link,
  .photo {
    position: static;
    transform: none;
    display: block;
  }

  .site-title {
    padding-top: 3rem;
    margin-bottom: 2rem;
  }

  .nav-link {
    margin-bottom: 1rem;
  }

  .photo {
    width: 100%;
    margin-bottom: 1rem;
  }

  .updated {
    position: static;
    margin-top: 2rem;
  }
}

/* TYPING POETRY STRIP */
.ticker-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #f5f0e0;
  border-top: 1px solid #d4c9a8;
  padding: 0.4em 1em;
  z-index: 100;
}

#ticker-text {
  font-family: var(--font);
  font-size: 0.78rem;
  color: #2b1d0e;
  letter-spacing: 0.08em;
}

.ticker-cursor {
  font-family: var(--font);
  font-size: 0.78rem;
  color: #2b1d0e;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

body.inner-page {
  background-image:
    linear-gradient(rgba(180, 170, 155, 0.45), rgba(180, 170, 155, 0.45)),
    url('images/hills.jpg');
}

.post p {
  background-color: rgba(245, 240, 224, 0.75);
  padding: 0.4em 0.6em;
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.project-image {
  width: 300px;
  display: block;
  margin-bottom: 0.8rem;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.15);
}

body.inner-page main p:not(.title):not(.meta) {
  background-color: rgba(245, 240, 224, 0.75);
  padding: 0.5em 0.8em;
  margin-bottom: 1.2rem;
  display: table;
}

.carousel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  max-width: 500px;
}

.carousel-window {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: 0.6rem;
  transition: transform 0.35s ease;
}

.carousel-track img {
  width: 60%;
  flex-shrink: 0;
  object-fit: cover;
  aspect-ratio: 4/3;
  opacity: 0.5;
  transition: opacity 0.35s ease;
}

.carousel-track img.active {
  opacity: 1;
}

.carousel-btn {
  background: rgba(245, 240, 224, 0.85);
  border: none;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.3em 0.5em;
  flex-shrink: 0;
}

.carousel-btn:hover {
  background: #fff;
}