:root {
  --bg: #fbfbfb;
  --text: #232323;
  --link: #232323;
  --border: #cbcbcb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.page-wrap {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3.6rem;
  padding: 1.8rem 1rem 3rem;
}

.sidebar {
  position: sticky;
  top: 1.2rem;
  align-self: start;
}

.brand {
  display: inline-block;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 570;
  margin-bottom: 0.2rem;
}

.brand-subtitle {
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  line-height: 1.25;
}

.brand-logo {
  display: block;
  width: 82px;
  height: auto;
  margin-bottom: 1.4rem;
}

.nav-group {
  display: grid;
  gap: 0.32rem;
}

.nav-main {
  margin-bottom: 1.75rem;
}

.nav-group a {
  font-size: 1.2rem;
}

.content {
  padding-top: 0.1rem;
}

.text-page {
  max-width: 840px;
}

.text-page h1 {
  margin: 0 0 1.15rem;
  font-size: 1.2rem;
  font-weight: 400;
}

.text-page p {
  margin: 0 0 1rem;
  font-size: 1rem;
  max-width: 56ch;
}

.subscribe-form {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.55rem;
  max-width: 360px;
}

.subscribe-form label {
  font-size: 0.92rem;
}

.subscribe-form input[type="email"] {
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.55rem;
}

.subscribe-options {
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  margin: 0.05rem 0 0;
  display: grid;
  gap: 0.35rem;
}

.subscribe-options legend {
  font-size: 0.92rem;
  padding: 0 0.2rem;
}

.subscribe-options label {
  display: grid;
  grid-template-columns: 1rem auto;
  align-items: center;
  column-gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0;
}

.subscribe-options input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: #3a3a3a;
}

.subscribe-form button {
  width: fit-content;
  border: 1px solid var(--text);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.38rem 0.65rem;
  cursor: pointer;
}

.subscribe-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-message {
  min-height: 1.2em;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.form-message.is-success {
  color: #155724;
}

.form-message.is-error {
  color: #9a1b1b;
}

.form-note {
  margin-top: 0.7rem;
  font-size: 0.86rem;
}

.form-divider {
  margin: 1.2rem 0 1rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.form-heading {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 400;
}

.projects-page {
  max-width: none;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1.7rem 1.8rem;
}

.project-card {
  min-width: 0;
}

.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, #d7d7d7, #cfcfcf);
  margin-bottom: 0.5rem;
}

.project-thumb-image {
  object-fit: contain;
  background: #ffffff;
  padding: 0.35rem;
}

.project-thumb-coming-soon {
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #4b4b4b;
  background: #f5f5f5;
}

.project-card h2 {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.3;
}

.project-card h2 a {
  font-size: 1rem;
  font-weight: 400;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.project-modal[hidden] {
  display: none;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.project-modal__panel {
  position: relative;
  width: min(560px, 100%);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 1rem 1rem 0.9rem;
}

.project-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
}

.project-modal__panel h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
}

.project-modal__panel p {
  margin: 0;
  font-size: 0.95rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1160px) {
  .projects-grid {
    grid-template-columns: repeat(4, minmax(128px, 1fr));
  }
}

@media (max-width: 980px) {
  .page-wrap {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    padding: 1rem 1rem 2rem;
  }

  .sidebar {
    position: static;
  }

  .brand {
    margin-bottom: 1rem;
  }

  .nav-main,
  .nav-secondary {
    margin: 0.2rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .nav-group a {
    font-size: 1rem;
  }

  .text-page h1,
  .text-page p,
  .project-card h2,
  .project-card h2 a {
    font-size: 1rem;
    max-width: none;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 1.2rem;
  }
}
