* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: #fff;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 2.5rem 1.5rem;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.25rem;
  flex-wrap: wrap;
}

nav a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  font-weight: 400;
  transition: color 0.15s ease;
}

nav a:hover {
  color: #666;
}

nav a.nav-icon {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0;
}

nav a.nav-icon svg {
  display: block;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  flex: 1;
}

/* Show only one section at a time; projects shown on root (sararutz.ch) */
section {
  padding: 1rem 0 4rem;
  display: none;
}

#projects,
#teaching {
  display: block;
}

#writing:target,
#inspiration:target,
#about:target {
  display: block;
}

body:has(#writing:target) #projects,
body:has(#writing:target) #inspiration,
body:has(#writing:target) #about {
  display: none;
}

body:has(#projects:target) #writing,
body:has(#projects:target) #inspiration,
body:has(#projects:target) #about {
  display: none;
}

body:has(#inspiration:target) #writing,
body:has(#inspiration:target) #projects,
body:has(#inspiration:target) #about {
  display: none;
}

body:has(#about:target) #writing,
body:has(#about:target) #projects,
body:has(#about:target) #inspiration {
  display: none;
}

section h1 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
  margin-bottom: 2.25rem;
}

section p {
  color: #555;
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Inspiration – non-linear by chance */
.inspiration-items {
  margin-top: 0.5rem;
}

.inspiration-item {
  margin-bottom: 1.5rem;
}

.inspiration-quote {
  font-size: 1rem;
  font-style: italic;
  color: #333;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid #ddd;
}

.inspiration-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}

.inspiration-quote cite a {
  color: #1a1a1a;
  text-decoration: none;
}

.inspiration-quote cite a:hover {
  text-decoration: underline;
}

.inspiration-book {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inspiration-book-icon {
  font-size: 1.25rem;
}

.inspiration-book-title {
  font-size: 0.9375rem;
  color: #1a1a1a;
  font-style: italic;
}

.inspiration-intro {
  margin-bottom: 1.5rem;
}

/* Writing entry */
.writing-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.writing-list li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.writing-list a {
  color: #1a1a1a;
  text-decoration: underline;
}

.writing-list a:hover {
  color: #666;
}

/* Expandable writing entries */
.writing-expand {
  list-style: none;
}

.writing-expand summary {
  cursor: pointer;
  color: #1a1a1a;
  text-decoration: underline;
  list-style: none;
}

.writing-expand summary::-webkit-details-marker {
  display: none;
}

.writing-expand summary::marker {
  content: "";
}

.writing-expand summary:hover {
  color: #666;
}

.writing-expand[open] summary {
  text-decoration: none;
}

.writing-expand-content {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid #eee;
  border-radius: 8px;
  max-width: 640px;
  line-height: 1.75;
}

.writing-expand-content p {
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
  color: #444;
}

.writing-expand-content p:last-child {
  margin-bottom: 0;
}

.writing-entry {
  margin-top: 0;
}

.writing-images {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.writing-images img {
  max-width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.writing-entry h2 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.writing-meta {
  font-size: 0.8125rem;
  color: #888;
  margin-bottom: 0.875rem;
  letter-spacing: 0.01em;
}

.writing-entry > p {
  margin-bottom: 0.25rem;
}

.writing-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.875rem;
  margin-top: 1rem;
  transition: color 0.2s ease;
}

.writing-link::after {
  content: "→";
  display: inline-block;
  transition: transform 0.2s ease;
}

.writing-link:hover {
  color: #666;
}

.writing-link:hover::after {
  transform: translateX(3px);
}

/* About photo */
.about-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 0.5rem;
}

.about-photo {
  width: 180px;
  min-width: 180px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.about-bio {
  max-width: 480px;
  margin: 0;
}

@media (max-width: 600px) {
  .about-intro {
    flex-direction: column;
    gap: 1.25rem;
  }
  .about-photo {
    width: 100%;
    max-width: 240px;
  }
}

/* CV section – matches bio / section design */
.cv-section {
  margin-top: 2.5rem;
  max-width: 480px;
}

.cv-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.5rem;
}

.cv-intro {
  font-size: 0.9375rem;
  color: #555;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.cv-block {
  margin-bottom: 0;
}

.cv-block-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.75rem;
}

.cv-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
}

.cv-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.cv-year {
  font-weight: 500;
  color: #333;
  flex-shrink: 0;
  min-width: 5.5rem;
}

.cv-desc {
  color: #555;
  flex: 1;
  min-width: 0;
}

.cv-section a {
  color: #1a1a1a;
  text-decoration: none;
}

.cv-section a:hover {
  text-decoration: underline;
}

.cv-sep {
  border: none;
  border-top: 1px solid #eee;
  margin: 1.5rem 0;
}

/* Projects intro card */
.projects-intro-card {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  background: #fff;
}

.projects-intro-photo {
  flex-shrink: 0;
  width: 80px;
  min-width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
}

.projects-intro-photo img {
  width: 80px;
  height: 80px;
  max-width: 80px;
  object-fit: cover;
  display: block;
}

.projects-intro-text {
  line-height: 1.7;
}

.projects-intro-text p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: #444;
}

.projects-intro-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .projects-intro-card {
    flex-direction: column;
    align-items: center;
    text-align: left;
    padding: 1.25rem;
  }

  .projects-intro-photo {
    width: 72px;
    height: 72px;
  }
}

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-top: 0.5rem;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

.project-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ebeae8;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.04);
}

.project-card-content {
  padding: 1.35rem 1.35rem 1.5rem;
}

.project-card h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #1a1a1a;
}

.project-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a5a5a;
  background: #f0efec;
  padding: 0.4em 0.7em;
  border-radius: 6px;
  margin-right: 0.5rem;
  margin-bottom: 0.35rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-card:hover .project-tag {
  background: #e8e6e2;
  color: #444;
}

/* Project detail page */
.project-detail {
  padding-top: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #666;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}

.back-link::before {
  content: "←";
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-link:hover {
  color: #1a1a1a;
}

.back-link:hover::before {
  transform: translateX(-3px);
}

.project-detail article {
  padding-bottom: 4rem;
}

.project-detail-image {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.project-detail h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.project-meta {
  font-size: 0.8125rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.project-team {
  font-size: 0.9375rem;
  color: #555;
  margin-bottom: 1rem;
}

.project-quote {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #555;
  margin: 1.5rem 0 1rem;
  padding-left: 1rem;
  border-left: 2px solid #ddd;
  font-style: italic;
  line-height: 1.6;
}

.project-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.875rem;
  font-weight: 400;
  color: #666;
  margin-top: 0.5rem;
}

.project-detail article h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  letter-spacing: -0.01em;
}

.project-detail-images {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.project-detail-images img {
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border-radius: 4px;
}

.project-detail article > p {
  color: #555;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-top: 2rem;
  border-radius: 4px;
  overflow: hidden;
}

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

/* Footer */
.site-footer {
  background: #fff;
  color: #1a1a1a;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  margin-top: auto;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-footer a {
  color: #1a1a1a;
  text-decoration: none;
}

.site-footer a:hover {
  color: #555;
  text-decoration: underline;
}

/* Project detail enhancements */
.project-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #333;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.project-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: 1px solid #ddd;
  color: #1a1a1a;
  background: #fff;
}

.project-btn:hover {
  border-color: #bbb;
  background: #f5f5f5;
}

.project-btn-primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.project-btn-primary:hover {
  background: #333;
  border-color: #333;
}

.project-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 2.5rem 0;
}

/* Teaching page */
.teaching-entry {
  margin-bottom: 0;
}

.teaching-entry h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.teaching-meta {
  font-size: 0.8125rem;
  color: #888;
  margin-bottom: 0.875rem;
  letter-spacing: 0.01em;
}

.teaching-entry > p {
  color: #555;
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.teaching-images {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.teaching-images img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
