@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Fira+Sans:wght@400;600;700&display=swap');

:root {
	--red-0: hsl(3 76% 65%);
	--red-1: hsl(3 42% 52%);
	--orange-0: hsl(24 76% 61%);
	--orange-1: hsl(23 51% 49%);
	--yellow-0: hsl(37 62% 59%);
	--yellow-1: hsl(37 51% 51%);
	--green-0: hsl(70 36% 55%);
	--green-1: hsl(69 31% 46%);
	--aqua-0: hsl(112 25% 61%);
	--aqua-1: hsl(111 17% 51%);
	--blue-0: hsl(167 23% 59%);
	--blue-1: hsl(166 17% 49%);
	--purple-0: hsl(344 47% 68%);
	--purple-1: hsl(344 27% 55%);

	--taupe-0: hsl(180 2% 10%);
	--taupe-1: hsl(0 0% 14%);
	--taupe-2: hsl(20 3% 19%);
	--taupe-3: hsl(20 5% 22%);
	--taupe-4: hsl(20 5% 24%);
	--taupe-5: hsl(22 6% 25%);
	--taupe-6: hsl(22 7% 29%);
	--taupe-7: hsl(26 8% 33%);
	--taupe-8: hsl(27 10% 36%);
	--taupe-9: hsl(28 11% 44%);
	--taupe-10: hsl(30 12% 51%);

	--cream-0: hsl(38 47% 75%);
	--cream-1: hsl(39 33% 66%);
}


html {
  font-family: 'Inter', sans-serif;
	font-size:100%;
  block-size: 100%;
  inline-size: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  text-rendering: optimizeSpeed;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

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

:focus {
  outline: none;
}

:focus-visible {
  box-shadow: 0 0 0 2px var(--blue-0);
}

body {
  font-size: 1rem;
  font-weight: 400;
  min-block-size: 100%;
  min-inline-size: 100%;
  display: grid;
  place-items: center;

  /*background-color: var(--taupe-1);*/
  background:
    linear-gradient(0deg,   hsla(3 76% 65% / 80%), hsla(3 76% 65% / 0) 75%),
    linear-gradient(60deg,  hsla(24 76% 61% / 80%), hsla(24 76% 61% / 0) 75%),
    linear-gradient(120deg, hsla(37 62% 59% / 80%), hsla(37 62% 59% / 0) 75%),
    linear-gradient(180deg, hsla(70 36% 55% / 80%), hsla(70 36% 55% / 0) 75%),
    linear-gradient(240deg, hsla(112 25% 61% / 80%), hsla(112 25% 61% / 0) 75%),
    linear-gradient(300deg, hsla(167 23% 59% / 80%), hsla(167 23% 59% / 0) 75%);
}

.window {
  /*absolute is important for draggable JS to work*/
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 48rem;
  height: 40rem;
  display: flex;
  flex-direction: column;

  color: var(--cream-1);
  background: var(--taupe-0);
  border-radius: .5rem;
  box-shadow: 0 10px 20px -5px hsl(180 2% 10%);

  overflow: hidden;
}

/*___Globals___*/

header, .window-actions, .tabs, .tab, .toolbar, button, h1 {
  display: flex;
  align-items: center;
}

button, input[type="text"] {
  padding: .5rem;
  
  background: none;
  border-radius: .25rem;
  border: none;
}

button {
  color: var(--taupe-10);
}

.tabs button:hover, .tab button:hover, .toolbar button:hover {
  background-color: var(--taupe-2);
  color: var(--cream-0);
}

/*___Window header___*/

header {
  padding-inline: 1rem;
  padding-block: .25rem;
  gap: 2rem;
}

.window-actions {
  gap: .5rem;
}

.window-actions button {
  width: .75rem;
  height: .75rem;
  padding: 0;

  background-color: var(--taupe-2);
  border-radius: 100%;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Only show colors on hover */
.window-actions button:first-child.show-red:hover {
  background-color: var(--red-0);
}

.window-actions button:nth-child(2):hover {
  background-color: var(--yellow-0);
}

.window-actions button:nth-child(3):hover {
  background-color: var(--green-0);
}

.tabs, .tab {
  gap: .25rem;
}

.tab {
  font-size: .625rem;
  min-inline-size: 10rem;
  padding: .25rem .25rem .25rem .5rem;

  background-color: var(--taupe-1);
  border-radius: .25rem;
  color: var(--cream-1);
  cursor: pointer;
  transition: background-color 0.2s;
}

.tab:hover {
  background-color: var(--taupe-2);
}

.tab.active {
  background-color: var(--taupe-3);
  color: var(--cream-0);
}

.tab button {
  padding: .25rem;
  margin-left: auto;
}

/*___Window toolbar___*/

.toolbar {
  gap: .25rem;
  padding-inline: .5rem;
  padding-block: .25rem;
  
  border-bottom: 1px solid var(--taupe-0);
  background-color: var(--taupe-1);
}

.search {
  position: relative;
}

input[type="text"] {
  font-family: inherit;
  font-size: .75rem;
  line-height: 1.5;
  min-inline-size: 20rem;
  padding-inline-start: 2rem;
  
  background-color: var(--taupe-0);
  color: var(--cream-0);
}

.search svg {
  position: absolute;
  top: .5rem;
  left: .5rem;
}

.toolbar button {
  font-size: .625rem;
  gap: .15rem;
}

.rcce-button {
  margin-left: auto;
}

/*___Viewport___*/

main {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;

  background-color: var(--taupe-2)
}

.welcome-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 1rem;
  padding-bottom: 4rem;
}

[id*="error-screen"] {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.error-message {
  text-align: center;
  padding: 2rem;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-message h2 {
  font-size: 1.5rem;
  color: var(--cream-0);
  margin: 0;
}

.error-message p {
  color: var(--cream-1);
  margin: 0;
}

.error-detail {
  font-size: 0.875rem;
  color: var(--taupe-10);
  margin-bottom: 1rem;
}

#error-url {
  font-family: monospace;
  color: var(--blue-0);
  word-break: break-all;
}

.open-external-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--blue-0);
  color: var(--taupe-0);
  border: none;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 1rem;
}

.open-external-btn:hover {
  background-color: var(--blue-1);
}

#browser-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background-color: white;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -.05em;
  gap: .75rem;
  justify-content: center;
  text-align: center;
  display: flex;
  align-items: center;
}

p {
  font-size: .75rem;
  text-align: center;
}

a {
  color: var(--red-0);
  text-decoration: none;
}