:root{
/* Colours */
    --theme-1: #E9540D;
    --theme-2: #E1261D;
    --theme-3: #fbe2d7;
    --theme-4: #e96056;
    --theme-5: #f0825a;
    --theme-6: #660000;
    --theme-7: #4c1130;
    --theme-8: #20124d;
    --theme-9: #073763;

    --theme-grad-1: linear-gradient(var(--theme-2), var(--theme-1));
    --theme-grad-2: linear-gradient(in hsl,
                    var(--theme-6),
                    color-mix(in hsl, var(--theme-7), transparent 50%),
                    color-mix(in hsl, var(--theme-8), transparent 40%),
                    color-mix(in hsl, var(--theme-9), transparent 20%),
                    color-mix(in hsl, var(--theme-8), transparent 20%));
    --theme-grad-3: linear-gradient(var(--theme-4), var(--theme-5));
    --theme-grad-3-tra: linear-gradient(color-mix(var(--theme-4), transparent 10%), color-mix(var(--theme-5), transparent 10%));

    --bg-color: black;
    --bg-pattern: url(/devil-assets/devil-Pattern-final-200px.png);

    --text-color: black;
    --text-color-alt: white;
    --text-color-gentle: var(--theme-3);
    --text-link-color: color-mix(in srgb, var(--theme-6), var(--text-color) 50%);
    --text-link-color-hover: var(--theme-6);
    --text-link-color-alt: var(--text-color-alt);
    --text-link-color-alt-hover: var(--theme-5);
    --text-link-color-gentle: var(--theme-3);
    --text-link-color-gentle-hover: white;

/* Typography */
    --font-base: "readex pro", sans-serif;
    --font-heading: arvo, monospace;
    --line-height-base: 1.6;
    --reading-width: 60ch;
  
/* Spacing */
    --header-height: 4rem;
    --spacing-base: 1rem;
    --spacing-surround: clamp(2rem, 10vw, 16rem);
    --spacing-article: calc(var(--spacing-base)*6);
    --float-inset: 15vw;
    --column-width-min: 40ch;
    --column-width-max: var(--reading-width);

/* Layout */
    --border-radius: 10px;
}


/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

/*html, body, main {
  min-height: 100vh;
  margin: auto 0;
}*/

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Make images easier to work with */
img,
picture,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

/* ==========================================================================
   Typography
   ========================================================================== */

html {
  font-size: 18px;
}

body {
  text-rendering: optimizeLegibility;
  line-height: var(--line-height-base);
  font-family: var(--font-base);
  font-weight: 350;
  background-color: var(--bg-color);
  color: var(--text-color);
  
  /* Smooth font rendering on macOS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Generic paragraph */
p {
    margin: 0 0 1rlh;
}

/*Headings*/
h1, h2, h3, h4, h5, h6, hgroup{
  line-height: 1.2;
  margin-bottom: calc(var(--spacing-base) * 1.5);
  text-wrap: balance;
  scroll-margin-top: var(--float-inset);
  font-family: var(--font-heading);
  font-weight: normal;
}
h1{
    margin: calc(var(--spacing-base)*1.5) auto 0;
    height: auto;
    max-width: calc(var(--column-width-min)*1.25);
    display: block;
}
h2{
    font-size: 3rem;
    width: 100%;
}
h3{
    font-size: 1.88rem;
    margin-top: var(--spacing-base);
}
h4, h5, h6{
    font-size: 1.2rem;
    margin-top: var(--spacing-base);
    margin-bottom: var(--spacing-base);
    font-weight: bold;
}
hgroup p{
    /* need to make hgroup the width-defining factor*/
    margin: 0 auto;
    height: auto;
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--text-color);
    color: var(--text-color-alt);
    padding: var(--spacing-base);
    max-width: calc(var(--column-width-min)*1.05);
}

footer p{
    font-size: 0.6rem;
}

p.intro{
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.1rem;
}

b, p.personnel, p.date, span.contact{
    font-weight: 700;
    font-variation-settings: "HEXP" 5;
}

i{
    font-style: italic;
}

/* Navigation and links */

a{
    color: var(--text-link-color);
    transition: color 0.2s ease;
}
a:hover, a:focus-visible{
    color: var(--text-link-color-hover);
}
a:focus-visible{
    outline: 2px solid var(--text-link-color-hover);
    outline-offset: 2px;
}

footer a{
    color: var(--theme-1);
}
footer a:hover, footer a:focus-visible{
    color: var(--text-link-color-alt-hover);
}
footer a:focus-visible{
    outline-color: var(--text-link-color-alt-hover);
}

nav.social ul{
    display: grid;
    grid: auto-flow / 1fr 1fr 1fr 1fr;
    max-width: var(--column-width-min);
    list-style-type: none;
    margin: var(--spacing-base) auto;
    text-align: center;
}

nav.social a {
    color: var(--text-color);
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    text-decoration: none;
    font-size: 1.62rem;
}
nav.social a:hover{
    color: var(--text-link-color);
}

/* ==========================================================================
   Layout
   ========================================================================== */

html, body{
    background-color: var(--theme-1);
}

body{
    background-image: var(--bg-pattern), var(--theme-grad-1);
    background-repeat: repeat, no-repeat;
    background-attachment: fixed;
    background-blend-mode: color-burn, normal;
}

section, header, footer, article, nav.social ul, nav.social li, nav.social a{
    align-items: center;
    align-content: center;
    justify-content: center;
    margin: 0 auto;
    background-color: transparent;
}

section, header, footer{
    padding: 0 var(--spacing-surround);
}

section, footer{
    min-height: 50vh;
}

section.media {
    background-color: var(--bg-color);
}

header{
    height: var(--header-height);
}

footer{
    background-color: var(--bg-color);
    color: var(--theme-1);
}

article {
    max-width: calc(var(--column-width-max)*1.5);
}

.columns, .grid{
    display: grid;
    grid: auto-flow / 1fr 1fr;
    grid-auto-columns: minmax(var(--column-width-min), var(--column-width-max));
    gap: calc(var(--spacing-base)*3);
    align-items:start;
}

.grid{
    grid-template: auto / 1fr 4fr;
}

figure {
    margin-top: var(--spacing-base);
}
figcaption{
    margin-bottom: calc(var(--spacing-base)*-1);
}
figcaption h4{
    margin-top: 0;
}

hr {
    width: 4rem;
    height: 3px;
    margin: var(--spacing-base) auto calc(var(--spacing-base)*1.5);
    background-color: var(--bg-color);
    border: none;
    opacity: 33%;
}

/* Images and media */

img{
    font-size: 0.6rem;
}

img.title-footer{
    max-width: var(--column-width-max);
    margin: 0 0 var(--spacing-base);
}

article img{
    border-radius: var(--border-radius);
}

#smoking-royals {
    margin-top: calc(var(--spacing-article)*-1);
}

img.writer{
    aspect-ratio: 1 / 1;
    margin-bottom: calc(var(--spacing-base)*2);
}

iframe{
    width: clamp(var(--column-width-min), 66%, calc(var(--column-width-max)*1.5));
    height: auto;
    aspect-ratio: 2 / 1;
    margin: var(--spacing-article) auto;
}

.track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    width: auto;
    height: 50vh;
    display: flex;
    gap: var(--spacing-base);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    scrollbar-width: none;
}

.track img, .track div {
    height: auto;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    box-sizing: border-box;
}
.track img{
    flex: 0 0 content;
    width: auto;
    max-width: none;
}
.track div {
    border-radius: var(--border-radius);
    background-color: color-mix(in srgb, var(--theme-4), transparent 80%);
    color: var(--text-color-alt);
    flex: 0 0 calc(var(--column-width-min)*0.5);
    padding: var(--spacing-base);
}
.track div.start{
    text-align: right;
}

/* ==========================================================================
   Named sections
   ========================================================================== */

#hero{
    background-image: url(/devil-assets/devil-village-burn-3000px.png);
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: clamp(86rem, 100%, 120rem) auto;
    min-height: 76rem;
    padding: var(--header-height) var(--spacing-surround) 0;
    margin: calc(var(--header-height)*-1) 0 -1px;
    align-content: start;
}

#paperwork p, #hatsoff p{
    font-family: var(--font-heading);
    margin-bottom: 0;
}
#paperwork p{
    font-size: 1.62rem;
    line-height: 1.3;
}
#paperwork .firstline{
    font-size: 2.62rem;
}

#desk{
    margin: 2rem 0 0 0;
}

#hatsoff{
    padding: calc(var(--spacing-base)*1.5);
    background-image: var(--theme-grad-3-tra);
    border-radius: var(--border-radius);
    width: 80%;
    margin: 0 0 0 auto;
}
#hatsoff h4{
    margin-top:0;
}
#hatsoff p{
    line-height: 1.3rem;
}
#hatsoff b{
    font-weight: bold;
}
#hatsoff-logo{
    height: 4rem;
    margin-bottom: 1rem;
}
#innovation-award{
    margin: var(--spacing-base) 0;
    max-height: 6rem;
    box-shadow: 0 0 10px;
}

#about{
    background-image: var(--theme-grad-2);
    color: var(--text-color-gentle);
    padding-bottom: var(--spacing-article);
}
#about article{
    margin-top: var(--spacing-article);
}
#about h2, #about h3, #about h4, #about .intro{
    color: var(--text-color-alt);
}
#about a{
    color: var(--text-link-color-alt);
}
#about a:hover, #about a:focus-visible{
    color: var(--text-link-color-alt-hover);
}
#about a:focus-visible{
    outline: 2px solid var(--text-link-color-alt-hover);
    outline-offset: 2px;
}

#timeline {
    background-color: var(--theme-3);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-base)*2);
    color: var(--text-color);
}
#timeline h2, #timeline h4{
    color: var(--text-color);
}
#timeline h4{
    margin: calc(var(--spacing-base)*-0.7) 0 calc(var(--spacing-base)*0.5);
    font-weight: normal;
}
#timeline figure{
    align-items: center !important;
}
#timeline figure p{
    font-size: 0.8rem;
}
#timeline img{
    border-radius: calc(var(--border-radius)*0.7);
}


#story{
    grid-template-columns: 6fr 4fr;
}

#contact nav.social ul {
    margin: calc(var(--spacing-base)*2) auto;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

@media (max-width: 767px){
    .columns, .grid{
        display: flex;
        flex-direction: column;
    }
    .track {
        height: 20vh;
    }
    #hero{
        margin: 0 0 -1px;
        padding: var(--spacing-base) var(--spacing-surround) 0;
        min-height: 105vh;
    }
    #paperwork, #hatsoff{
        margin: 0 auto;
        width: 100%;
    }
    figcaption{
        margin-top: calc(var(--spacing-base)*-1);
    }
    hr{
        margin-top: calc(var(--spacing-base)*3);
        margin-bottom: calc(var(--spacing-base)*3);
    }
}

   /* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}