@import "./fonts/inter/index.css";
@import "./fonts/manrope/index.css";
@import "./fonts/source-sans-3/index.css";
@import "./fonts/ibm-plex-sans/index.css";
@import "./fonts/hanken-grotesk/index.css";
@import "./fonts/schibsted-grotesk/index.css";
@import "./fonts/public-sans/index.css";
@import "./fonts/onest/index.css";
@import "./fonts/golos-text/index.css";
@import "./fonts/families.css";
@import "./settings.css";
@import "./projects.css";

:root {
  color-scheme: dark;
  color: #f1f1f1;
  background: #0b0b0b;
  font-family:
    var(--font-sans, Inter),
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
}

main {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 3rem) 0;
}

.page-header {
  position: absolute;
  z-index: 1;
  top: calc(5.417% - 2.375rem);
  left: 50%;
  padding: 0 0.35rem;
  background: #0b0b0b;
  transform: translateX(-50%);
}

.page-logo-link {
  display: inline-flex;
}

.page-logo {
  width: clamp(4.25rem, 9vw, 4.75rem);
  height: clamp(4.25rem, 9vw, 4.75rem);
  object-fit: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.phase-frame {
  position: relative;
  display: grid;
  min-height: clamp(42rem, 96vh, 43rem);
  place-items: center;
}

.phase-frame-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.phase-line,
.phase-line-pulse {
  fill: none;
  stroke-linecap: round;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.phase-line {
  stroke: #2b2b2b;
}

.phase-line-pulse {
  opacity: 0;
  stroke: #686868;
  stroke-dasharray: 20 100;
  animation: phase-line-sweep 16s linear infinite;
}

.phase-line-pulse-delayed {
  animation-delay: 0.7s;
}

.tool-index {
  position: relative;
  z-index: 1;
  align-self: start;
  width: min(28rem, calc(100% - 8rem));
  margin: 9.5rem 0 13rem;
}

.tool-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  border-top: 1px solid #242424;
  border-bottom: 1px solid #242424;
}

.tool-link {
  display: grid;
  min-height: 3.75rem;
  align-items: center;
  color: #f1f1f1;
  text-decoration: none;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2.5rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f1f1f1;
  outline-offset: 4px;
}

.tool-number {
  color: #666;
  font-size: 0.7rem;
}

.tool-list strong {
  font-size: clamp(1rem, 2vw, 1.15rem);
  letter-spacing: -0.025em;
}

.tool-open {
  display: grid;
  place-items: center;
  color: #a8a8a8;
  transition: color 160ms ease;
}

.tool-link:hover .tool-open {
  color: #f1f1f1;
}

.tool-info {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #a8a8a8;
  transition: color 160ms ease;
}

.tool-info:hover {
  color: #f1f1f1;
}

.tool-info[data-enabled] {
  -webkit-touch-callout: none;
  user-select: none;
}

.tool-info[data-enabled="false"] {
  color: #666;
}

.tool-info[aria-busy] {
  cursor: wait;
}

.tool-list .save-status {
  grid-column: 1 / -1;
}

.tool-list .save-status[data-error] {
  padding: 0 0 0.75rem;
}

.tool-open svg,
.tool-info svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.project-page {
  width: min(60rem, calc(100% - 3rem));
  padding: clamp(2rem, 8vh, 5rem) 0 4rem;
}

.project-heading h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: -0.035em;
}

.project-description {
  max-width: 39rem;
  margin: 1.5rem 0 2.5rem;
  color: #aaa;
  font-size: 1rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body:not([data-admin]) .tool-link {
  grid-column: 1 / -1;
}

.tool-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

button,
textarea,
.button {
  font: inherit;
  color: #f1f1f1;
  background: #121212;
  border: 1px solid #363636;
  border-radius: 0.5rem;
}

button,
.button {
  display: inline-flex;
  min-height: 44px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover,
.screenshot-view:hover {
  background: #252525;
}

button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.65;
  cursor: wait;
}

button.project-description {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  cursor: text;
}

button.project-description:hover {
  color: #f1f1f1;
}

.github-link {
  position: fixed;
  z-index: 2;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #aaa;
  background: #0b0b0b;
  border-radius: 0.5rem;
}

.github-link:hover {
  color: #f1f1f1;
}

.github-link svg {
  width: 1.125rem;
  height: 1.125rem;
}

.login-dialog {
  max-width: min(28rem, calc(100% - 2rem));
  padding: 1.5rem;
  color: #f1f1f1;
  background: #121212;
  border: 1px solid #363636;
  border-radius: 0.9rem;
}

.login-dialog::backdrop {
  background: rgb(0 0 0 / 75%);
}

.login-dialog h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

.dialog-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.description-form textarea {
  min-height: 10rem;
}

.save-status {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.save-status[data-error] {
  color: #e6aaa4;
}

.save-status a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.admin-session {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  background: #0b0b0b;
  color: #aaa;
  font-size: 0.875rem;
}

.admin-session a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  color: inherit;
}

.empty-state {
  color: #aaa;
}

.project-screenshot {
  margin: 0;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.375rem;
  margin: -0.375rem;
  overflow-x: auto;
}

.project-screenshot a {
  display: block;
}

.project-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: contain;
  border: 1px solid #2b2b2b;
}

.screenshot-edit {
  position: relative;
  display: block;
  width: 100%;
  align-self: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.screenshot-edit:hover img {
  border-color: #aaa;
}

.screenshot-edit-icon {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.25rem;
  color: #f1f1f1;
  background: #0b0b0b;
  pointer-events: none;
}

.screenshot-slot {
  position: relative;
}

.screenshot-view {
  position: absolute;
  right: 2.75rem;
  bottom: 0;
  width: 44px;
  height: 44px;
  padding: 0.5rem;
}

.screenshot-view svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.25rem;
  background: #0b0b0b;
}

.screenshot-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 560px) {
  main {
    width: calc(100% - 2rem);
    padding-top: 1.25rem;
  }

  .phase-frame {
    min-height: 42rem;
  }

  .tool-index {
    width: calc(100% - 56px);
  }

  .tool-link {
    grid-template-columns: 32px minmax(0, 1fr) 24px;
    overflow-wrap: anywhere;
  }

  .project-page {
    width: calc(100% - 2rem);
  }

  .project-gallery {
    grid-template-columns: repeat(3, 78%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-open,
  .tool-info {
    transition: none;
  }

  .phase-line-pulse {
    animation: none;
  }
}

@keyframes phase-line-sweep {
  0%,
  88.5% {
    opacity: 0;
    stroke-dashoffset: 0;
  }

  89% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  94.625% {
    opacity: 1;
    stroke-dashoffset: -100;
  }

  95%,
  100% {
    opacity: 0;
    stroke-dashoffset: -100;
  }
}
