/* CSS Variables */
:root {
  /* Font Sizes */
  --font-size-small: 18px;
  --font-size-medium: 20px;
  --font-size-large: 24px;
  --font-size-extra-large: 48px;

  /* Colors */
  --color-background: #fff;
  --color-background-secondary: #f1f1f1;
  --color-primary-text: #000;
  --color-secondary-text: #666;

  /* Spacing */
  --spacing-small: 12px;
  --spacing-medium: 24px;
  --spacing-large: 60px;

  /* Border Radius */
  --border-radius-small: 4px;
  --border-radius-medium: 8px;
  --border-radius-large: 16px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-medium);
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  color: var(--color-primary-text);
}

video {
  max-height: 454px;
}

body {
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-primary-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove all focus outlines globally */
button:focus,
a:focus {
  outline: none;
}

p a {
  font-weight: 600;
  text-decoration: none;
  color: var(--color-primary-text);
}

/* Container */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Bookshelf gets full width container */
.bookshelf-container {
  max-width: 100%;
  padding: 0;
  overflow: visible;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-large) 0;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.name {
  font-size: var(--font-size-large);
  font-weight: 700;
  color: #000;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: var(--font-size-small);
  font-weight: 400;
  color: #000;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 0.6;
}

/* Main Content */
.main {
  flex: 1;
}

/* Hero Section */
.hero {
  max-width: 600px;
  margin: 0 80px 80px 80px;
  text-wrap: pretty;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-title {
  font-size: var(--font-size-extra-large);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 32px;
}

.hero-description {
  font-size: var(--font-size-large);
  font-weight: 400;
  line-height: 1.5;
}

/* Projects Section */
.projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--spacing-large);
}

.project-card {
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: 0 80px;
}

.project-title {
  font-size: var(--font-size-medium);
  color: var(--color-primary-text);
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
}

.page-title {
  font-size: var(--font-size-extra-large);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s ease;
  margin-bottom: 0;
  flex: 1;
}

.project-description {
  font-size: var(--font-size-small);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Remove focus outlines */
*:focus,
*:focus-visible {
  outline: none;
}

.nav-link:focus,
.project-link:focus,
.page-title:focus {
  outline: none;
}

/* ===== PROJECT PAGE STYLES ===== */

/* Project Page Layout */
.project-main {
  flex: 1;
  padding: 60px 0;
  max-width: 1000px;
  margin: 0 auto;
}

.project-header {
  margin: 0 80px 80px 80px;
}

.project-header .page-title {
  margin-bottom: 24px;
}

.project-section {
  margin-bottom: 80px;
}

.section-header {
  font-size: var(--font-size-large);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 80px 4px 80px;
}

.section-text {
  font-size: var(--font-size-medium);
  font-weight: 400;
  line-height: 1.7;
  margin: 0 80px 32px 80px;
}

.section-list {
  font-size: var(--font-size-medium);
  font-weight: 400;
  line-height: 1.7;
  margin: 32px 0;
  padding-left: 24px;
}

.section-list li {
  margin-bottom: 16px;
}

/* Project Images */
.project-image-full {
  width: 100%;
  height: auto;
  max-height: 454px;
  object-fit: contain;
  display: block;
  border-radius: var(--border-radius-large);
}

.project-image-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--color-background-secondary);
  border-radius: var(--border-radius-large);
}

.project-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: var(--spacing-medium) 0;
  background-color: var(--color-background-secondary);
  border-radius: var(--border-radius-large);
}

.project-image-grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin: var(--spacing-large) 0;
  background-color: var(--color-background-secondary);
  border-radius: var(--border-radius-large);
}

.project-image-grid-item {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: var(--border-radius-large);
}

.project-image-placeholder {
  width: 100%;
  min-height: 300px;
  background-color: #f5f5f5;
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--spacing-large) 0;
  border-radius: var(--border-radius-large);
}

.project-image-grid .project-image-placeholder {
  margin: 0;
  min-height: 200px;
}

.image-caption {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-secondary-text);
  text-align: center;
  font-style: italic;
  margin-bottom: 0;
}

/* Project Navigation */
.project-navigation {
  margin-top: 120px;
  padding-top: 60px;
  border-top: 1px solid #f0f0f0;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
}

.project-nav-card {
  display: block;
  padding: 32px 24px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.project-nav-card:hover {
  border-color: #000;
  transform: translateY(-2px);
}

.nav-card-title {
  font-size: 24px;
  font-weight: 400;
  color: #000;
  margin-bottom: 12px;
}

.nav-card-link {
  font-size: 16px;
  font-weight: 500;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ===== BOOKSHELF PAGE STYLES ===== */

/* Bookshelf Main Layout */
.bookshelf-main {
  flex: 1;
  padding: 40px 0;
  max-width: 100%;
  margin: 0 auto;
  width: 100%; /* Allow full width */
  overflow: visible;
}

.bookshelf-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.bookshelf-title-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  text-align: left;
}

.view-toggles {
  display: flex;
  gap: 8px;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 4px;
  position: relative;
}

.view-toggle-indicator {
  position: absolute;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.view-toggle {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-secondary-text);
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.2s ease;
  border-radius: 6px;
  min-width: 80px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle img {
  width: 32px;
  height: 32px;
  display: block;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.view-toggle:hover {
  color: #000;
}

.view-toggle:hover img {
  opacity: 1;
}

.view-toggle.active {
  color: #000;
}

.view-toggle.active img {
  opacity: 1;
}

.view-toggle:focus {
  outline: none;
}

.bookshelf-description {
  font-size: var(--font-size-medium);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-secondary-text);
  margin-bottom: 32px;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
  text-align: center;
  padding: 120px 0;
  color: var(--color-secondary-text);
}

.loading-state p,
.empty-state p {
  font-size: var(--font-size-medium);
}

/* Grid View (covers only) */
.grid-covers-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-covers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.grid-cover-item {
}

.grid-cover-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  aspect-ratio: 2/3;
  display: block;
}

/* Text List View */
.text-list-container {
  max-width: 600px;
  margin: 0 auto;
}

.text-list-year-section {
  margin-bottom: 48px;
}

.text-list-year-header {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: #000;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.text-list-book {
  margin-bottom: 16px;
  line-height: 1.6;
}

.text-list-book-title {
  font-size: 18px;
  font-weight: 500;
  color: #000;
}

.text-list-book-author {
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: var(--color-secondary-text);
}

.text-list-book-rating {
  font-size: 16px;
  color: #000;
  letter-spacing: 1px;
  margin-left: 8px;
}

/* Vertical Covers View */
.vertical-covers-container {
  max-width: 600px;
  margin: 0 auto;
}

.vertical-covers-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vertical-cover-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
}

.vertical-cover-image {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.vertical-cover-info {
  flex: 1;
  min-width: 0;
}

.vertical-cover-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: #000;
  margin-bottom: 4px;
}

.vertical-cover-author {
  font-size: 16px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: var(--color-secondary-text);
  margin-bottom: 8px;
}

.vertical-cover-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.vertical-cover-rating {
  font-size: 14px;
  color: #000;
  letter-spacing: 1px;
}

.vertical-cover-date {
  font-size: 14px;
  color: #999;
}

/* ===== WORK HISTORY STYLES ===== */

.work-item {
  display: flex;
  align-items: center;
  margin: 16px 80px 0px 80px;
}

.work-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.work-link:hover {
  opacity: 0.6;
}

.work-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-medium);
  object-fit: contain;
  flex-shrink: 0;
}

.work-logo.border {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;
}

.work-company {
  font-size: var(--font-size-medium);
  font-weight: 400;
  color: var(--color-primary-text);
}

.work-dates {
  font-size: var(--font-size-small);
  font-weight: 400;
  color: var(--color-secondary-text);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  margin-left: auto;
}
