/* --- Reset & Base --- */

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

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

body {
  font-family: "Courier New", Courier, monospace;
  color: #545F66;
  background: linear-gradient(to right, #EDEBE8, #EDEBE8 30%, #FFF 30%, #FFF);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Entry page --- */

.page-entry {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.logo {
  position: fixed;
  top: 2.5vmin;
  right: 2.5vmin;
  z-index: 10;
  display: block;
  width: 5vmin;
  height: 5vmin;
  background: #000;
}

.logo:hover {
  opacity: 0.85;
}

.top-links {
  position: fixed;
  top: calc(7.5vmin - 0.85em);
  right: calc(2.5vmin + 5vmin + 1em);
  z-index: 10;
  font-size: 0.85em;
  color: #000;
}

.top-links a {
  margin-left: 1em;
}


.arrow {
  position: fixed;
  top: 50vh;
  transform: translateY(-50%);
  width: 2vmin;
  height: 2vmin;
  border: solid #000;
  border-width: 0 3px 3px 0;
  z-index: 10;
  display: inline-block;
}

.arrow-prev {
  left: 5vh;
  transform: translateY(-50%) rotate(135deg);
}

.arrow-next {
  right: 5vh;
  transform: translateY(-50%) rotate(-45deg);
}

.arrow:hover {
  opacity: 0.5;
}

.photo {
  width: 80vw;
  height: 60vh;
  margin: 20vh auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo > a {
  display: contents;
}

.photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.info {
  display: flex;
  justify-content: flex-end;
  gap: 1.5em;
  margin-right: 5px;
  margin-top: 2.5vmin;
  font-size: 0.72em;
}

.info .date {
  white-space: nowrap;
  flex-shrink: 0;
}

.info .title {
  max-width: 400px;
}

.info-text {
  display: contents;
}

.arrow-hidden {
  visibility: hidden;
}

/* --- Empty diary state --- */

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40vmin;
  height: 40vmin;
  border: 2px solid #545F66;
  font-size: 10vmin;
  color: #545F66;
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.2s;
  line-height: 1;
}

.upload-cta:hover {
  opacity: 0.7;
  text-decoration: none;
}

.empty-label {
  font-size: 1.2em;
  opacity: 0.4;
}

.inline {
  display: inline;
}

.char-count {
  float: right;
  opacity: 0.5;
}

/* --- Form pages (login, register, upload) --- */

.page-form {
  min-height: 100vh;
}

.form-page {
  max-width: 400px;
  margin: 0 auto;
  padding: 10vh 2em 4em;
}

.form-page h1 {
  font-size: 1.2em;
  font-weight: normal;
  margin-bottom: 2em;
}

.form-page form {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.form-page label {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  font-size: 0.85em;
}

.form-page input[type="text"],
.form-page input[type="password"] {
  font: inherit;
  padding: 0.5em;
  border: 1px solid #ccc;
  background: #fff;
}

.form-page input[type="file"] {
  font: inherit;
  margin-top: 0.3em;
}

.form-page button {
  font: inherit;
  padding: 0.6em 1.5em;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.form-page button:hover {
  opacity: 0.85;
}

.error {
  color: #c44;
  font-size: 0.85em;
  margin-bottom: 1em;
}

.done {
  margin-bottom: 1em;
}

.alt {
  margin-top: 2em;
  font-size: 0.85em;
}

/* --- Welcome slide --- */

.welcome {
  text-align: center;
}

.welcome-title {
  font-size: 4em;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 1em;
  color: #000;
}

.welcome-tagline {
  font-size: 0.9em;
  opacity: 0.5;
  line-height: 1.8;
  margin-bottom: 2em;
}

.welcome-auth {
  font-size: 0.85em;
  margin-bottom: 3em;
}

.welcome-auth a {
  opacity: 0.7;
}

.welcome-auth a:hover {
  opacity: 1;
}

.welcome-note {
  font-size: 0.8em;
  opacity: 0.35;
  margin-top: 0.6em;
}

.welcome-footer {
  font-size: 0.8em;
  opacity: 0.4;
}

.welcome-discover {
  margin-bottom: 0.8em;
}

.welcome-faq {
  opacity: 0.7;
}

.welcome-faq:hover {
  opacity: 1;
}

/* --- FAQ --- */

.faq h2 {
  margin-top: 2em;
}

.faq p {
  font-size: 0.85em;
  line-height: 1.6;
  opacity: 0.7;
  margin-top: 0.5em;
}

/* --- Mobile --- */

@media (max-width: 600px) {
  .page-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    overflow: hidden;
  }

  .photo {
    width: 100vw;
    max-height: 80dvh;
    height: auto;
    margin: 0;
  }

  .photo img {
    width: 100%;
    max-height: 80dvh;
  }

  .info .arrow {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    display: inline-block;
    width: 10px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    flex-shrink: 0;
    z-index: auto;
  }

  .info .arrow-prev {
    transform: rotate(135deg);
  }

  .info .arrow-next {
    transform: rotate(-45deg);
  }

  .logo {
    width: 7vmin;
    height: 7vmin;
  }

  .top-links {
    right: calc(2.5vmin + 7vmin + 0.8em);
    font-size: 0.75em;
  }

  .top-links a {
    margin-left: 0.6em;
  }

  .info {
    width: 100vw;
    padding: 0 3vw;
    margin: 1em 0 0;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.8em;
    font-size: 0.75em;
  }

  .info-text {
    display: inline;
    text-align: right;
  }

  .info .title {
    max-width: none;
  }

  .upload-cta {
    width: 60vmin;
    height: 60vmin;
  }

  .form-page {
    padding: 6vh 1.5em 3em;
  }
}

/* --- Account page --- */

.form-page-wide {
  max-width: 500px;
}

@media (max-width: 600px) {
  .form-page-wide {
    max-width: 100%;
  }

  .entry-item {
    font-size: 0.8em;
  }
}

.form-page h2 {
  font-size: 0.95em;
  font-weight: normal;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #ddd;
}

.form-page h2:first-of-type {
  margin-top: 1.5em;
}

.success {
  color: #2a7;
  font-size: 0.85em;
  margin-bottom: 1em;
}

.token-display {
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.token-display input {
  font: inherit;
  padding: 0.5em;
  border: 1px solid #ccc;
  background: #f9f9f8;
  flex: 1;
  color: #545F66;
}

.token-note {
  font-size: 0.75em;
  opacity: 0.5;
  margin-top: 0.5em;
}

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4em 0;
  font-size: 0.85em;
  border-bottom: 1px solid #eee;
}

.entry-item-info {
  display: flex;
  gap: 1em;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.entry-item-info .date {
  white-space: nowrap;
  flex-shrink: 0;
}

.entry-item-info .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  font: inherit;
  font-size: 0.8em;
  padding: 0.2em 0.6em;
  background: none;
  border: 1px solid #ccc;
  cursor: pointer;
  color: #545F66;
  flex-shrink: 0;
}

.btn-small:hover {
  border-color: #999;
}

.btn-danger {
  background: #c44;
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-copy {
  font: inherit;
  font-size: 0.85em;
  padding: 0.5em 0.8em;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-copy:hover {
  opacity: 0.85;
}

.danger-zone {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid #c44;
}

.danger-zone h2 {
  color: #c44;
  border-bottom: none;
  margin-top: 0;
  padding-bottom: 0;
}
