:root {
  --sky: #dff4ff;
  --navy: #25324b;
  --cobalt: #1656c7;
  --paper: #fffdf7;
  --yellow: #ffd950;
  --red: #ef6b5b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
}

body {
  color: var(--navy);
  background:
    radial-gradient(circle at 8% 12%, #fff3a8 0 58px, transparent 59px),
    radial-gradient(circle at 95% 30%, #a6dcff 0 76px, transparent 77px),
    var(--sky);
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.page-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 22px 0 48px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  row-gap: 10px;
  margin-bottom: 22px;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cobalt);
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
}

.site-profile-photo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--navy);
  background: var(--paper);
  object-fit: cover;
  object-position: center 38%;
}

.author-tools,
.visitor-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.author-tools {
  justify-content: flex-end;
}

.visitor-tools {
  justify-content: flex-start;
}

.intro-card,
.post-card,
.editor-card {
  background: var(--paper);
  border: 3px solid var(--navy);
  border-radius: 28px;
  box-shadow: 9px 9px 0 var(--navy);
}

.intro-card {
  padding: 24px;
  margin-bottom: 24px;
}

.intro-actions {
  margin: 18px 0 0;
}

.back-link {
  margin: 0 0 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  color: var(--cobalt);
  font-size: clamp(1.7rem, 7vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 0;
}

.eyebrow,
.post-date {
  color: var(--cobalt);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 22px;
}

.post-card,
.editor-card {
  padding: 24px;
}

.post-date {
  display: block;
  width: fit-content;
  color: var(--cobalt);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.post-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.post-card--unpublished {
  background: #f3f5f8;
  border-style: dashed;
}

.status-badge {
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 4px 10px;
}

.post-photo {
  display: block;
  width: 100%;
  max-height: 540px;
  margin-top: 18px;
  border: 3px solid var(--navy);
  border-radius: 16px;
  object-fit: cover;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--navy);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--navy);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1.1;
  padding: 11px 16px;
  text-decoration: none;
}

.button--yellow {
  background: var(--yellow);
  color: var(--navy);
}

.button--blue {
  background: var(--cobalt);
  color: white;
}

.button--quiet {
  background: var(--paper);
  color: var(--navy);
}

.button--red {
  background: #ffd8d2;
  color: #8d241b;
}

.button--small {
  min-height: 40px;
  padding: 8px 13px;
  border-width: 2px;
  box-shadow: 3px 3px 0 var(--navy);
  font-size: 0.9rem;
}

.button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.button:active {
  box-shadow: 1px 1px 0 var(--navy);
  transform: translate(2px, 2px);
}

.editor-card {
  max-width: 620px;
  margin: 22px auto 0;
}

.post-form {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 900;
}

.field textarea,
.field input {
  width: 100%;
  min-height: 44px;
  border: 3px solid var(--navy);
  border-radius: 16px;
  background: white;
  color: var(--navy);
  font: inherit;
  padding: 12px;
}

.field textarea {
  resize: vertical;
}

.field input[type="file"] {
  padding: 7px 9px;
  font-weight: 700;
}

.field input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 12px;
  padding: 7px 14px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--navy);
  color: var(--navy);
  background: var(--yellow);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.field input[type="file"]:hover::file-selector-button {
  background: #ffe477;
}

.field input[type="file"]:active::file-selector-button {
  box-shadow: 1px 1px 0 var(--navy);
  transform: translate(2px, 2px);
}

.form-errors,
.flash {
  border: 3px solid var(--navy);
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 700;
}

.form-errors {
  background: #ffd8d2;
}

.flash {
  margin: 0 0 18px;
}

.flash--notice {
  background: #fff3a8;
}

.flash--alert {
  background: #ffd8d2;
}

.text-link {
  color: var(--cobalt);
  font-weight: 900;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--navy);
}

.post-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

.post-actions form {
  margin: 0;
}

:where(a, button, input, textarea, .button, .text-link):focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 24px, 760px);
    padding-top: 16px;
  }

  .site-header {
    align-items: flex-start;
  }

  .author-tools,
  .visitor-tools {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .intro-card {
    padding: 20px;
  }

  .intro-card,
  .post-card,
  .editor-card {
    border-radius: 22px;
    box-shadow: 6px 6px 0 var(--navy);
  }

  h1 {
    font-size: clamp(1.28rem, 7vw, 1.9rem);
  }

  .timeline,
  .post-card,
  .editor-card {
    gap: 18px;
  }
}
