@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Newsreader:ital,opsz,wght@0,6..72,400;1,6..72,400&display=swap');

:root {
  --background: hsl(40, 18%, 94%);
  --foreground: hsl(25, 15%, 10%);
  --paper: hsl(40, 22%, 90%);
  --paper-edge: hsl(30, 12%, 78%);
  --ink: hsl(25, 18%, 8%);
  --ink-muted: hsl(25, 10%, 38%);
  --accent-hot: hsl(8, 78%, 48%);
}

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

body {
  background-color: var(--background);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: "ss01", "ss02";
  min-height: 100vh;
  min-height: 100dvh;
}

::selection {
  background: var(--accent-hot);
  color: var(--background);
}

header {
  border-bottom: 1px solid var(--ink);
  padding: 2.5rem 1.25rem;
  background-image: url('assets/background/background.jpg');
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  min-height: 300px;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 640px) {
  header {
    padding: 5rem 2rem;
    flex-wrap: nowrap;
    min-height: 400px;
    gap: 3rem;
  }
}

.logo {
  display: block;
  width: 220px;
  height: auto;
  object-fit: contain;
  margin-top: -6px;
}

@media (max-width: 639px) {
  .logo {
    width: 100%;
    max-width: 200px;
  }
}

.note-container {
  flex: 0 0 auto;
  margin-right: auto;
  max-width: 100%;
}

.note-container p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .note-container p {
    font-size: 1.125rem;
    line-height: 1.625;
  }
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--ink);
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
  }
}

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

.grid-button {
  background: none;
  border: none;
  cursor: pointer;
  display: block;
  padding: 0;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s ease;
}

.grid-button:hover {
  border-color: transparent;
  opacity: 0.9;
}

.image-wrapper {
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  width: 100%;
  aspect-ratio: auto;
}

.image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.7s cubic-bezier(0, 0, 0.2, 1);
}

.grid-button:hover img {
  transform: scale(1.03);
}

dialog {
  margin: auto;
  border: 1px solid var(--ink);
  background-color: var(--background);
  color: var(--ink);
  padding: 1rem;
  width: 92vw;
  max-width: 900px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 65vh;
  max-height: 65dvh;
  object-fit: contain;
}

.lightbox-controls {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.lightbox-controls button {
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  min-width: 70px;
  font-family: inherit;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-controls button:active,
.lightbox-controls button:hover {
  background: var(--ink);
  color: var(--background);
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  flex: 1;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .header-content {
    flex-direction: row;
    gap: 3rem;
    padding: 0 3rem;
  }
}

@media (min-width: 640px) {
  .note-container {
    max-width: 60%;
  }
}