/* Between Chaos and Calm — site styles */

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

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

@supports (padding: max(0px)) {
  body, .site-header, .site-footer {
    padding-left: min(0vmin, env(safe-area-inset-left));
    padding-right: min(0vmin, env(safe-area-inset-right));
  }
}

:root {
  --color-bg: #efe8db;
  --color-ink: #201d18;
  --color-muted: #6f6a5e;
  --color-accent: #b1502f;
  --color-border: #ddd1bc;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 1rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 2.5rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  min-width: 0;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.header-links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.95rem;
}

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

/* Hero */

.hero {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}

.hero-image {
  flex: 1 1 560px;
  min-width: 0;
  display: block;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-info {
  flex: 1 1 320px;
  position: relative;
  min-height: 280px;
}

.hero-title {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  right: 1.5rem;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

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

.hero-links {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 500;
}

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

@media (min-width: 900px) {
  .hero-image {
    flex: 0 1 50%;
  }
  .hero-info {
    flex: 1 1 0;
    min-width: 300px;
    min-height: 420px;
  }
  .hero-title {
    left: 3rem;
    right: 3rem;
    font-size: 2.25rem;
  }
  .hero-links {
    left: 3rem;
    right: 3rem;
    bottom: 120px;
  }

  /* Non-square paintings are allowed to claim more than half the hero */
  .hero-image--wide {
    flex-basis: 60%;
  }
  .hero-image--panoramic {
    flex-basis: 72%;
  }
}

/* Works grid */

.works {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.work-item {
  overflow: hidden;
  display: block;
}

.work-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.work-item:hover img {
  transform: scale(1.03);
}

@media (min-width: 560px) {
  .works-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 800px) {
  .works-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1100px) {
  .works-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1400px) {
  .works-grid { grid-template-columns: repeat(6, 1fr); }
}

/* About */

.about {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}

.about-text {
  flex: 1 1 400px;
}

.about-text h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.about-text p {
  max-width: 40ch;
  line-height: 1.6;
  color: var(--color-ink);
}

.about-links {
  flex: 1 1 320px;
}

.about-links a {
  display: block;
  padding: 0.9rem 0;
  border-top: 1px solid var(--color-border);
}

.about-links a:last-child {
  border-bottom: 1px solid var(--color-border);
}

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

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.site-footer .footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
}
