/* Variables */

:root {
  --color-darkest: rgba(0, 0, 17, 0.9);
  --color-darker: rgba(0, 0, 17, 0.7);
  --color-half: rgba(0, 0, 17, 0.5);
  --color-light: rgba(0, 0, 17, 0.1);
  --color-lighter: rgba(0, 0, 17, 0.05);
  --color-lightest: #fff;
  --color-invisible: rgba(0, 0, 17, 0.001);
  --unit-1: 0.25rem; /* 4px */
  --unit-2: 0.5rem; /* 8px */
  --unit-3: 0.75rem; /* 12px */
  --unit-4: 1rem; /* 16px */
  --unit-5: 1.25rem; /* 20px */
  --unit-6: 1.5rem; /* 24px */
  --unit-7: 2rem; /* 32px */
  --unit-8: 2.5rem; /* 40px */
  --unit-9: 3rem; /* 48px */
  --unit-10: 4rem; /* 64px */
  --space-clamp: clamp(1.5rem, 5vw, 4rem);
}

/* Reset */

* {
  box-sizing: border-box;
}

button {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

img {
  max-width: 100%;
  vertical-align: bottom;
}

/* Typography */

body {
  background: var(--color-lightest);
  color: var(--color-darkest);
  font: 100%/1.5 system-ui, -apple-system, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
  text-wrap: balance;
}

a {
  border-bottom: 1px solid transparent;
  color: inherit;
  text-decoration: none;
}
a:hover {
  border-color: currentColor;
}

/* Layout */

body {
  margin: 0;
}

header {
  align-items: center;
  display: flex;
  gap: var(--unit-7);
  justify-content: space-between;
}

nav {
  align-items: center;
  display: flex;
  gap: var(--unit-6);
}

section {
  display: flex;
  justify-content: center;
  padding: var(--space-clamp);
}
.inset {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 75rem;
  gap: var(--unit-4);
}

.bar {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

/* Components */

input {
  border-radius: var(--unit-2);
  border: 1px solid var(--color-light);
  padding: var(--unit-4) var(--unit-6);
}

input:focus {
  border-color: var(--color-darkest);
  outline: none;
}

/* == Home == */

/* Hero */
#hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-height: 50vh;
  justify-content: center;
  text-align: center;
}

#hero h1 {
  font-size: var(--unit-9);
  line-height: 1.2;
}

.lede {
  color: var(--color-half);
  font-size: var(--unit-5);
  margin: var(--unit-4) 0 var(--unit-9);
  text-wrap: balance;
}

#url {
  align-items: center;
  display: flex;
  gap: var(--unit-4);
}

#hero input {
  font-size: 1.125rem;
  width: min(25rem, 50vw);
}

#hero button {
  background: var(--color-darkest);
  border-radius: var(--unit-2);
  border: 0;
  color: var(--color-lightest);
  cursor: pointer;
  font-size: var(--unit-4);
  padding: var(--unit-4) var(--unit-6);
}

/* Recent sites */

#recent-sites {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unit-4);
}

/* == Site == */

/* App */

#app {
  gap: var(--unit-4);
}

aside {
  width: 10rem;
}

#jory {
  box-shadow: 0 var(--unit-2) var(--unit-4) var(--color-light);
  border-radius: var(--unit-2);
  font-size: 14px;
  padding: var(--unit-4);
}
#jory-name {
  font-size: var(--unit-4);
}
#message {
  color: var(--color-half);
}
#thought {
  color: var(--color-light);
}

main {
  flex: 1;
}

/* Workspace */
#workspace,
#lapbook-display {
  animation: glitch 120s linear infinite;
  background: var(--color-lighter)
    url('https://images.unsplash.com/photo-1524865291454-215bdc75819e?q=80&w=1280&auto=format&fit=crop')
    center / cover;
}
@keyframes glitch {
  /* prettier-ignore */
  0% { background-position: center 0; }
  /* prettier-ignore */
  50% { background-position: center 100%; }
  /* prettier-ignore */
  100% { background-position: center 0; }
}
#workspace {
  align-items: center;
  border-radius: var(--unit-5);
  display: flex;
  justify-content: center;
  padding: var(--space-clamp);
}

#lapbook {
  max-width: 75rem;
  width: 100%;
}
#lapbook-display {
  border-radius: var(--unit-4) var(--unit-4) 0 0;
  border: var(--unit-2) solid var(--color-darkest);
  margin: 0 var(--unit-6);
  padding: var(--unit-1);
}
#lapbook-body {
  background: var(--color-darker);
  border-radius: 0 0 var(--unit-3) var(--unit-3);
  height: var(--unit-4);
}

#browser {
  border-radius: var(--unit-2);
  overflow: hidden;
}

#address {
  background: var(--color-invisible);
  backdrop-filter: blur(var(--unit-2));
  color: var(--color-half);
  font-size: var(--unit-3);
  padding: var(--unit-1) var(--unit-2);
}

#viewport {
  aspect-ratio: 16 / 9;
  background: var(--color-lightest);
  position: relative;
}

#viewport iframe {
  border: 0;
  height: 100%;
  width: 100%;
  /* Suppress console logs */
  pointer-events: none;
}

/* Free */

#screenshot.loading,
#screenshot img {
  border-radius: var(--unit-4);
}
#screenshot.loading {
  align-items: center;
  aspect-ratio: 16/9;
  background: var(--color-lighter);
  display: flex;
  justify-content: center;
}
#screenshot img {
  border: 2px solid var(--color-darkest);
  box-shadow: var(--unit-2) var(--unit-2) var(--color-darkest);
  width: 100%;
}
