:root {
  /* Colors */
  --theme-color: #2d2d2d;
  --theme-color-darker: #151515;
  --theme-color-accent: #111;
  --theme-color-hover: rgba(255,255,255,0.2);
  --theme-color-contrast: #000;
  --theme-color-font: #ededed;
  --theme-color-border: 1px solid #777;

  --focus-visible-color: var(--theme-color-font);

  --body-bg: var(--theme-color);
  --font-color: var(--theme-color-font);
  
  --header-bg: var(--theme-color-accent);
  --header-font-color: var(--theme-color-font);

  --footer-bg: transparent;
  --footer-font-color: var(--theme-color-font);

  /* Fonts */
  --font-family: Roboto, arial, sans-serif;
  --font-weight: 300;
  --font-weight-strong: 600;
  --font-size: 1.125rem;
  --font-size-ipad: 1.375rem;
  --line-height: 1.5;
  --letter-spacing: 0.02em;
  --font-heading: "Quicksand", arial, sans-serif;
  --font-heading-weight: 500;

  /* Layout */
  --z-index-on-top: 10;
  --header-height: 4rem;
  --footer-height: 4rem;
  --grid-max-width: 840px;
  --grid-padding: 1.25rem;
}

html.dark {
  color-scheme: dark;
}

/* Aply light mode if requested */
html.light {
  color-scheme: light;

  --theme-color: #edd0a4;
  --theme-color-darker: #a77141;
  --theme-color-accent: #ffe5b7;
  --theme-color-hover: rgba(255,255,255,0.5);
  --theme-color-contrast: #fff;
  --theme-color-font: #252525;
  --theme-color-border: 1px solid #a77141;
}


/* roboto-300 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  src: url('/fonts/roboto-v51-latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* roboto-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/roboto-v51-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* roboto-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/roboto-v51-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* roboto-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/roboto-v51-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* quicksand-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/quicksand-v37-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* quicksand-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/quicksand-v37-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* quicksand-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/quicksand-v37-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* quicksand-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/quicksand-v37-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.2em;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 0.1em;
}

@media screen and (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

a {
  color: var(--font-color);
  text-underline-offset: 0.25em;
}

strong, b {
  font-weight: var(--font-weight-strong);
}

p {
  margin-bottom: 1rem;
}


* {
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  word-wrap: break-word;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

*:focus-visible {
  outline: 0.125rem solid var(--focus-visible-color);
  outline-offset: 0.25rem;
  background-color: var(--theme-color-contrast);
  box-shadow: 0 0 0 0.25rem var(--theme-color-contrast);
}

img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
}

nav ul {
  list-style: none;
}

/* Accessibility */
/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto; /* no smooth scrolling */
  }

  *,
  *::before,
  *::after {
    animation: none;
    transition: none;
  }
}


html {
  color-scheme: dark light;
  min-height: 100%;
  width: 100%;
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  font-size: 1rem;
  scroll-padding-top: 0;
  scroll-padding-bottom: var(--header-height);
  display: flex;
  flex-direction: column;
}

@media screen and (min-width: 768px) {
  html {
    scroll-padding-top: var(--header-height);
    scroll-padding-bottom: 0;
  }
}

body {
  position: relative;
  z-index: 0;
  width: 100%;
  color: var(--font-color);
  background-color: var(--body-bg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  padding-block: 0 var(--header-height);
}

@media screen and (min-width: 768px) {
  body {
    padding-block: var(--header-height) 0;
  }
}

.light body::before {
  opacity: 1;
}

@media screen and (min-width: 768px) {
  body {
    font-size: var(--font-size-ipad);
  }
}

@media screen and (min-width: 1200px) {
  body::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image:
      url("/texture.png"),
      linear-gradient(
        90deg,
        var(--theme-color-darker) 0px,
        var(--body-bg) calc(50% - calc(var(--grid-max-width) / 2)),
        var(--body-bg) calc(50% + calc(var(--grid-max-width) / 2)),
        var(--theme-color-darker) 100%
      );
    background-blend-mode: overlay;
    background-position: top center;
  }
}

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border-bottom: var(--theme-color-border);
  padding-block: 1rem;
}

.content {
  width: 100%;
  max-width: var(--grid-max-width);
  padding-inline: var(--grid-padding);
  margin-inline: auto;
}


footer {
  width: 100%;
  background-color: var(--footer-bg);
  color: var(--footer-font-color);
  height: var(--footer-height);
  line-height: var(--footer-height);
  font-size: 1.125rem;
  font-family: var(--font-heading);
  font-family: var(--font-heading-weight);
}

footer a {
  text-decoration: none;
}

@media (hover: hover) {
  footer a:focus,
  footer a:hover {
    text-decoration: underline;
  }
}




header a {
  text-decoration: none;
  color: var(--header-font-color);
}

@media (hover: hover) {
  header a:hover {
    background-color: var(--theme-color-hover);
  }
}

header a.active {
  background-color: var(--theme-color-hover);
}

header {
  position: fixed;
  z-index: var(--z-index-on-top);
  left: 0;
  bottom: 0;
  height: var(--header-height);
  width: 100%;
  background-color: var(--header-bg);
  display: flex;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: var(--font-heading-weight);
  border-top: var(--theme-color-border);
}

@media screen and (min-width: 768px) {
  header {
    bottom: auto;
    top: 0;
    font-size: 1.25rem;
    border-top: none;
    border-bottom: var(--theme-color-border);
  }
}

header .content {
  display: flex;
  padding-inline: 0;
  max-width: calc(var(--grid-max-width) - var(--grid-padding) * 2);
  border-right: var(--theme-color-border-light);
}

.theme-toggle-button {
  display: grid;
  place-content: center;
  aspect-ratio: 1 / 1;
  background-color: transparent;
  margin-inline: auto 0;

  svg {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
  }
}

.light .theme-toggle-button svg:last-child {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.dark .theme-toggle-button svg:first-child {
  display: block;
}

/* Mobile nav */
#nav-main {
  flex-grow: 1;
  display: flex;
}

#nav-main ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-grow: 1;
  display: flex;
}

#nav-main li {
  text-align: left;
  color: var(--header-font-color);
  flex-grow: 1;
  display: flex;
  aspect-ratio: 1 / 1;
}

#nav-main a {
  position: relative;
  cursor: pointer;
  flex-grow: 1;
  color: var(--header-font-color);
  border-right: var(--theme-color-border);
  display: grid;
  place-content: center;
  text-decoration: none;
}

#nav-main a.active {
  background-color: var(--theme-color-hover);
}

/* desktop nav */
@media screen and (min-width: 768px) {
  header .content {
    border-left: var(--theme-color-border);
    border-right: var(--theme-color-border);
  }
  
}

header *:focus-visible,
#nav-main a.active:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 0.125rem var(--focus-visible-color);
  border-radius: inherit;
  background-color: var(--theme-color-contrast);
}


.image-wrapper {
  aspect-ratio: 16 / 9;
  display: block;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


table {
  border-spacing: 0;
  
  td, th {
    border: 1px solid var(--theme-color);
    border-right: 0;
    border-bottom: 0;
    padding: 3px 10px;
    
    &:last-child {
      border-right: 1px solid var(--theme-color);
    }
  }
  
  tr:last-child {
    
    td, th {
      border-bottom: 1px solid var(--theme-color);
    }
  }
}


.animes-wrapper {
  position: relative;
  display: flex;
  margin-block: 2rem;
}

.animes {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 473px;
  border: 1px solid var(--font-color);

  a,
  h2 {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--font-color);
    border-top: 0;
    border-right: 0;
    margin: 0;
  }

  a:last-child {
    border-bottom: 0;
  }
}

@media (hover: hover) {
  .animes a:hover {
    background-color: var(--theme-color-contrast);
  }
}

@media screen and (min-width: 768px) {
  .animes-wrapper {
    border: 1px solid var(--font-color);
  }

  .animes {
    border: 0;

    a,
    h2 {
      border-left: 0;
    }
  }

  .anime-banner {
    flex-grow: 1;
    background-image: url("/img/anime.jpg");
    background-position: top center;
    background-size: cover;
  }
}

.anime a:focus-visible {
  outline: 0.125rem solid var(--focus-visible-color);
  outline-offset: 0;
  background-color: var(--theme-color-contrast);
  box-shadow: none;
}


.browsers {
	margin-top: 1rem;
	background: url('../img/browsers.png');
	background-size: 100% auto;
	background-repeat: no-repeat;
	float: left;
	width: 100%;
	aspect-ratio: 960 / 233;
}

.index img {
	margin-bottom: 1rem;
	border-radius: 0.5rem;
}


.resume {
  
  .image-wrapper.aspect-ratio-3-4 {
    aspect-ratio: 3 / 4;
    max-width: 340px;
    margin-bottom: 0.75rem;
    border-radius: 0;
  }

  .img2 {
    display: none;
  }

  .top {
    display: flex;
    flex-direction: column;
  }

  .right {
    flex-grow: 1;
  }

  ul {
    list-style: none;
    margin-bottom: 1rem;
  }

  li {
    margin-bottom: 0.25rem;
  }
  
  table {
    text-align: left;
    margin: 0 auto;
    
    tbody tr td:first-child {
      min-width: 115px;
    }

    td {
      border: 0;
      border-bottom: 1px solid rgba(0,0,0,0.8);
      padding: 5px 10px 5px 0;
    }

    tr:last-child td {
      border-bottom: 0;
    }
  }

  .presentation {
    margin-bottom: 3rem;
  }
}

@media screen and (min-width: 768px) {
  
  .resume {

    .top {
      gap: 1.25rem;
      flex-direction: row;
    }
  
    .right {
      margin-top: -9px;
      font-size: 1.25rem;
    }
  }
}

.presentation,
.education-and-work {
  clear: both;
  float: left;
}


@media print {
  
  html, body {
    width: 210mm;
    height: 297mm; 
    height: auto;
  }
  
  body{
    background-color: #fff;
    background: #fff;
    display: unset;
  }

  * {
    line-height: 1.4;
    color: #000;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  body::before, header, footer, nav, .a4:after {
    display: none !important;
  }

  img {
    page-break-before: always;
  }
  
  main {
    position: relative;
    width: 210mm;
    height: 296.85mm;
    padding: 20mm;
    width: 794px;
    height: auto;
    min-height: auto;
    padding: 77px;
    padding: 20px;
    margin: 0;
    overflow: hidden;
    background: #fff;
    display: unset;
    
    .content {
      padding: 0;
      max-width: 100%;
      display: unset;
    }
  }
  

  /* CV */
  .resume {
    font-size: 18px;

    * {
      line-height: 1.4;
      color: #000;
    }

    img {
      margin-bottom: 20px;
    }
    
    .img1, picture {
      display: none !important;
    }
    
    .img2 {
      display: block;
      border-radius: 2px;
    }
    
    a {
      color: #000;
    }

    .top {
      display: block;
      float: left;
      width: 100%;
    }

    .left {
      width: 350px;
      padding-right: 30px;
    }

    .left, .right {
      float: left;
    }

    .right {
      width: calc(100% - 350px);
      margin-top: -8px;
      font-size: 1.125rem;
    }
    
    .education-and-work {
      display: block;
      float: none;
      clear: both;
      page-break-before: always;
      width: 100%;
      padding-left: 0;
    }
  }
}


@media screen and (max-width: 767px) {
  html .hide-on-mobile {
    display: none;
  }
}

@media screen and (min-width: 768px) {
  html .hide-on-ipad {
    display: none;
  }
}

@media screen and (min-width: 1024px) {
  html .hide-on-desktop {
    display: none;
  }
}
