@import compass

@function gray($value, $opacity: 1)
	@return rgba($value, $value, $value, $opacity)

/*
 *  So you like the style of impress.js demo?
 *  Or maybe you are just curious how it was done?
 *
 *  You couldn't find a better place to find out!
 *
 *  Welcome to the stylesheet impress.js demo presentation.
 *
 *  Please remember that it is not meant to be a part of impress.js and is
 *  not required by impress.js.
 *  I expect that anyone creating a presentation for impress.js would create
 *  their own set of styles.
 *
 *  But feel free to read through it and learn how to get the most of what
 *  impress.js provides.
 *
 *  And let me be your guide.
 *
 *  Shall we begin?

*
	margin: 0
	padding: 0
	border: 0
	font-size: 100%
	font: inherit
	vertical-align: baseline
	+box-sizing(border-box)

/* HTML5 display-role reset for older browsers

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section
	display: block

body
	line-height: 1

ol, ul
	list-style: none

blockquote, q
	quotes: none

blockquote
	&:before, &:after
		content: ''
		content: none

q
	&:before, &:after
		content: ''
		content: none

table
	border-collapse: collapse
	border-spacing: 0

/*
 *  Now here is when interesting things start to appear.
 *
 *  We set up <body> styles with default font and nice gradient in the background.
 *  And yes, there is a lot of repetition there because of -prefixes but we don't
 *  want to leave anybody behind.

body
	color: white
	font-family: 'Trebuchet MS', sans-serif
	min-height: 740px
	background-color: gray(15)
	+background(radial-gradient(gray(40), gray(20)))

b,
strong
	font-weight: bold

i,
em
	font-style: italic

a
	color: inherit
	text-decoration: none
	padding: 0.3em 0.8em
	background: rgba(255, 255, 255, 0.06)
	text-shadow: -1px -1px 2px rgba(100, 100, 100, 0.9)
	border-radius: 0.2em
	-webkit-transition: 0.5s
	-moz-transition: 0.5s
	-ms-transition: 0.5s
	-o-transition: 0.5s
	transition: 0.5s
	&:hover,
	&:focus
		background: rgba(255, 255, 255, 1)
		text-shadow: -1px -1px 2px rgba(100, 100, 100, 0.5)


.fallback-message
	font-family: sans-serif
	line-height: 1.3
	width: 780px
	padding: 10px 10px 0
	margin: 20px auto
	border: 1px solid #E4C652
	border-radius: 10px
	background: #EEDC94
	p
		margin-bottom: 10px

.impress-supported
	.fallback-message
		display: none

.step
	text-align: center
	position: relative
	width: 1000px
	padding: 40px
	margin: 20px auto
	font-size: 48px
	line-height: 1.5
	code
		font-size: 160%
		display: inline-block
		opacity: 0
		position:  relative
		margin-top: 100px
	&.present
		code
			+transition(opacity 2s)
			opacity: 1
	&.past
		code
			+transition(opacity 0.2s)
			opacity: 0

.impress-enabled
	.step
		margin: 0
		opacity: 0.2
		+transition(opacity 1s)
		&.active
			opacity: 1

#start
	h1
		font-size: 140px
		font-family: 'Helvetica', sans-serif

#structure
	opacity: 0
	&.present
		+transition(opacity 1s)
		opacity: 1
	&.past
		opacity: 1
	ol
		display: inline-block
		list-style-type: decimal
		text-align: left

svg
	display: inline-block
	width: 200px
	height: 200px

	circle,
	rect,
	ellipse,
	line,
	polygon
		fill: white
	line,
	polyline,
	path
		stroke: white
		stroke-width: 10px
	polyline
		fill: none

#example
	width: 900px
	height: 600px

#sources
	li
		line-height: 2.8

#twitter
	img
		vertical-align: middle
		height: 100px
		display: inline-block
		margin-right: 40px
	h1
		vertical-align: middle
		font-size: 100px
		display: inline

//.slide
	display: block
	width: 900px
	height: 700px
	padding: 40px 60px
	background-color: white
	border: 1px solid rgba(0, 0, 0, 0.3)
	border-radius: 10px
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1)
	color: rgb(102, 102, 102)
	text-shadow: 0 2px 2px rgba(0, 0, 0, 0.1)
	font-family: 'Open Sans', Arial, sans-serif
	font-size: 30px
	line-height: 36px
	letter-spacing: -1px
	q
		display: block
		font-size: 50px
		line-height: 72px
		margin-top: 100px
		strong
			white-space: nowrap


#title
	padding: 0
	.try
		font-size: 64px
		position: absolute
		top: -0.5em
		left: 1.5em
		+transform(translateZ(20px))
	h1
		font-size: 190px
		+transform(translateZ(50px))
	.footnote
		font-size: 32px


#big
	width: 600px
	text-align: center
	font-size: 60px
	line-height: 1
	b
		display: block
		font-size: 250px
		line-height: 250px
	.thoughts
		font-size: 90px
		line-height: 150px

#tiny
	width: 500px
	text-align: center

#ing
	width: 500px
	b
		display: inline-block
		+transition(0.5s)
	&.present
		.positioning
			+transform(translateY(-10px))
		.rotating
			+transform(rotate(-10deg))
			+transition-delay(0.25s)
		.scaling
			+transform(scale(0.7))
			+transition-delay(0.5s)

/*
 *  ... so we define display to `inline-block` to enable transforms and
 *  transition duration to 0.5s ...

/*
 *  ... and we want 'positioning` word to move up a bit when the step gets
 *  `present` class ...

/*
 *  ... 'rotating' to rotate quater of a second later ...

/*
 *  ... and 'scaling' to scale down after another quater of a second.

/*
 *  The 'imagination' step is again some boring font-sizing.

#imagination
	width: 600px
	.imagination
		font-size: 78px

/*
 *  There is nothing really special about 'use the source, Luke' step, too,
 *  except maybe of the Yoda background.
 *
 *  As you can see below I've 'hard-coded' it in data URL.
 *  That's not the best way to serve images, but because that's just this one
 *  I decided it will be OK to have it this way.
 *
 *  Just make sure you don't blindly copy this approach.

#source
	width: 700px
	padding-bottom: 300px
	/* Yoda Icon :: Pixel Art from Star Wars http://www.pixeljoint.com/pixelart/1423.htm
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAMAAACwUBm+AAAAAXNSR0IArs4c6QAAAKtQTFRFsAAAvbWSLUUrLEQqY1s8UYJMqJ1vNTEgOiIdIzYhjIFVLhsXZ6lgSEIsP2U8JhcCVzMsSXZEgXdOO145XJdWOl03LzAYMk4vSXNExr+hwcuxRTs1Qmk+RW9Am49eFRANQz4pUoNMQWc+OSMDTz0wLBsCNVMxa2NBOyUDUoNNSnlEWo9VRGxAVzYFl6tXCggHbLNmMUIcHhwTXkk5f3VNRT8wUT8xAAAACQocRBWFFwAAAAF0Uk5TAEDm2GYAAAPCSURBVHja7d3JctNAFIZRMwRCCGEmzPM8z/D+T8bu/ptbXXJFdij5fMt2Wuo+2UgqxVmtttq5WVotLzBgwIABAwYMGDCn0qVqbo69psPqVpWx+1XG5iaavF8wYMCAAQMGDBgwi4DJ6Y6qkxB1HNlcN3a92gbR5P2CAQMG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T9asCAwYMGDBgwIABA2ZumKuztLnjgQEDBgwYMGDAgNl5mH/4/ltKA6vBNAAAAABJRU5ErkJggg==)
	background-position: bottom right
	background-repeat: no-repeat
	q
		font-size: 60px

/*
 *  And the "it's in 3D" step again brings some 3D typography - just for fun.
 *
 *  Because we want to position <span> elements in 3D we set transform-style to
 *  `preserve-3d` on the paragraph.
 *  It is not needed by webkit browsers, but it is in Firefox. It's hard to say
 *  which behaviour is correct as 3D transforms spec is not very clear about it.

#its-in-3d
	p
		-webkit-transform-style: preserve-3d
		-moz-transform-style: preserve-3d
		/* Y U need this Firefox?!
		-ms-transform-style: preserve-3d
		-o-transform-style: preserve-3d
		transform-style: preserve-3d
	span, b
		display: inline-block
		-webkit-transform: translateZ(40px)
		-moz-transform: translateZ(40px)
		-ms-transform: translateZ(40px)
		-o-transform: translateZ(40px)
		transform: translateZ(40px)
		-webkit-transition: 0.5s
		-moz-transition: 0.5s
		-ms-transition: 0.5s
		-o-transition: 0.5s
		transition: 0.5s
	.have
		-webkit-transform: translateZ(-40px)
		-moz-transform: translateZ(-40px)
		-ms-transform: translateZ(-40px)
		-o-transform: translateZ(-40px)
		transform: translateZ(-40px)
	.you
		-webkit-transform: translateZ(20px)
		-moz-transform: translateZ(20px)
		-ms-transform: translateZ(20px)
		-o-transform: translateZ(20px)
		transform: translateZ(20px)
	.noticed
		-webkit-transform: translateZ(-40px)
		-moz-transform: translateZ(-40px)
		-ms-transform: translateZ(-40px)
		-o-transform: translateZ(-40px)
		transform: translateZ(-40px)
	.its
		-webkit-transform: translateZ(60px)
		-moz-transform: translateZ(60px)
		-ms-transform: translateZ(60px)
		-o-transform: translateZ(60px)
		transform: translateZ(60px)
	.in
		-webkit-transform: translateZ(-10px)
		-moz-transform: translateZ(-10px)
		-ms-transform: translateZ(-10px)
		-o-transform: translateZ(-10px)
		transform: translateZ(-10px)
	.footnote
		font-size: 32px
		-webkit-transform: translateZ(-10px)
		-moz-transform: translateZ(-10px)
		-ms-transform: translateZ(-10px)
		-o-transform: translateZ(-10px)
		transform: translateZ(-10px)
	&.present
		span, b
			-webkit-transform: translateZ(0px)
			-moz-transform: translateZ(0px)
			-ms-transform: translateZ(0px)
			-o-transform: translateZ(0px)
			transform: translateZ(0px)

/*
 *  Below we position each word separately along Z axis and we want it to transition
 *  to default position in 0.5s when the step gets `present` class.
 *
 *  Quite a simple idea, but lot's of styles and prefixes.

/*
 *  The last step is an overview.
 *  There is no content in it, so we make sure it's not visible because we want
 *  to be able to click on other steps.

#overview
	display: none

/*
 *  We also make other steps visible and give them a pointer cursor using the
 *  `impress-on-` class.

.impress-on-overview .step
	opacity: 1
	cursor: pointer

/*
 *  Now, when we have all the steps styled let's give users a hint how to navigate
 *  around the presentation.
 *
 *  The best way to do this would be to use JavaScript, show a delayed hint for a
 *  first time users, then hide it and store a status in cookie or localStorage...
 *
 *  But I wanted to have some CSS fun and avoid additional scripting...
 *
 *  Let me explain it first, so maybe the transition magic will be more readable
 *  when you read the code.
 *
 *  First of all I wanted the hint to appear only when user is idle for a while.
 *  You can't detect the 'idle' state in CSS, but I delayed a appearing of the
 *  hint by 5s using transition-delay.
 *
 *  You also can't detect in CSS if the user is a first-time visitor, so I had to
 *  make an assumption that I'll only show the hint on the first step. And when
 *  the step is changed hide the hint, because I can assume that user already
 *  knows how to navigate.
 *
 *  To summarize it - hint is shown when the user is on the first step for longer
 *  than 5 seconds.
 *
 *  The other problem I had was caused by the fact that I wanted the hint to fade
 *  in and out. It can be easily achieved by transitioning the opacity property.
 *  But that also meant that the hint was always on the screen, even if totally
 *  transparent. It covered part of the screen and you couldn't correctly clicked
 *  through it.
 *  Unfortunately you cannot transition between display `block` and `none` in pure
 *  CSS, so I needed a way to not only fade out the hint but also move it out of
 *  the screen.
 *
 *  I solved this problem by positioning the hint below the bottom of the screen
 *  with CSS transform and moving it up to show it. But I also didn't want this move
 *  to be visible. I wanted the hint only to fade in and out visually, so I delayed
 *  the fade in transition, so it starts when the hint is already in its correct
 *  position on the screen.
 *
 *  I know, it sounds complicated ... maybe it would be easier with the code?

.hint
	/*
	   *  We hide the hint until presentation is started and from browsers not supporting
	   *  impress.js, as they will have a linear scrollable view ...
	display: none
	/*
	   *  ... and give it some fixed position and nice styles.
	position: fixed
	left: 0
	right: 0
	bottom: 200px
	background: rgba(0, 0, 0, 0.5)
	color: #EEE
	text-align: center
	font-size: 50px
	padding: 20px
	z-index: 100
	/*
	   *  By default we don't want the hint to be visible, so we make it transparent ...
	opacity: 0
	/*
	   *  ... and position it below the bottom of the screen (relative to it's fixed position)
	-webkit-transform: translateY(400px)
	-moz-transform: translateY(400px)
	-ms-transform: translateY(400px)
	-o-transform: translateY(400px)
	transform: translateY(400px)
	/*
	   *  Now let's imagine that the hint is visible and we want to fade it out and move out
	   *  of the screen.
	   *
	   *  So we define the transition on the opacity property with 1s duration and another
	   *  transition on transform property delayed by 1s so it will happen after the fade out
	   *  on opacity finished.
	   *
	   *  This way user will not see the hint moving down.
	-webkit-transition: opacity 1s, -webkit-transform 0.5s 1s
	-moz-transition: opacity 1s,    -moz-transform 0.5s 1s
	-ms-transition: opacity 1s,     -ms-transform 0.5s 1s
	-o-transition: opacity 1s,      -o-transform 0.5s 1s
	transition: opacity 1s,         transform 0.5s 1s

/*
 *  Now we 'enable' the hint when presentation is initialized ...

//.impress-enabled .hint
//	display: block

/*
 *  ... and we will show it when the first step (with id 'bored') is active.

.impress-on-bored .hint
	/*
	   *  We remove the transparency and position the hint in its default fixed
	   *  position.
	opacity: 1
	-webkit-transform: translateY(0px)
	-moz-transform: translateY(0px)
	-ms-transform: translateY(0px)
	-o-transform: translateY(0px)
	transform: translateY(0px)
	/*
	   *  Now for fade in transition we have the oposite situation from the one
	   *  above.
	   *
	   *  First after 4.5s delay we animate the transform property to move the hint
	   *  into its correct position and after that we fade it in with opacity
	   *  transition.
	-webkit-transition: opacity 1s 5s, -webkit-transform 0.5s 4.5s
	-moz-transition: opacity 1s 5s,    -moz-transform 0.5s 4.5s
	-ms-transition: opacity 1s 5s,     -ms-transform 0.5s 4.5s
	-o-transition: opacity 1s 5s,      -o-transform 0.5s 4.5s
	transition: opacity 1s 5s,         transform 0.5s 4.5s

/*
 *  And as the last thing there is a workaround for quite strange bug.
 *  It happens a lot in Chrome. I don't remember if I've seen it in Firefox.
 *
 *  Sometimes the element positioned in 3D (especially when it's moved back
 *  along Z axis) is not clickable, because it falls 'behind' the <body>
 *  element.
 *
 *  To prevent this, I decided to make <body> non clickable by setting
 *  pointer-events property to `none` value.
 *  Value if this property is inherited, so to make everything else clickable
 *  I bring it back on the #impress element.
 *
 *  If you want to know more about `pointer-events` here are some docs:
 *  https://developer.mozilla.org/en/CSS/pointer-events
 *
 *  There is one very important thing to notice about this workaround - it makes
 *  everything 'unclickable' except what's in #impress element.
 *
 *  So use it wisely ... or don't use at all.

.impress-enabled
	pointer-events: none
	#impress
		pointer-events: auto

			/*
			 *  There is one funny thing I just realized.
			 *
			 *  Thanks to this workaround above everything except #impress element is invisible
			 *  for click events. That means that the hint element is also not clickable.
			 *  So basically all of this transforms and delayed transitions trickery was probably
			 *  not needed at all...
			 *
			 *  But it was fun to learn about it, wasn't it?

			/*
			 *  That's all I have for you in this file.
			 *  Thanks for reading. I hope you enjoyed it at least as much as I enjoyed writing it
			 *  for you.