@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --green: #12372a;
  --ivory: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.6);
  --pad: clamp(24px, 3.4vw, 58px);
  --spine: 47%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ivory);
  background: var(--green);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page {
  min-height: 100vh;
  padding: 0 var(--pad);
  display: grid;
  grid-template-rows: auto 1fr clamp(220px, 29vh, 340px);
}

.masthead {
  min-height: 100px;
  display: grid;
  grid-template-columns: var(--spine) 1fr auto;
  align-items: center;
}

.nav-panel { display: contents; }

.brand {
  display: block;
  width: 120px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  display: flex;
  gap: clamp(18px, 2.3vw, 40px);
}

.nav span,
.project-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}

.nav-separator {
  opacity: 0.5;
}

.project-link {
  margin-left: clamp(30px, 7vw, 130px);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero {
  display: grid;
  grid-template-columns: var(--spine) minmax(0, 650px) 1fr;
  grid-template-rows: auto 1fr;
  align-content: center;
  min-height: 430px;
  padding: clamp(42px, 7vh, 94px) 0 clamp(48px, 8vh, 104px);
}

h1 {
  grid-column: 2 / 4;
  margin: 0 0 clamp(60px, 10vh, 124px);
  max-width: 850px;
  font-size: clamp(42px, 4.25vw, 68px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.caption,
.intro { margin: 0; }

.caption {
  align-self: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.intro {
  overflow-wrap: break-word;
  max-width: 640px;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.42;
  letter-spacing: -0.022em;
}

.artwork {
  position: relative;
  overflow: hidden;
  width: calc(100% + (var(--pad) * 2));
  margin-left: calc(var(--pad) * -1);
  min-height: 220px;
  background: #8b8b8b url("bg.png") center center / cover no-repeat;
}

.artwork::before,
.artwork::after {
  content: none;
}

.artwork__grain {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-page {
  min-height: 100vh;
  padding: 0 var(--pad);
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--ivory);
}

.dashboard-header {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-brand {
  display: block;
  width: 120px;
  text-decoration: none;
}

.dashboard-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.dashboard-close {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ivory);
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.dashboard-close span,
.dashboard-close span::before {
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
}

.dashboard-close span {
  transform: rotate(45deg);
}

.dashboard-close span::before {
  content: "";
  transform: rotate(90deg);
}

.dashboard-close:hover,
.dashboard-close:focus-visible {
  color: #d9d5cc;
}

.dashboard-close:active {
  transform: translateY(1px) scale(0.96);
}

.login-panel {
  width: min(100%, 390px);
  align-self: center;
  justify-self: center;
  padding-bottom: clamp(28px, 8vh, 90px);
}

.login-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.login-panel h1 {
  margin: 0 0 38px;
  max-width: none;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.login-form input,
.login-form select,
.login-form button {
  width: 100%;
  min-height: 48px;
  color: var(--ivory);
  border: 1px solid rgba(245, 241, 232, 0.35);
  border-radius: 0;
  font: inherit;
  font-size: 14px;
}

.login-form input,
.login-form select {
  padding: 0 14px;
  background: rgba(245, 241, 232, 0.04);
  outline: none;
}

.login-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.login-form select option {
  color: var(--green);
  background: var(--ivory);
}

.login-form input::placeholder {
  color: rgba(245, 241, 232, 0.35);
}

.login-form input:focus,
.login-form select:focus {
  border-color: rgba(245, 241, 232, 0.75);
}

.login-form input.is-invalid,
.login-form select.is-invalid {
  border-color: #f2a7a7;
  box-shadow: inset 0 -2px 0 #f2a7a7;
}

.field-error,
.login-error {
  margin: 8px 0 0;
  color: #f2a7a7;
  font-size: 12px;
  line-height: 1.35;
}

.field-error {
  margin-top: -2px;
}

.login-form button {
  margin-top: 18px;
  background: var(--ivory);
  color: var(--green);
  border-color: var(--ivory);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.login-form button:hover,
.login-form button:focus-visible {
  background: #d9d5cc;
  color: var(--green);
  border-color: #d9d5cc;
}

.login-form button:active {
  transform: translateY(1px);
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.75;
}

@media (max-width: 980px) {
  :root { --spine: 0%; }
  .page { grid-template-rows: auto auto minmax(230px, 32vh); }

  .masthead {
    min-height: 100px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 12px;
    padding: 18px 0;
  }

  .nav-panel {
    display: contents;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 10px;
  }

  .nav span {
    min-height: 24px;
    font-size: 12px;
  }

  .project-link {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    font-size: 12px;
  }

  .hero { display: block; min-height: 0; padding: clamp(38px, 7vw, 68px) 0 clamp(52px, 9vw, 82px); }
  h1 { margin-bottom: clamp(46px, 8vw, 72px); font-size: clamp(38px, 7.2vw, 58px); }
  .caption { margin-bottom: 28px; }
  .intro { font-size: 17px; }
}

@media (max-width: 480px) {
  :root { --pad: 18px; }

  .page {
    grid-template-rows: auto auto minmax(210px, 30vh);
  }

  .masthead {
    min-height: 88px;
  }

  .dashboard-header {
    min-height: 88px;
  }

  .brand { width: 120px; }

  .hero {
    padding: 32px 0 48px;
  }

  h1 {
    margin-bottom: 44px;
    font-size: clamp(32px, 9.8vw, 42px);
    line-height: 1.01;
    letter-spacing: -0.045em;
  }

  .caption {
    margin-bottom: 24px;
    font-size: 12px;
  }

  .intro {
    font-size: 16px;
    line-height: 1.48;
  }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
