/* =========================================================
   Variables & Design System
   ========================================================= */

:root {
  /* Colors */
  --bg: #f9f8f5;
  --text: #111;
  --muted: #6f6f6f;
  --accent: #8b6f47; /* subtle bronze/earth tone for CTAs */
  --ink-soft: rgba(0,0,0,0.65);
  --ink-faint: rgba(0,0,0,0.35);
  
  /* Typography */
  --reading-size: 18px;
  
  /* Spacing Scale (systematic) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  
  /* Layout */
  --nav-offset: 160px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* =========================================================
   Base Styles
   ========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--text);
  color: var(--bg);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  z-index: 100;
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 0;
}

/* =========================================================
   Typography
   ========================================================= */

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-faint);
  transition: border-color var(--transition-fast);
}

a:hover {
  border-bottom-color: rgba(0,0,0,0.7);
}

a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

p {
  font-size: 17.5px;
  line-height: 1.75; /* increased from 1.7 for better readability */
  margin-bottom: var(--space-lg);
  hanging-punctuation: first last;
}

h1 {
  font-family: "Libre Baskerville", serif;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

h2 {
  font-family: "Libre Baskerville", serif;
  font-size: 34px;
  font-weight: 400;
  margin-bottom: var(--space-xl);
}

/* =========================================================
   Layout Components
   ========================================================= */

.divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  max-width: 720px;
  margin: 56px auto;
  opacity: 0.8;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--nav-offset) var(--space-xl) 160px;
}

.wrap > h1 {
  margin-top: 0;
}

section {
  margin-bottom: var(--space-4xl);
}

main.wrap {
  padding-bottom: var(--space-4xl);
}

.divider + .wrap {
  padding-top: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Site Header & Navigation
   ========================================================= */

.site-header {
  position: relative;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  height: var(--nav-offset);
}

.has-hero .hero {
  margin-top: calc(-1 * var(--nav-offset));
}

body:not(.has-hero) .site-header {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Navigation base styles */
nav {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 10;
  padding: var(--space-sm) 20px;
}

nav a {
  margin: 0 20px;
  color: var(--text);
  opacity: 0.65;
  border-bottom: none;
  font-weight: 400;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

nav a:not(.active) {
  font-weight: 400;
}

/* Subtle underline animation on hover */
nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

nav a:hover {
  opacity: 1;
}

nav a:hover::after {
  opacity: 0.4;
  transform: scaleX(1);
}

nav a.active {
  opacity: 1;
  font-weight: 500;
  border-bottom: 1px solid rgba(0,0,0,0.4);
}

nav a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Hero-specific navigation */
.has-hero nav {
  background: rgba(0, 0, 0, 0.36);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

.has-hero nav a {
  color: white;
  opacity: 0.85;
}

.has-hero nav a:hover {
  opacity: 1;
}

.has-hero nav a.active {
  opacity: 1;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.6);
}

/* =========================================================
   Hero Section
   ========================================================= */

.hero {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/images/IMG_0250.jpg") center / cover no-repeat;
  filter: grayscale(85%) contrast(105%);
  animation: heroColour 3.5s ease-out forwards;
  z-index: 0;
  animation-delay: 0.8s;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.65),
    rgba(0,0,0,0.35) 45%,
    rgba(0,0,0,0.05) 75%,
    rgba(0,0,0,0)
  );
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: 0 var(--space-xl) 84px;
  max-width: 540px;
  color: white;
}

.hero-text p {
  font-size: 19px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.credentials {
  margin-top: 28px;
  font-size: 14px;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* =========================================================
   Writing Section (Homepage)
   ========================================================= */

.writing-section {
  max-width: 1100px;
  margin: calc(var(--nav-offset) - 20px) auto 0;
  padding: 0 var(--space-xl);
}

.writing-block {
  display: grid;
  grid-template-columns: 52% 48%;
  gap: var(--space-4xl);
  align-items: center;
}

.writing-text {
  max-width: 500px;
}

.writing-text p {
  line-height: 1.75;
}

.writing-cta {
  margin-top: var(--space-lg);
  font-size: 15px;
}

.writing-cta a {
  font-weight: 500;
  border-bottom-color: var(--accent);
  transition: all var(--transition-base);
}

.writing-cta a:hover {
  border-bottom-color: var(--text);
  color: var(--accent);
}

.inline-cta {
  display: inline-block;
  margin-top: 0.6em;
}

/* Writing Illustration with fade-in effect */
.writing-illustration img {
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  opacity: 0;
  transform: translateY(28px);
  filter: grayscale(85%) contrast(105%);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out, filter 0.5s ease;
}

.writing-illustration img:hover {
  filter: grayscale(60%) contrast(105%);
}

.writing-illustration.is-visible img {
  opacity: 0.9;
  transform: translateY(0);
}

/* =========================================================
   Writing Page Layout
   ========================================================= */

.writing-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  column-gap: var(--space-3xl);
  row-gap: 36px;
}

.writing-layout section {
  margin-bottom: 0;
}

.writing-aside {
  padding-top: var(--space-sm);
}

.aside-note {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--space-sm);
}

.writing-marker {
  width: 48px;
  height: 1px;
  background: rgba(0,0,0,0.15);
  margin-bottom: var(--space-3xl);
}

.section-marker {
  width: 32px;
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin: 56px auto var(--space-3xl);
  grid-column: 1 / -1;
}

.lede {
  font-family: "Libre Baskerville", serif;
  font-size: 20.5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-xl);
  font-weight: 400;
}

/* Profile Image */
.profile-image {
  display: block;
  width: 100%;
  max-width: 240px;
  margin-top: var(--space-xl);
  margin-bottom: 40px;
  filter: grayscale(85%) contrast(105%);
  opacity: 0.95;
  transition: filter var(--transition-slow), opacity var(--transition-slow);
}

.profile-image:hover {
  filter: grayscale(40%) contrast(105%);
  opacity: 1;
}

/* =========================================================
   Aside Illustration & Judge Quote
   ========================================================= */

.aside-illustration {
  margin-top: var(--space-sm);
  align-self: start;
  margin-bottom: 20px;
}

.aside-illustration img {
  width: 100%;
  max-width: 240px;
  max-height: 360px;
  object-fit: contain;
  filter: grayscale(85%);
  opacity: 0.9;
  transition: filter var(--transition-slow), opacity var(--transition-slow);
}

.aside-illustration img:hover {
  filter: grayscale(50%);
  opacity: 1;
}

.judge-quote {
  margin-top: 40px;
  padding: var(--space-md);
  padding-left: var(--space-md);
  border-left: 2px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.015);
  border-radius: 2px;
}

.judge-quote blockquote {
  margin: 0;
  padding: 0;
}

.judge-quote blockquote p {
  font-family: "Libre Baskerville", serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: var(--space-sm);
}

.judge-quote cite {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-family: Inter, sans-serif;
  font-style: normal;
  letter-spacing: 0.04em;
  color: rgba(0,0,0,0.5);
}

/* =========================================================
   Recognition List
   ========================================================= */

.recognition-list {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0;
}

.recognition-list li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 14px;
  position: relative;
  padding-left: 18px;
}

.recognition-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

.recognition-list li.highlight {
  color: var(--text);
  font-weight: 500;
}

/* =========================================================
   Editorial Strengths List
   ========================================================= */

.editorial-strengths {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
}

.editorial-strengths li {
  margin-bottom: 12px;
  padding-left: 18px;
  position: relative;
  line-height: 1.7;
}

.editorial-strengths li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

/* =========================================================
   Writing Piece Content
   ========================================================= */

.piece {
  padding-top: 0;
  border-top: none;
}

.piece-title {
  font-family: "Libre Baskerville", serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 18px;
  margin-top: var(--space-lg);
}

.piece-meta {
  margin: 12px 0 36px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.piece-cred {
  display: block;
  margin-bottom: var(--space-xs);
}

.piece-theme {
  display: block;
}

.piece-theme-title {
  color: var(--muted);
  letter-spacing: 0.04em;
  font-style: normal;
}

.piece-theme em {
  color: inherit;
  font-style: italic;
}

.piece-text p {
  line-height: 1.85;
  max-width: 640px;
  margin-bottom: 34px;
  font-size: var(--reading-size);
  text-wrap: balance;
}

.piece-text p:first-of-type {
  margin-bottom: 36px;
}

.piece-text p:last-of-type,
.piece-text p:nth-last-child(-n+4) {
  margin-bottom: var(--space-lg);
}

.piece-text {
  margin-left: 0;
  padding-left: 0;
}

/* Drop cap – first paragraph only */
.piece-text p:first-of-type::first-letter {
  font-family: "Libre Baskerville", serif;
  font-size: 3em;
  line-height: 0.9;
  float: left;
  margin: 0.05em 0.12em 0 0;
}

/* =========================================================
   Writing Excerpt (Homepage)
   ========================================================= */

.writing-excerpt {
  margin-top: 72px;
  margin-bottom: 48px;
  max-width: 640px;
}

.excerpt-title {
  font-family: "Libre Baskerville", serif;
  font-size: 34px;
  font-weight: 400;
  margin-bottom: var(--space-xl);
}

.writing-excerpt p:first-of-type {
  font-family: "Libre Baskerville", serif;
  font-size: 21px;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}

.writing-excerpt p {
  line-height: 1.8;
}

.excerpt-cta {
  margin-top: var(--space-lg);
}

.excerpt-cta a {
  font-weight: 500;
  border-bottom-color: var(--accent);
}

.excerpt-cta a:hover {
  border-bottom-color: var(--text);
}

/* Centre featured excerpt on larger screens */
@media (min-width: 1024px) {
  .writing-excerpt {
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================================================
   About Page
   ========================================================= */

.about p {
  max-width: 620px;
}

.about p.award {
  margin-top: 40px;
  font-size: 15px;
  color: var(--muted);
  opacity: 0.85;
}

.about p:first-of-type {
  font-family: "Libre Baskerville", serif;
  font-size: 20.5px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-xl);
  font-weight: 400;
}

/* =========================================================
   Features Page
   ========================================================= */

.features-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl);
  margin-top: var(--space-3xl);
}

.feature-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  column-gap: var(--space-3xl);
  align-items: start;
}

.feature-thumb img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(85%) contrast(105%);
  opacity: 0.9;
  transition: filter var(--transition-slow), opacity var(--transition-slow), transform var(--transition-base);
}

.feature-thumb img:hover {
  filter: grayscale(40%) contrast(105%);
  opacity: 1;
  transform: scale(1.02);
}

.feature-text h2 {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.feature-meta {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 20px;
}

.feature-text p {
  max-width: 640px;
}

.feature-cta {
  margin-top: var(--space-md);
  font-size: 14px;
  color: var(--muted);
}

/* =========================================================
   Contact Form
   ========================================================= */

.contact-form {
  max-width: 560px;
}

.contact-form form {
  margin-top: var(--space-3xl);
}

.form-field {
  margin-bottom: 40px;
}

.form-field label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-base);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--ink-faint);
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-color: rgba(0,0,0,0.6);
}

.form-actions {
  margin-top: 56px;
}

.form-actions button {
  font-family: Inter, sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--ink-faint);
  transition: all var(--transition-base);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.form-actions button:hover {
  border-bottom-color: rgba(0,0,0,0.7);
  color: var(--accent);
}

.form-actions button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* =========================================================
   Footer
   ========================================================= */

footer {
  margin-top: var(--space-4xl);
  font-size: 14px;
  color: var(--muted);
}

.wrap > section:last-of-type {
  margin-bottom: 0;
}

/* =========================================================
   Animations & Motion
   ========================================================= */

.hero-text > * {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-text > * {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 1.6s ease-out forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before {
    animation: none;
    filter: grayscale(0%) contrast(100%);
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

@keyframes heroColour {
  0% {
    filter: grayscale(85%) contrast(105%);
  }
  100% {
    filter: grayscale(5%) contrast(100%);
  }
}

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

/* Tablet */
@media (max-width: 768px) {
  .writing-aside { 
    display: none; 
  }

  .writing-layout {
    grid-template-columns: 1fr;
  }

  .feature-item {
    grid-template-columns: 1fr;
    row-gap: var(--space-xl);
  }

  .feature-thumb {
    max-width: 420px;
  }

  .writing-marker,
  .profile-image,
  .aside-note:first-of-type {
    display: none;
  }

  p {
    font-size: 17px;
    line-height: 1.75;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --nav-offset: 120px;
  }

  nav {
    top: 24px;
    padding: var(--space-sm) 14px;
    font-size: 12px;
  }

  nav a {
    margin: 0 12px;
  }

  .hero {
    height: 62vh;
    min-height: 420px;
  }

  .hero-text {
    padding: 0 var(--space-lg) 56px;
  }

  section {
    margin-bottom: 72px;
  }

  .divider {
    margin: 40px auto;
  }

  /* Homepage intro: single column, text first */
  .writing-block {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .writing-cta a {
    border-bottom-color: rgba(0,0,0,0.45);
    font-weight: 500;
  }

  .writing-text {
    order: 0;
    max-width: 100%;
  }

  .writing-illustration {
    order: 1;
  }

  .writing-section {
    padding-top: var(--space-lg);
    margin-bottom: var(--space-4xl);
  }

  .writing-excerpt p {
    text-wrap: balance;
  }

  /* Forms */
  .form-field input,
  .form-field textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px 0;
  }

  .form-actions {
    margin-top: 40px;
  }

  /* Features responsive */
  .features-list {
    gap: 72px;
  }

  .feature-meta {
    font-size: 12px;
  }

  .feature-cta {
    font-size: 13px;
  }

  /* Disable drop cap on small screens */
  .piece-text p:first-of-type::first-letter {
    float: none;
    font-size: inherit;
    margin: 0;
  }
}

/* =========================================================
   Print Styles
   ========================================================= */

@media print {
  .site-header,
  nav,
  .hero,
  footer,
  .form-actions {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .piece-text p {
    max-width: 100%;
  }

  a {
    border-bottom: none;
    text-decoration: underline;
  }
}