/* =========================
   Theme variables
========================= */
:root {
  --bg: #0b0d12;
  --text: #e8e8ec;
  --muted: #9a9aa5;
  --gold: #e6c27a;
  --line: rgba(255,255,255,0.08);
}

/* Tell browsers this is a dark site (fixes iOS inputs) */
html {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: 30px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  line-height: 1.6;
  position: relative;
}

/* Subtle background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("https://www.transparenttextures.com/patterns/asfalt-dark.png");
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}


/* =========================
   Layout
========================= */
.container {
  width: 100%;
  max-width: 1100px;     /* MATCH header */
  margin: 0 auto;
  padding: 40px 26px 60px;  /* MATCH horizontal padding */
}

a {
  color: inherit;
  text-decoration: none;
}
/* =========================
   Logo Header
========================= */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.top-header-inner {
  width: 100%;
  max-width: 1100px;
  padding: 20px ;
  display: flex;
  align-items: center;
}

.logo img {
  height: 30px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.logo img:hover {
  opacity: 0.8;
}

/* Tablet */
@media (max-width: 1024px) {
  .logo img {
    height: 30px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .logo img {
    height: 24px;
  }
}

/* =========================
   Title
========================= */
h1 {
  font-family: "Libre Baskerville", serif;
  font-size: 40px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.3px;
  color: rgba(199, 199, 199, 0.92); 
}

/* =========================
   Story content
========================= */
article {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

article p {
  margin-bottom: 26px;
}


/* =========================
   Meta
========================= */
.meta {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* =========================
   Notes
========================= */
.note-section {
  margin-top: 32px;
}

.note-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.field-error {
  font-size: 13px;
  margin-top: 10px;
  color: #e6c27a; /* your muted gold */
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.field-error.show {
  opacity: 1;
  transform: translateY(0);
}

textarea.error {
  border: 1px solid #e6c27a;
}

/* Textarea — iOS SAFE */
textarea {
  width: 100%;
  min-height: 120px;
  background-color: transparent !important;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;

  -webkit-appearance: none;
  appearance: none;
}

textarea::placeholder {
  color: rgba(255,255,255,0.35);
}

textarea:focus {
  outline: none;
}

/* Autofill fix */
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-text-fill-color: var(--text) !important;
}

/* =========================
   Buttons
========================= */
button {
  margin-top: 12px;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
}

button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* =========================
   Note status animation
========================= */
.note-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.note-status.success {
  opacity: 0;
  transform: translateY(4px);
  animation: noteSuccess 0.6s ease forwards;
}

@keyframes noteSuccess {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-section.success textarea {
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

/* =========================
   Share
========================= */
.note-actions {
  display: flex;
  align-items: center;   /* vertical center */
  gap: 18px;
  margin-top: 14px;
}

/* Button */
#sendBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon container */
.share-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Icons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: none;
  border: none;
  padding: 0;
  cursor: pointer;

  opacity: 0.45;
  transition: opacity 0.25s ease, transform 0.2s ease;
}

.icon-btn img {
  transition: filter 0.25s ease, transform 0.2s ease;
}

/* Perfect vertical correction */
.icon-btn img[alt="Instagram"] {
  transform: translateY(5.5px);
}

.icon-btn:hover {
  opacity: 1;
}

.icon-btn:hover img {
  filter: brightness(0) saturate(100%) invert(78%) sepia(32%) saturate(512%) hue-rotate(5deg) brightness(95%) contrast(90%);
}

/* =========================
   Footer
========================= */
.story-footer {
  margin-top: 40px;   /* increase this */
  padding-top: 20px; 
  text-align: center;
}

.story-footer a {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.story-footer a:hover {
  color: var(--gold);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.back-link img {
  width: 14px;
  height: 14px;
  transform: translateY(2.5px);
  opacity: 0.55;
  transition: opacity .25s ease, filter .25s ease;
}

.back-link:hover img {
  opacity: 1;
  transform: translateY(2.5px); /* keep same vertical position */
  filter: brightness(0) saturate(100%) invert(78%) sepia(32%) saturate(512%) hue-rotate(5deg) brightness(95%) contrast(90%);
}

.back-link:hover {
  color: var(--gold);
  transform: translateX(-1.5px);
}

.copyright {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.45;
}

/* =========================
   Mobile
========================= */
@media (max-width: 480px) {
  .container {
    padding-top: 44px;
  }

  .top-header {
    margin-bottom: 18px;
  }

  h1 {
    font-size: 32px;
    margin: 0;
  }

  article {
    font-size: 14px;
    line-height: 1.6;
  }

  article p {
    margin-bottom: 22px;
  }

  textarea {
    min-height: 140px;
  }

  /* Mobile alignment decisions */
  .share-section {
    text-align: left;
  }

  .story-footer {
    margin-top: 40px;
    text-align: center;
  }

  .story-footer a {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .copyright {
    font-size: 10.5px;
  }
}
