/*
 * The Way of It
 * A design inspired by the meeting of Zen and The Work
 *
 * Design principles:
 * - Emptiness as presence (negative space)
 * - Simplicity revealing depth
 * - The quality of inquiry - openness, questioning
 * - Breath-like rhythm in layout
 * - Enso (Zen circle) as subtle motif
 */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

:root {
  /* Colors inspired by ink wash and natural elements */
  --ink: #1c1917;
  --ink-soft: #292524;
  --stone: #57534e;
  --mist: #a8a29e;
  --sand: #e7e5e4;
  --paper: #fafaf9;
  --breath: #f5f5f4;

  /* Accent - like a single camellia in a Zen garden */
  --accent: #9f1239;
  --accent-soft: #be123c;

  /* Typography */
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;

  /* Spacing - generous, breathing room */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Transitions - slow, mindful */
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset with intention */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  font-weight: 300;
  letter-spacing: 0.01em;
}

/* Selection - subtle */
::selection {
  background: var(--sand);
  color: var(--ink);
}

/* Typography - clarity through simplicity */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: 1.75rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--ink-soft);
}

h3 {
  font-size: 1.25rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  font-weight: 400;
}

p {
  margin-bottom: var(--space-md);
  max-width: 65ch; /* Optimal reading width */
}

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

a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

strong {
  font-weight: 500;
}

em {
  font-style: italic;
}

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

/* Header - minimal, present */
header {
  padding: var(--space-md) var(--space-md);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper);
  transition: box-shadow var(--transition);
}

header.scrolled {
  box-shadow: 0 1px 0 var(--sand);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--stone);
}

.site-title a {
  border: none;
  color: var(--stone);
}

.site-title a:hover {
  color: var(--ink);
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-md);
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0;
}

nav a {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  border: none;
  padding: var(--space-xs) 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width var(--transition), left var(--transition);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
  left: 0;
}

nav a:hover,
nav a.active {
  color: var(--ink);
}

/* Hero - the first breath */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  position: relative;
}

/* Enso - the Zen circle, imperfect and complete */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(70vw, 500px);
  height: min(70vw, 500px);
  background-image: url('../images/enso.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.12;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 300;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--stone);
  font-weight: 300;
}

/* Main content - spacious, unhurried */
main {
  max-width: 750px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) var(--space-lg);
}

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

/* Blockquote - words that point beyond words */
blockquote {
  position: relative;
  margin: var(--space-lg) 0;
  padding: var(--space-md) 0;
  padding-left: var(--space-md);
  border-left: 1px solid var(--mist);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
}

blockquote p {
  margin-bottom: var(--space-sm);
}

blockquote cite {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--stone);
  margin-top: var(--space-sm);
}

/* The Four Questions - central to The Work */
.four-questions {
  background: var(--breath);
  padding: var(--space-lg);
  margin: var(--space-lg) calc(-1 * var(--space-md));
}

.four-questions h3 {
  text-align: center;
  font-style: italic;
  margin-bottom: var(--space-md);
}

.four-questions ol {
  list-style: none;
  padding: 0;
  counter-reset: question;
}

.four-questions li {
  counter-increment: question;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.four-questions li:last-child {
  border-bottom: none;
}

.four-questions li::before {
  content: counter(question);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--mist);
  flex-shrink: 0;
  width: 2rem;
}

/* Profile section */
.profile {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
}

.profile-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(20%);
  transition: filter var(--transition);
}

.profile-image:hover {
  filter: grayscale(0%);
}

.profile-content h1 {
  margin-top: 0;
  font-size: 2rem;
}

/* Cards - containers for offerings */
.card {
  background: var(--breath);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid transparent;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--sand);
}

.card h3 {
  margin-top: 0;
}

.card-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--stone);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-sm);
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.feature {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--sand);
}

.feature h3 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 400;
}

.feature p {
  font-size: 0.95rem;
  color: var(--stone);
  margin-bottom: 0;
}

/* Learning log entries */
.log-entry {
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--sand);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-date {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: var(--space-xs);
}

.log-entry h3 {
  margin-top: var(--space-xs);
  font-size: 1.4rem;
}

/* Document list */
.doc-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
}

.doc-list li {
  margin: 0;
}

.doc-list a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--sand);
  border-top: none;
  border-left: none;
  border-right: none;
}

.doc-list a:hover {
  border-bottom-color: var(--ink);
}

.doc-type {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--stone);
  padding: 0.2rem 0.5rem;
}

.doc-title {
  color: var(--ink);
}

/* Video wrapper */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: var(--space-md) 0;
  background: var(--ink);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--mist);
  font-style: italic;
  font-size: 0.9rem;
}

/* Contact */
.contact-centered {
  text-align: center;
  padding: var(--space-xl) 0;
}

.contact-email {
  font-size: 1.3rem;
  font-style: italic;
}

.contact-email a {
  border-bottom-width: 2px;
}

/* Button - a gentle invitation */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: var(--space-sm) var(--space-md);
  transition: background var(--transition), color var(--transition);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Footer - returning to silence */
footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid var(--sand);
}

footer p {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--mist);
  letter-spacing: 0.05em;
  max-width: none;
}

/* Page hero - smaller for interior pages */
.page-hero {
  min-height: 55vh;
  padding-top: calc(var(--space-xl) + 100px);
}

.page-hero::before {
  top: calc(50% + 160px);
}

.page-hero .hero-content {
  margin-top: 160px;
}

.page-hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

/* Avatar image for Shoyoroku page */
.avatar-intro {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.avatar-intro img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Featured image - rectangular, centered above content */
.featured-image {
  text-align: center;
  margin: 0 0 var(--space-lg) 0;
}

.featured-image img {
  width: 85%;
  height: auto;
  border-radius: 4px;
}

/* Utilities */
.text-center {
  text-align: center;
}

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

.mb-lg {
  margin-bottom: var(--space-lg);
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    flex-direction: column;
    gap: var(--space-sm);
  }

  nav ul {
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    min-height: 80vh;
  }

  .hero::before {
    width: 90vw;
    height: 90vw;
  }

  main {
    padding: var(--space-md);
  }

  .profile {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-image {
    max-width: 180px;
    margin: 0 auto;
  }

  .four-questions {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding: var(--space-md);
  }

  .avatar-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  nav a {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .hero h1 {
    font-size: 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  blockquote {
    font-size: 1rem;
  }
}

/* Scroll-triggered header shadow */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
