/* Ruth Linnea Whitney — Author site (2025)
   Bright, literary aesthetic with blue tones. Fast, accessible, no dependencies.
*/

:root{
  /* Light theme (default) - brighter blue aesthetic */
  --bg: #f0f4ff;                 /* soft blue-white */
  --panel: rgba(255,255,255,.85);
  --panel2: rgba(255,255,255,.95);
  --text: #1e293b;               /* slate/ink */
  --muted: #475569;
  --faint: #64748b;
  --border: rgba(71,85,105,.15);
  --accent: #3b82f6;             /* bright blue */
  --accent2: #8b5cf6;            /* purple accent */
  --accent3: #06b6d4;            /* cyan */
  --shadow: 0 20px 60px rgba(59,130,246,.12);
  --shadow-sm: 0 10px 30px rgba(59,130,246,.08);
  --radius: 20px;
  --radius2: 28px;
  --max: 1120px;
}

/* Optional dark theme if user toggles it */
[data-theme="dark"]{
  --bg: #0f172a;
  --panel: rgba(255,255,255,.08);
  --panel2: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.95);
  --muted: rgba(255,255,255,.75);
  --faint: rgba(255,255,255,.60);
  --border: rgba(255,255,255,.16);
  --accent: #60a5fa;
  --accent2: #a78bfa;
  --accent3: #22d3ee;
  --shadow: 0 20px 60px rgba(0,0,0,.4);
  --shadow-sm: 0 10px 30px rgba(0,0,0,.25);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,.18), transparent 70%),
    radial-gradient(1000px 500px at 80% -5%, rgba(139,92,246,.15), transparent 65%),
    radial-gradient(800px 400px at 50% 100%, rgba(6,182,212,.12), transparent 60%),
    linear-gradient(180deg, #f8faff, #f0f4ff);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}

/* Accessibility */
.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left:1rem;
  top:1rem;
  width:auto;
  height:auto;
  padding:.7rem 1rem;
  background: var(--panel2);
  border: 2px solid var(--accent);
  border-radius: 14px;
  z-index: 9999;
  box-shadow: var(--shadow);
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(180%);
  background: rgba(248,250,255,.88);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(59,130,246,.04);
}
[data-theme="dark"] .site-header{
  background: rgba(15,23,42,.88);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1rem 0;
  gap: 1.5rem;
}

.brand{
  display:flex;
  align-items:center;
  gap:.85rem;
  transition: transform .2s ease;
}
.brand:hover{
  transform: translateY(-1px);
  text-decoration: none;
}
.brand-mark{
  width:46px; height:46px;
  display:grid; place-items:center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  letter-spacing: .03em;
  color: white;
  font-size: 1.1rem;
}
.brand-text{ display:flex; flex-direction:column; gap:.08rem; }
.brand-text strong{ font-size: 1.05rem; color: var(--text); }
.brand-text span{ color: var(--muted); font-size: .92rem; }

/* Nav */
.nav{ display:flex; align-items:center; gap:1rem; }
.nav-toggle{
  display:none;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: .65rem .95rem;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all .2s ease;
}
.nav-toggle:hover{
  background: white;
  box-shadow: var(--shadow-sm);
}
.nav-menu{
  display:flex;
  align-items:center;
  gap:1.2rem;
}
.nav-link{
  color: var(--muted);
  padding: .5rem .3rem;
  border-bottom: 2px solid transparent;
  transition: all .2s ease;
  font-weight: 500;
}
.nav-link:hover{ 
  color: var(--text); 
  text-decoration:none;
  border-bottom-color: var(--accent3);
}
.nav-link.active{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle{
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 12px;
  padding: .55rem .75rem;
  cursor:pointer;
  font-size: 1.2rem;
  transition: all .2s ease;
}
.theme-toggle:hover{ 
  background: white;
  box-shadow: var(--shadow-sm);
  transform: rotate(15deg);
}

.sr-only{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

/* Typography */
h1,h2,h3{
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  letter-spacing: -0.015em;
  color: var(--text);
  font-weight: 700;
}
h1{
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin: 0 0 1.2rem;
}
h2{ 
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 .8rem; 
}
h3{ 
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  margin: 0 0 .6rem; 
}

.kicker{
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .82rem;
  font-weight: 700;
  margin: 0 0 .85rem;
}
.lede{
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 65ch;
  line-height: 1.7;
}

/* Hero */
.hero{ padding: clamp(2rem, 6vw, 4rem) 0 2rem; }
.hero-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2.5rem;
  align-items:start;
}

.cta-row{
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  margin: 1.8rem 0 1.5rem;
}

.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  padding: .9rem 1.4rem;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  text-decoration:none;
  font-weight: 600;
  transition: all .25s ease;
  font-size: .95rem;
}
.button:hover{
  background: white;
  text-decoration:none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.button.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: white;
  box-shadow: var(--shadow-sm);
}
.button.primary:hover{
  box-shadow: var(--shadow);
  transform: translateY(-2px) scale(1.02);
}
.button.subtle{
  background: transparent;
  border-color: var(--border);
}
.button.subtle:hover{
  background: var(--panel);
}

.hero-notes{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.note{
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
}
.note:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.note-label{ 
  display:block; 
  color: var(--accent); 
  font-size: .85rem; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.note-value{ 
  display:block; 
  margin-top: .35rem;
  font-size: .98rem;
  line-height: 1.5;
}

/* Author photo (homepage) - FIXED */
/* Author photo (homepage) - FIXED with more space */
.author-intro{
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.author-photo{
  width: 180px;
  min-width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: 24px;
  border: 3px solid white;
  box-shadow: var(--shadow);
  background: var(--panel2);
  transition: transform .3s ease;
  flex-shrink: 0;
}
.author-photo:hover{
  transform: scale(1.05) rotate(2deg);
}
.author-text{
  flex: 1;
  min-width: 0;
}
.author-text .kicker{ margin-bottom: .65rem; }
.author-text h1{
  margin-top: 0;
}

/* Cards and sections */
.section{ padding: clamp(2rem, 5vw, 3.5rem) 0; }

.section.alt{
  background: linear-gradient(180deg,
    rgba(255,255,255,.5),
    rgba(255,255,255,.2)
  );
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.section-head h2{ margin:0; }
.section-head p{ margin:0; color: var(--muted); max-width: 50ch; }

.grid-3{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}
.grid-2{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}
.split{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.5rem;
  align-items:start;
}

.card{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: var(--radius2);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
  height: 100%;
}
.card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card h2, .card h3{ margin-top: 0; }
.card-top{ margin-bottom:.85rem; }
.card-title{ 
  margin:0; 
  color: var(--accent2); 
  font-size:.9rem; 
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.card-sub{ 
  margin:.45rem 0 0; 
  color: var(--muted); 
  font-size: 1.05rem;
}

.bullets{
  margin: 1rem 0 0;
  padding-left: 1.3rem;
  color: var(--muted);
}
.bullets li{ 
  margin:.4rem 0;
  line-height: 1.6;
}

.card-actions{
  display:flex;
  gap:.85rem;
  flex-wrap:wrap;
  margin-top: 1.3rem;
}

.hero-card{
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.hero-card .mini-quote{
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, 
    rgba(59,130,246,.05), 
    rgba(139,92,246,.05)
  );
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
}
.hero-card .mini-quote:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.mini-quote p{ 
  margin:0; 
  font-style: italic;
  line-height: 1.7;
}
.attribution{ 
  margin-top:.7rem; 
  color: var(--muted); 
  font-size:.95rem;
  font-style: normal;
  font-weight: 600;
}

.quote-card{
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: var(--radius2);
  padding: clamp(1.2rem, 3vw, 1.6rem);
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
}
.quote-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.quote{ 
  margin:0; 
  font-size: 1.05rem; 
  line-height: 1.7;
  font-style: italic;
}
.quote-by{ 
  margin:1rem 0 0; 
  color: var(--muted);
  font-weight: 600;
  font-style: normal;
}

.section-actions{
  margin-top: 1.8rem;
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
}

.callout{
  border: 1px solid var(--border);
  background: linear-gradient(135deg,
    rgba(59,130,246,.08),
    rgba(139,92,246,.08)
  );
  border-radius: var(--radius2);
  padding: clamp(1.3rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
}
.callout:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.callout h3, .callout h2{ margin-top:0; }

.info-row{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.info{
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  box-shadow: var(--shadow-sm);
}

.link-list{
  margin:1rem 0 0;
  padding-left: 1.3rem;
}
.link-list li{ margin:.5rem 0; }
.link-list a{ 
  text-decoration: underline; 
  color: var(--accent);
  font-weight: 600;
  transition: color .2s ease;
}
.link-list a:hover{
  color: var(--accent2);
}

.facts{
  margin: 1rem 0 0;
  padding-left: 1.3rem;
  color: var(--muted);
}
.facts li{ margin:.5rem 0; line-height: 1.6; }

.tiny{ font-size: .92rem; }
.muted{ color: var(--muted); }

/* Page hero */
.page-hero{
  padding: clamp(2rem, 5vw, 3.5rem) 0 1.5rem;
}
.page-hero h1{
  font-size: clamp(2rem, 4vw, 3rem);
}
.page-hero .lede{ margin-top: .6rem; }

/* Book page specific */
.book-split{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}
.cover{
  position: sticky;
  top: 100px;
}
.cover img{
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

/* Other writing list */
.works{
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.works li{
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 18px;
  margin-bottom: .9rem;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
  transition: all .25s ease;
}
.works li:hover{
  transform: translateX(4px);
  box-shadow: var(--shadow);
}
.works a{ 
  color: var(--accent); 
  text-decoration: underline;
  font-weight: 600;
}
.works a:hover{
  color: var(--accent2);
}
.star{
  display:inline-block;
  width: 1.1rem;
  color: var(--accent2);
  margin-right: .2rem;
}

/* Footer */
.site-footer{
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.3));
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 1.5rem;
  flex-wrap:wrap;
}
.footer-inner p{ margin:0; font-size: .95rem; }

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px){
  .hero-grid{
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .split{
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .book-split{
    grid-template-columns: 1fr;
  }
  .cover{
    position: static;
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 768px){
  .container{
    width: calc(100% - 2rem);
  }
  
  .header-inner{
    padding: .85rem 0;
  }
  
  .brand-mark{
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
  
  .brand-text strong{
    font-size: 1rem;
  }
  
  .brand-text span{
    font-size: .88rem;
  }

  .nav-toggle{ 
    display:inline-flex; 
    cursor:pointer; 
  }
  
  .nav-menu{
    position: fixed;
    right: 1rem;
    top: 70px;
    display:none;
    flex-direction:column;
    align-items:stretch;
    gap:.6rem;
    padding: 1rem;
    width: min(340px, calc(100vw - 2rem));
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    background: rgba(248,250,255,.98);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    z-index: 1000;
  }
  [data-theme="dark"] .nav-menu{
    background: rgba(15,23,42,.98);
  }
  .nav-menu.open{ display:flex; }
  
  .nav-link{ 
    padding:.7rem .6rem;
    border-radius: 12px;
    border-bottom: none;
  }
  .nav-link:hover,
  .nav-link.active{
    background: rgba(59,130,246,.1);
  }
  
  .theme-toggle{
    padding: .7rem 1rem;
    justify-content: center;
  }

  .section-head{
    align-items:start;
    flex-direction:column;
    gap: .8rem;
  }
  
  .grid-3,
  .grid-2{
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .cta-row{
    flex-direction: column;
    gap: .8rem;
  }
  
  .button{
    width: 100%;
    text-align: center;
  }
  
  .hero-notes{
    grid-template-columns: 1fr;
    gap: .8rem;
  }
  
  .info-row{
    grid-template-columns: 1fr;
    gap: .8rem;
  }
  
  .footer-inner{
    flex-direction: column;
    text-align: center;
    gap: .8rem;
  }
}

@media (max-width: 560px){
  .author-intro{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  
  .author-photo{
    width: 200px;
    min-width: 200px;
    height: 200px;
  }
  
  .author-text{
    width: 100%;
  }
  
  h1{
    font-size: 2rem;
  }
  
  .lede{
    font-size: 1.05rem;
  }
}

@media (max-width: 400px){
  .container{
    width: calc(100% - 1.5rem);
  }
  
  .card{
    padding: 1.2rem;
  }
  
  .callout{
    padding: 1.3rem;
  }
}