@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600&family=Newsreader:opsz,wght@6..72,300;6..72,400&display=swap');

:root {
  --ink: #191a17;
  --paper: #f1f0ea;
  --soft: #e6e4dc;
  --line: #cbc9bf;
  --muted: #67685f;
  --accent: #bc4b2f;
  --white: #faf9f5;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.wordmark {
  color: var(--ink); font-size: .78rem; font-weight: 600; letter-spacing: .16em;
  text-decoration: none; text-transform: uppercase;
}
.wordmark.quiet { color: var(--muted); }
.eyebrow {
  color: var(--accent); font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  margin: 0 0 1rem; text-transform: uppercase;
}
.button {
  align-items: center; border: 1px solid; cursor: pointer; display: inline-flex; font-size: .76rem;
  font-weight: 600; justify-content: center; letter-spacing: .04em; min-height: 3rem;
  padding: .75rem 1.2rem; text-decoration: none; text-transform: uppercase;
}
.button-dark { background: var(--ink); border-color: var(--ink); color: var(--white); }
.button-dark:hover { background: var(--accent); border-color: var(--accent); }
.button-light { border-color: var(--line); background: transparent; }
.button-light:hover { border-color: var(--ink); }
.text-button { background: none; border: 0; color: var(--ink); cursor: pointer; padding: .25rem; text-decoration: underline; text-underline-offset: .25rem; }
.text-button.danger { color: #9c321f; }
.form-message { color: var(--muted); font-size: .78rem; margin: 0; }
.form-message.error { color: #a12e1a; }
.form-message.success { color: #2c6a44; }

/* Public portfolio */
.loading-screen {
  align-items: center; display: flex; flex-direction: column; inset: 0; justify-content: center;
  min-height: 100vh; position: fixed;
}
.loading-screen p { color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }
.empty-state {
  display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(20rem, 2fr); grid-template-rows: 1fr auto;
  min-height: 100vh; padding: 2rem 3rem;
}
.empty-state > div { align-self: center; max-width: 760px; padding: 7rem 0; }
.empty-state h1, .login-panel h1, .studio-intro h1 {
  font-family: var(--serif); font-size: clamp(4rem, 9vw, 8.5rem); font-weight: 300;
  letter-spacing: -.055em; line-height: .82; margin: 0;
}
.empty-state .intro { color: var(--muted); font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; margin: 2rem 0; max-width: 34rem; }
.artist-finder { align-self: end; border-top: 1px solid var(--line); grid-column: 2; padding-top: 1.25rem; }
.artist-finder label, .login-panel label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .08em; margin-bottom: .6rem; text-transform: uppercase; }
.finder-row { display: flex; }
.finder-row input { background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; flex: 1; min-width: 0; outline: none; padding: .8rem 0; }
.finder-row button { background: transparent; border: 0; border-bottom: 1px solid var(--ink); cursor: pointer; font-size: .78rem; font-weight: 600; padding: .8rem 0 .8rem 1rem; text-transform: uppercase; }
.finder-row .button-dark { background: var(--ink); border: 1px solid var(--ink); color: var(--white); padding: .75rem 1.2rem; }
.finder-row .button-dark:hover { background: var(--accent); border-color: var(--accent); }

.artist-header {
  align-items: start; display: grid; grid-template-columns: 1fr 2fr 1fr; min-height: 72vh;
  padding: 2rem 3rem 4rem;
}
.artist-heading { align-self: center; }
.artist-heading h1 {
  font-family: var(--serif); font-size: clamp(4.5rem, 10vw, 10rem); font-weight: 300;
  letter-spacing: -.06em; line-height: .78; margin: 0 0 1.5rem; overflow-wrap: anywhere;
}
.artist-location { color: var(--muted); font-family: var(--serif); font-size: 1.2rem; margin: 0; }
.artist-header nav { display: flex; gap: 2rem; justify-self: end; }
.artist-header nav a { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.artist-header nav a:hover { color: var(--accent); }

.work-section { background: var(--ink); color: var(--white); padding: 6rem 3rem 8rem; }
.section-heading { align-items: end; display: grid; grid-template-columns: 1fr 2fr 1fr; margin-bottom: 5rem; }
.section-heading .eyebrow { align-self: start; }
.section-heading h2 { font-family: var(--serif); font-size: clamp(4rem, 8vw, 7.5rem); font-weight: 300; letter-spacing: -.05em; line-height: .8; margin: 0; }
.work-count { color: #97988f; font-family: var(--mono); font-size: .7rem; justify-self: end; text-transform: uppercase; }
.gallery { display: grid; gap: 7rem 2rem; grid-template-columns: repeat(12, 1fr); }
.work-card { grid-column: span 5; }
.work-card:nth-child(3n + 2) { grid-column: 7 / span 6; margin-top: 12rem; }
.work-card:nth-child(3n) { grid-column: 2 / span 7; }
.work-card.featured { grid-column: 2 / span 10; }
.work-open { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: left; width: 100%; }
.work-media { aspect-ratio: 4 / 5; background: #292a26; overflow: hidden; }
.featured .work-media { aspect-ratio: 16 / 9; }
.work-media img { display: block; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); width: 100%; }
.work-open:hover .work-media img { transform: scale(1.018); }
.work-placeholder { align-items: center; color: #555650; display: flex; font-family: var(--serif); font-size: 10rem; justify-content: center; }
.work-caption { align-items: baseline; border-top: 1px solid #44453f; display: flex; justify-content: space-between; margin-top: 1rem; padding-top: .85rem; }
.work-caption h3 { font-family: var(--serif); font-size: 1.65rem; font-weight: 300; margin: 0; }
.work-caption p { color: #a5a69e; font-family: var(--mono); font-size: .65rem; margin: 0; text-align: right; text-transform: uppercase; }
.no-work { color: #a5a69e; font-family: var(--serif); font-size: 2rem; text-align: center; }

.about-section { display: grid; gap: 4rem; grid-template-columns: 1fr 2fr 1fr; padding: 9rem 3rem; }
.about-section > div:first-child { grid-column: 2; }
.about-section h2 { font-family: var(--serif); font-size: clamp(3.5rem, 7vw, 7rem); font-weight: 300; letter-spacing: -.05em; line-height: .85; margin: 0; }
.about-copy { grid-column: 2 / span 2; }
.about-copy > p { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.8rem); line-height: 1.25; margin: 0 0 5rem; white-space: pre-line; }
.about-copy dl, .dialog-copy dl { border-top: 1px solid var(--line); margin: 0; }
.about-copy dl div, .dialog-copy dl div { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 11rem 1fr; padding: .9rem 0; }
.about-copy dt, .dialog-copy dt { color: var(--muted); font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.about-copy dd, .dialog-copy dd { font-family: var(--serif); font-size: 1.1rem; margin: 0; }
.portfolio-footer { border-top: 1px solid var(--line); display: flex; font-size: .68rem; justify-content: space-between; letter-spacing: .06em; margin: 0 3rem; padding: 1.5rem 0 3rem; text-transform: uppercase; }
.portfolio-footer p { margin: 0; }

.work-dialog { background: var(--paper); border: 0; height: 100%; max-height: none; max-width: none; padding: 0; width: 100%; }
.work-dialog::backdrop { background: rgba(0,0,0,.65); }
.dialog-close { background: var(--paper); border: 1px solid var(--line); cursor: pointer; font-size: .68rem; letter-spacing: .08em; padding: .75rem 1rem; position: fixed; right: 1.5rem; text-transform: uppercase; top: 1.5rem; z-index: 2; }
#dialog-content { display: grid; grid-template-columns: 3fr 2fr; min-height: 100vh; }
.dialog-images { background: var(--ink); padding: 4rem; }
.dialog-images:empty { display: none; }
.dialog-images img { display: block; height: auto; margin-bottom: 2rem; width: 100%; }
.dialog-copy { align-self: start; padding: 8rem 4rem 5rem; position: sticky; top: 0; }
.dialog-copy h2 { font-family: var(--serif); font-size: clamp(3rem, 6vw, 6rem); font-weight: 300; letter-spacing: -.05em; line-height: .85; margin: 0 0 1.5rem; }
.dialog-meta { color: var(--muted); font-family: var(--mono); font-size: .7rem; line-height: 1.6; text-transform: uppercase; }
.dialog-story { font-family: var(--serif); font-size: 1.35rem; line-height: 1.5; margin: 4rem 0; white-space: pre-line; }

/* Studio */
.studio-header { align-items: center; display: flex; justify-content: space-between; padding: 2rem 3rem; }
.session-info { color: var(--muted); display: flex; font-size: .72rem; gap: 1rem; }
.studio-main { margin: 0 auto; max-width: 1240px; padding: 2rem 3rem 8rem; }
.studio-boot { color: var(--muted); font-family: var(--serif); font-size: 1.25rem; padding: 20vh 0; text-align: center; }
.login-panel { margin: 13vh auto 0; max-width: 800px; }
.login-panel > p:not(.eyebrow) { color: var(--muted); font-family: var(--serif); font-size: 1.35rem; line-height: 1.45; margin: 2.5rem 0; max-width: 34rem; }
.login-panel form { margin-top: 4rem; max-width: 34rem; }
.login-panel .finder-row .button { margin-left: 1rem; }
.studio-intro { align-items: end; display: grid; gap: 4rem; grid-template-columns: 2fr 1fr; min-height: 55vh; padding: 4rem 0 6rem; }
.studio-intro h1 { font-size: clamp(4rem, 8vw, 8rem); }
.studio-actions { padding-bottom: .5rem; }
.studio-actions p { color: var(--muted); font-family: var(--serif); font-size: 1.1rem; line-height: 1.5; margin: 0 0 2rem; }
.studio-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 2rem; margin-bottom: 5rem; }
.studio-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-size: .72rem; font-weight: 600; letter-spacing: .08em; padding: 1rem 0; text-transform: uppercase; }
.studio-tabs button.active { border-bottom-color: var(--accent); color: var(--ink); }
.studio-panel { display: none; }
.studio-panel.active { display: block; }
.panel-heading { display: grid; gap: 2rem; grid-template-columns: 5rem 1fr; margin-bottom: 4rem; }
.panel-heading > span { color: var(--accent); font-family: var(--mono); font-size: .72rem; }
.panel-heading h2 { font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 300; letter-spacing: -.045em; line-height: .9; margin: 0; }
.panel-heading p { color: var(--muted); font-family: var(--serif); font-size: 1.1rem; }
.editor-form { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; margin-left: 7rem; max-width: 900px; }
.field.full, .form-actions { grid-column: 1 / -1; }
.field label { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; margin-bottom: .6rem; text-transform: uppercase; }
.field input, .field textarea, .field select { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); outline: none; padding: .75rem 0; resize: vertical; width: 100%; }
.field textarea { border: 1px solid var(--line); padding: 1rem; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field small { color: var(--muted); display: block; font-size: .68rem; margin-top: .5rem; }
.form-actions { align-items: center; display: flex; gap: 1rem; margin-top: 1rem; }
.image-previews { display: grid; gap: 1rem; margin-top: 1rem; }
.image-preview { align-items: center; border: 1px solid var(--line); display: grid; gap: 1rem; grid-template-columns: 6rem 1fr; padding: .75rem; }
.image-preview img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.published-work { border-top: 1px solid var(--line); margin: 8rem 0 0 7rem; padding-top: 2rem; }
.published-heading { align-items: baseline; display: flex; justify-content: space-between; }
.published-heading h2 { font-family: var(--serif); font-size: 2.5rem; font-weight: 300; }
.published-heading span { color: var(--muted); font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.published-item { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 1.5rem; grid-template-columns: 6rem 1fr auto; padding: 1rem 0; }
.published-thumb { aspect-ratio: 1; background: var(--soft); }
.published-thumb img { height: 100%; object-fit: cover; width: 100%; }
.published-item h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; margin: 0; }
.published-item p { color: var(--muted); font-family: var(--mono); font-size: .65rem; margin: .25rem 0 0; text-transform: uppercase; }
.published-actions { display: flex; gap: 1rem; }
.published-empty { color: var(--muted); font-family: var(--serif); font-size: 1.3rem; }

@media (max-width: 760px) {
  .empty-state { display: flex; flex-direction: column; padding: 1.5rem; }
  .empty-state > div { padding: 8rem 0 5rem; }
  .empty-state h1, .login-panel h1 { font-size: clamp(3.5rem, 17vw, 6rem); }
  .artist-finder { width: 100%; }
  .artist-header { display: flex; flex-direction: column; min-height: 82vh; padding: 1.5rem; }
  .artist-header nav { order: 2; }
  .artist-heading { margin: auto 0; }
  .artist-heading h1 { font-size: clamp(4.25rem, 23vw, 8rem); }
  .work-section { padding: 5rem 1.5rem; }
  .section-heading { display: block; }
  .section-heading h2 { margin-bottom: 1rem; }
  .work-count { text-align: right; }
  .gallery { display: block; }
  .work-card, .work-card:nth-child(n) { margin: 0 0 5rem; }
  .featured .work-media { aspect-ratio: 4 / 5; }
  .work-caption { align-items: start; }
  .about-section { display: block; padding: 6rem 1.5rem; }
  .about-section > div:first-child { margin-bottom: 4rem; }
  .about-copy > p { font-size: 1.65rem; }
  .about-copy dl div, .dialog-copy dl div { grid-template-columns: 7rem 1fr; }
  .portfolio-footer { display: block; line-height: 2; margin: 0 1.5rem; }
  #dialog-content { display: block; }
  .dialog-images { padding: 4.5rem 1rem 1rem; }
  .dialog-copy { padding: 4rem 1.5rem; position: static; }
  .studio-header, .studio-main { padding-left: 1.5rem; padding-right: 1.5rem; }
  .session-info span { display: none; }
  .studio-intro { display: block; padding: 5rem 0; }
  .studio-intro h1 { font-size: 3.7rem; }
  .studio-actions { margin-top: 3rem; }
  .panel-heading { grid-template-columns: 2rem 1fr; }
  .editor-form, .published-work { margin-left: 0; }
  .editor-form { display: block; }
  .field { margin-bottom: 2rem; }
  .published-item { grid-template-columns: 4.5rem 1fr; }
  .published-actions { grid-column: 2; }
}
