/* ============================================
   TEYA WREN — Global Stylesheet
   ============================================ */

/* --- Reset & Root Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --paper:      #faf6f0;
  --ink:        #2a2118;
  --ink-light:  #6b5e4e;
  --yellow:     #f9e84e;
  --yellow-dark:#f0d700;
  --pink:       #ffb3c1;
  --blue:       #b8dff0;
  --green:      #c8eabc;
  --peach:      #ffd4a8;
  --shadow:     rgba(42, 33, 24, 0.15);

  /* Typography */
  --font-hand:  'Caveat', cursive;
  --font-serif: 'Lora', serif;
  --font-sans:  'DM Sans', sans-serif;

  /* Spacing */
  --section-pad: 6rem 3rem;
  --max-width:   1100px;
}

/* --- Base --- */
html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(249,232,78,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184,223,240,0.1) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  font-family: var(--font-sans);
  color: var(--ink);
  overflow-x: hidden;
}

/* --- Navigation --- */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(250,246,240,0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid rgba(42,33,24,0.08);
}
.nav-logo {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.nav-links { display: flex; gap: 0.4rem; list-style: none; }
.nav-links a {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: var(--yellow);
}

/* --- Sticky Notes --- */
.sticky {
  font-family: var(--font-hand);
  color: var(--ink);
  padding: 1rem 1.1rem 1.3rem;
  box-shadow: 3px 4px 12px var(--shadow), 0 1px 3px rgba(0,0,0,0.08);
  line-height: 1.4;
  position: absolute;        /* default — overridden by inline/scatter variants */
  z-index: 5;               /* Ensure stickies stay above other content */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  user-select: none;
}
.sticky::before {
  content: '';
  display: block;
  height: 0.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.06), transparent);
  position: absolute; top: 0; left: 0; right: 0;
}
.sticky:hover {
  box-shadow: 5px 7px 18px var(--shadow);
  z-index: 10;
}

/* Colors */
.sticky--yellow { background: var(--yellow); }
.sticky--pink   { background: var(--pink); }
.sticky--blue   { background: var(--blue); }
.sticky--green  { background: var(--green); }
.sticky--peach  { background: var(--peach); }

/* Sizes */
.sticky--small  { width: 120px; font-size: 1rem; }
.sticky--medium { width: 160px; font-size: 1.15rem; }
.sticky--large  { width: 210px; font-size: 1.35rem; }

/* Variants */
.sticky--inline {
  position: relative;
  display: inline-block;
  float: right;
  margin: 0.5rem 0 1.5rem 2rem;
  clear: right;
}
.sticky--scatter {
  position: relative;
  display: inline-block;
  vertical-align: top;
  margin: 0.5rem;
}
.sticky--card {
  position: absolute;
  top: -12px; right: 16px;
  pointer-events: none;
}
.sticky--header {
  position: absolute;
  pointer-events: none;
}

/* --- Buttons --- */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  box-shadow: 3px 3px 0 var(--ink-light);
}
.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink-light);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--yellow); }

/* --- Section Shared --- */
section { position: relative; padding: var(--section-pad); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-label {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--ink-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

/* --- Post Cards --- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.post-card {
  background: white;
  border-radius: 2px;
  padding: 2rem;
  border: 1.5px solid rgba(42,33,24,0.08);
  position: relative;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s;
}
.post-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.post-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 30px rgba(42,33,24,0.1);
}
.post-tag {
  display: inline-block;
  background: var(--yellow);
  font-family: var(--font-hand);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.8rem;
  transform: rotate(-1deg);
}
.post-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.7rem;
  color: var(--ink);
}
.post-card .post-excerpt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin-bottom: 1.2rem;
}
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.post-meta {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--ink-light);
}
.post-read {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 1px;
  transition: all 0.2s;
}
.post-read:hover { background: var(--yellow); padding: 0 3px 1px; }

/* --- Post Pages --- */
.post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-light);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: all 0.2s;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.1s forwards;
}
.back-link:hover {
  color: var(--ink);
}
.back-link::before {
  content: "←  ";
}

.post-header {
  margin-bottom: 3rem;
  position: relative;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}
.post-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
}
.post-header-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.post-divider {
  border: none;
  border-top: 2px dashed rgba(42, 33, 24, 0.15);
  margin: 2rem 0;
}

.author-note {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.35s forwards;
  position: relative;
  min-height: 80px;
}

.post-content {
  opacity: 0;
  animation: fadeUp 0.7s ease 0.45s forwards;
}
.post-content p {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.post-content p:first-child::first-letter {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 600;
  float: left;
  line-height: 0.85;
  margin: 0.1em 0.08em 0 0;
  color: var(--ink);
}
.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
}
.post-content blockquote {
  border-left: 4px solid var(--yellow);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-light);
}
.post-content em {
  font-style: italic;
}
.post-content strong {
  font-weight: 600;
  color: var(--ink);
}

.inline-sticky-anchor {
  float: right;
  clear: right;
  margin: 0.5rem 0 1.5rem 2rem;
  position: relative;
  width: 180px;
  min-height: 80px;
}

.post-end {
  margin-top: 3rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 2px dashed rgba(42, 33, 24, 0.15);
  text-align: center;
  position: relative;
  min-height: 180px;
}
.post-end p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  margin-top: 1rem;
}

.more-posts {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}
.more-posts h3 {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.more-card {
  background: white;
  padding: 1.5rem;
  border: 1.5px solid rgba(42, 33, 24, 0.08);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
}
.more-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(42, 33, 24, 0.08);
}
.more-card h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.more-card span {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* --- Footer --- */
footer {
  background: var(--ink);
  color: rgba(250,246,240,0.6);
  padding: 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
}
footer p { font-family: var(--font-hand); font-size: 1rem; }
footer p a {
  color: inherit;
  text-decoration: none;
}
footer p a:hover {
  color: var(--paper);
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) rotate(var(--r, 0deg)); }
  to   { opacity: 1; transform: scale(1)    rotate(var(--r, 0deg)); }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}
.anim-pop-in {
  opacity: 0;
  animation: popIn 0.5s ease forwards;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  section { padding: 4rem 1.5rem; }
  .sticky--inline { float: none; margin: 1rem auto; display: flex; justify-content: center; }
  .sticky--header { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-container { padding: 7rem 1.5rem 3rem; }
  .inline-sticky-anchor { float: none; margin: 1rem auto 1.5rem; }
  .post-end {
    min-height: 220px;
    padding-bottom: 4rem;
  }
  .more-posts { padding: 1.5rem 1.5rem 4rem; }
}
