*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f6f4f0;
  --card-bg: #fefcf8;
  --card-border: rgba(28, 27, 25, 0.1);
  --text: #1c1b19;
  --muted: #5c5a56;
  --accent: #2a4a3a;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --space-xs: 0.35rem;
  --space-sm: 0.65rem;
  --space-md: 1.1rem;
  --space-lg: 1.75rem;
  --space-xl: 2.25rem;
  --line: 1.6;
  --measure: 42rem;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: var(--line);
  color: var(--text);
  background: var(--bg);
}

body.home {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.home .page {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

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

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

@media (max-width: 480px) {
  .page {
    padding: var(--space-lg) var(--space-sm) var(--space-md);
  }
}

/* Intro */

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

.greeting {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--muted);
  line-height: var(--line);
}

.name {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

/* Sections */

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

.block:last-of-type {
  margin-bottom: var(--space-lg);
}

.lead {
  margin: 0 0 var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.text {
  margin: 0;
}

/* Lists */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list > li + li {
  margin-top: var(--space-md);
}

.list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

.list--inline > li + li {
  margin-top: 0;
}

.list--social {
  gap: var(--space-md);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
}

.social-link:hover {
  color: var(--accent);
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Project cards */

.list--projects {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.list--projects > li + li {
  margin-top: 0;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.75rem;
  height: 4.75rem;
  padding: var(--space-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: rgba(42, 74, 58, 0.25);
  box-shadow: 0 2px 12px rgba(28, 27, 25, 0.04);
}

.project-card__media {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

.project-card__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.project-card--placeholder {
  cursor: default;
}

.project-card__ellipsis {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.project-card--placeholder:hover {
  border-color: var(--card-border);
  box-shadow: none;
}

.project-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  max-width: 14rem;
  padding: 0.55rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(28, 27, 25, 0.08);
}

.project-tooltip__name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--text);
}

.project-tooltip__desc {
  margin: 0.3rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.45;
  color: var(--muted);
}

/* Footer */

.footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(28, 27, 25, 0.08);
}

.footer p {
  margin: 0 0 var(--space-sm);
  font-size: 0.95rem;
  color: var(--muted);
  line-height: var(--line);
}

.footer p:last-child {
  margin-bottom: 0;
}

.footer a {
  color: var(--text);
}

/* Project pages */

.page--project {
  padding-top: var(--space-lg);
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

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

.project-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  color: var(--text);
}

.project-tagline {
  margin: var(--space-xs) 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.project-status {
  color: var(--muted);
}

.project-image {
  margin: 0 0 var(--space-lg);
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: transparent;
}

.project-intro {
  display: grid;
  grid-template-columns: 1fr 9.5rem;
  gap: var(--space-md);
  align-items: start;
  margin-bottom: var(--space-xl);
}

.project-intro__content .text:first-child {
  margin-top: 0;
}

.project-intro__content .lead {
  margin-top: var(--space-md);
}

.project-intro__media {
  margin: 0;
}

.project-intro__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: transparent;
}

@media (max-width: 560px) {
  .project-intro {
    grid-template-columns: 1fr;
  }

  .project-intro__media {
    max-width: 10rem;
  }
}

.meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-list li {
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
  color: var(--text);
}

.meta-label {
  display: inline-block;
  min-width: 5.5rem;
  margin-right: var(--space-sm);
  color: var(--muted);
}

.content-list {
  margin: var(--space-sm) 0 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
  color: var(--text);
}

.content-list li + li {
  margin-top: var(--space-xs);
}

.content-list--ordered {
  padding-left: 1.4rem;
}

.content-list strong {
  font-weight: 500;
}

.text + .text,
.text + .content-list,
.content-list + .text {
  margin-top: var(--space-sm);
}

.text--emphasis {
  color: var(--muted);
}

.text code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: rgba(28, 27, 25, 0.06);
}
