/* ============================================================
   Mark Lipkin — personal site
   Warm, minimalist, bookish
   ============================================================ */

:root {
  --bg:          #f7f1e8;
  --bg-alt:      #efe6d8;
  --bg-card:    #fdfaf4;
  --text:        #2e2520;
  --text-soft:   #6b5d52;
  --text-muted:  #8a7d70;
  --accent:      #9a5a3c;
  --accent-soft: #c8a78f;
  --border:      #ddd1bf;
  --shadow:      0 1px 2px rgba(46, 37, 32, 0.04),
                 0 4px 16px rgba(46, 37, 32, 0.06);
  --shadow-lg:   0 4px 12px rgba(46, 37, 32, 0.08),
                 0 16px 40px rgba(46, 37, 32, 0.12);

  --font-serif:  'Lora', Georgia, 'Times New Roman', serif;
  --font-display:'Cormorant Garamond', Georgia, serif;

  --maxw:        780px;
  --maxw-wide:   1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { border-bottom-color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
}

h1 { font-size: 2.6rem; letter-spacing: 0.01em; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

hr.rule {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 3rem auto;
  max-width: 80px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
  background: rgba(247, 241, 232, 0.92);
}

.site-header .inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--text);
  border-bottom: 0;
}
.site-brand:hover { color: var(--accent); }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-card);
}
.lang-toggle button {
  background: transparent;
  border: 0;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

main.wide {
  max-width: var(--maxw-wide);
}

.section {
  margin-bottom: 4rem;
}

.section-heading {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-heading h2 {
  margin-bottom: 0.25rem;
}
.section-heading .sub {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* ---------- Hero / Title ---------- */

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}
.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.hero .tagline {
  color: var(--text-soft);
  font-style: italic;
  font-size: 1.1rem;
}

/* ---------- Bio ---------- */

.bio {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-soft);
}
.bio p {
  font-size: 1.05rem;
}

.social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  background: var(--bg-card);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.social a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.social svg { width: 18px; height: 18px; }

/* ---------- Book / Story Cards ---------- */

.work-grid {
  display: grid;
  gap: 2rem;
}

.work-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  color: var(--text);
}
.work-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-bottom: 1px solid var(--border);
  border-color: var(--accent-soft);
}
.work-card .cover {
  width: 140px;
  aspect-ratio: 2 / 3;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.work-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-card h3 {
  margin-bottom: 0.25rem;
  color: var(--text);
}
.work-card .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}
.work-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.97rem;
}

/* ---------- Form ---------- */

.contact-form {
  max-width: 540px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}
.contact-form label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(154, 90, 60, 0.12);
}
.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

/* honeypot — hidden from humans */
.contact-form .hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button {
  justify-self: center;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.75rem 2.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.contact-form button:hover {
  background: #80452c;
  transform: translateY(-1px);
}
.form-status {
  text-align: center;
  font-style: italic;
  color: var(--text-soft);
  min-height: 1.5em;
}
.form-status.error { color: #a04020; }
.form-status.ok    { color: #4a6b3e; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer .email-link {
  color: var(--text-soft);
}

/* ===========================================================
   Novel page
   =========================================================== */

body.novel-page {
  background: var(--bg);
  position: relative;
}

body.novel-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('assets/img/winter-landscape.svg') center/cover no-repeat,
              linear-gradient(180deg, #e8eef2 0%, #f7f1e8 75%);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

body.novel-page .site-header {
  background: rgba(247, 241, 232, 0.85);
}

.novel-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3rem;
}

.novel-cover {
  position: relative;
  cursor: zoom-in;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-alt);
  aspect-ratio: 2 / 3;
}
.novel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.novel-cover:hover img {
  transform: scale(1.02);
}

.novel-info h1 {
  font-size: 2.8rem;
  margin-bottom: 0.25rem;
}
.novel-info .author {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.blurb {
  background: rgba(253, 250, 244, 0.85);
  border-left: 3px solid var(--accent-soft);
  padding: 1.25rem 1.5rem;
  border-radius: 0 4px 4px 0;
  font-size: 1.02rem;
  color: var(--text-soft);
  margin-bottom: 2rem;
}
.blurb p { margin: 0 0 1em; }
.blurb p:last-child { margin-bottom: 0; }
.blurb p:first-child {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 1.25em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--border);
}

.publishing-info p {
  margin: 0 0 0.35em;
  color: var(--text-soft);
}
.publishing-info p:last-child { margin-bottom: 0; }

.novel-block {
  background: rgba(253, 250, 244, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}
.novel-block h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.keywords .kw {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.store-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.store-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.preview-cta {
  text-align: center;
  padding: 1.5rem;
}
.preview-cta .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, transform 0.15s ease;
}
.preview-cta .btn:hover {
  background: #80452c;
  transform: translateY(-1px);
  border-bottom: 0;
}
.preview-cta .note {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.back-link::before { content: "← "; }

/* ---------- Modal (cover lightbox) ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 22, 18, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal.open {
  display: flex;
  opacity: 1;
}
.modal img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border-radius: 4px;
  animation: zoomIn 0.3s ease;
}
.modal .close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
.modal .close:hover { opacity: 1; }

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===========================================================
   Story page
   =========================================================== */

.story-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.story-hero .cover {
  width: 180px;
  aspect-ratio: 2 / 3;
  margin: 0 auto 1.5rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-alt);
}
.story-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.story-hero h1 { margin-bottom: 0.25rem; }
.story-hero .author {
  color: var(--text-muted);
  font-style: italic;
}

.story-body {
  color: var(--text-soft);
  font-size: 1.05rem;
}
.story-body p { margin-bottom: 1.2em; }

.download-cta {
  text-align: center;
  margin: 3rem 0 1rem;
}
.download-cta .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.download-cta .btn:hover {
  background: #80452c;
  border-bottom: 0;
}
.download-cta .formats {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===========================================================
   Cookie consent banner
   =========================================================== */

.cookie-banner {
  position: fixed;
  left:   1rem;
  right:  1rem;
  bottom: 1rem;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  animation: cookie-in 0.28s ease;
}
.cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.cookie-banner p {
  margin: 0;
  flex: 1 1 280px;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.cookie-banner-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  border-bottom: 1px solid transparent;
  margin-right: 0.25rem;
}
.cookie-banner-link:hover {
  border-bottom-color: var(--text-muted);
  color: var(--text-soft);
}

.cookie-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cookie-btn:hover { border-color: var(--accent-soft); }

.cookie-btn-accept {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cookie-btn-accept:hover { background: #80452c; border-color: #80452c; }

@keyframes cookie-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@media (max-width: 600px) {
  .cookie-banner { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; }
  .cookie-banner-inner { padding: 0.85rem 1rem; }
  .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}

/* footer secondary line (privacy + cookie settings) */
.footer-links {
  margin-top: 0.35rem !important;
  font-size: 0.82rem;
}
.footer-links a {
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
}
.footer-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===========================================================
   Privacy / prose page
   =========================================================== */

.prose h1 {
  margin-bottom: 1.5rem;
}
.prose > p {
  color: var(--text-soft);
  font-size: 1.02rem;
}

.prose-section {
  margin: 2rem 0;
}
.prose-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
.prose-section p {
  color: var(--text-soft);
  margin: 0 0 0.85em;
}
.prose-section p:last-child { margin-bottom: 0; }
.prose-section code {
  background: var(--bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: Menlo, Consolas, monospace;
  color: var(--text);
}
.prose-section b { color: var(--text); }

.prose-meta {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ===========================================================
   Responsive
   =========================================================== */

@media (max-width: 720px) {
  .hero h1 { font-size: 2.4rem; }
  .work-card {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  .work-card .cover { width: 100px; }
  .novel-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .novel-cover {
    max-width: 240px;
    margin: 0 auto;
  }
  .novel-info h1 { font-size: 2.1rem; text-align: center; }
  .novel-info .author { text-align: center; }
  .novel-block { padding: 1.25rem 1.25rem; }
  main { padding: 2rem 1rem 3rem; }
}
