/* =========================================================
   Nook
   Minimal / retro web base UI
========================================================= */


/* =========================================================
   Fonts
========================================================= */

@font-face {
  font-family: "Medodica";
  src: url("https://gobbo.ca/static/fonts/MedodicaRegular.otf")
    format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nihonium";
  src: url("https://gobbo.ca/static/fonts/Nihonium113.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* =========================================================
   Variables
========================================================= */

:root {
  --background: #ffffff;
  --surface: #fafafa;
  --border: #e8e8e8;

  --text: #171717;
  --muted: #888888;

  --sidebar-width: 190px;

  --body-font: "Medodica", sans-serif;
  --heading-font: "Nihonium", sans-serif;
}


/* =========================================================
   Dark mode
========================================================= */

html.dark {
  --background: #111111;
  --surface: #191919;
  --border: #2a2a2a;

  --text: #eeeeee;
  --muted: #acacac;
}


/* =========================================================
   Reset
========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;

  background: var(--background);
  color: var(--text);

  font-family: var(--body-font);
  font-size: 25px;
  line-height: 1.6;

  transition:
    background 0.2s ease,
    color 0.2s ease;
}

button,
input,
textarea,
select,
option {
  font-family: var(--body-font);
  font-size: inherit;
  line-height: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   Headings
   Nihonium everywhere
========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;

  font-family: var(--heading-font);
  font-weight: 400;
  line-height: 1.15;
}


/* =========================================================
   App
========================================================= */

.app {
  width: 100%;
  min-height: 100vh;
}


/* =========================================================
   Sidebar
========================================================= */

.sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  width: var(--sidebar-width);

  padding: 15px;

  border-right: 1px solid var(--border);

  background: var(--background);

  display: flex;
  flex-direction: column;

  text-align: left;

  z-index: 100;

  overflow-y: auto;
}


/* =========================================================
   Logo
========================================================= */

.logo {
  display: block;

  width: 100%;

  padding: 4px 10px;
  margin-bottom: 28px;

  color: var(--text);
}

.logo h1 {
  margin: 0;

  font-family: var(--heading-font);
  font-size: 42px;
  line-height: 0.9;
}

.logo h6 {
  margin: 7px 0 0;

  font-family: var(--heading-font);
  font-size: 15px;
  line-height: 1;

  color: var(--muted);
}


/* =========================================================
   Navigation
========================================================= */

.nav {
  display: flex;
  flex-direction: column;

  gap: 2px;

  width: 100%;
}

.nav__link {
  display: flex;
  align-items: center;

  width: 100%;

  gap: 10px;

  padding: 9px 10px;

  border-radius: 7px;

  color: var(--muted);

  font-family: var(--body-font);
  font-size: 20px;
  line-height: 1.3;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav__link:hover,
.nav__link.active {
  background: var(--surface);
  color: var(--text);
}

.nav__link span:first-child {
  width: 22px;
  min-width: 22px;

  flex: 0 0 22px;

  text-align: center;
}


/* =========================================================
   Sidebar Bottom
========================================================= */

.sidebar__bottom {
  width: 100%;

  margin-top: auto;

  display: flex;
  flex-direction: column;

  gap: 4px;
}

.theme-toggle {
  width: 100%;

  padding: 9px 10px;

  border: 0;
  border-radius: 7px;

  background: transparent;

  color: var(--muted);

  font-family: var(--body-font);
  font-size: 20px;

  text-align: left;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface);
  color: var(--text);
}


/* =========================================================
   Main
========================================================= */

.main {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;

  margin-left: var(--sidebar-width);

  padding: 45px 55px;
}

.page {
  width: 100%;
  max-width: 1000px;

  margin: 0 auto;
}


/* =========================================================
   Page headings
========================================================= */

.page h1 {
  margin-bottom: 32px;
  font-size: 88px;
}

.page h2 {
  margin-top: 64px;
  margin-bottom: 22px;
  font-size: 56px;
}

.page h3 {
  margin-top: 48px;
  margin-bottom: 18px;
  font-size: 40px;
}

.page h4 {
  margin-top: 36px;
  margin-bottom: 15px;
  font-size: 32px;
}

.page h5 {
  margin-top: 30px;
  margin-bottom: 12px;
  font-size: 28px;
}

.page h6 {
  margin-top: 26px;
  margin-bottom: 10px;
  font-size: 25px;
}


/* =========================================================
   Body text
========================================================= */

.page p,
.page li,
.page dt,
.page dd,
.page blockquote,
.page figcaption,
.page address,
.page label,
.page legend {
  font-family: var(--body-font);
  font-size: 25px;
  line-height: 1.6;
}

.page p {
  margin-top: 0;
  margin-bottom: 28px;
}


/* =========================================================
   Lists
========================================================= */

.page ul,
.page ol {
  margin: 28px 0;
  padding-left: 42px;
}

.page li {
  margin-bottom: 10px;
}

.page li:last-child {
  margin-bottom: 0;
}


/* =========================================================
   Links
========================================================= */

.page a {
  font-family: inherit;
  font-size: inherit;
}

.page a:hover {
  text-decoration: underline;
}


/* =========================================================
   Quotes
========================================================= */

.page blockquote {
  margin: 35px 0;
  padding-left: 25px;

  border-left: 3px solid currentColor;
}


/* =========================================================
   Inline text
========================================================= */

.page strong,
.page b {
  font-family: var(--body-font);
  font-weight: 700;
}

.page em,
.page i {
  font-family: var(--body-font);
}

.page mark {
  font-family: var(--body-font);

  color: inherit;
  background: var(--surface);
}

.page small {
  font-family: var(--body-font);
  font-size: 20px;
  line-height: 1.5;
}


/* =========================================================
   Definition lists
========================================================= */

.page dt {
  font-weight: 700;
}

.page dd {
  margin-left: 0;
  margin-bottom: 20px;
}


/* =========================================================
   Code
========================================================= */

.page code,
.page kbd,
.page pre,
.page samp {
  font-family: monospace;
}

.page code,
.page kbd {
  font-size: 22px;
}

.page pre {
  max-width: 100%;

  margin: 30px 0;
  padding: 22px;

  overflow-x: auto;

  font-size: 22px;
  line-height: 1.5;
}


/* =========================================================
   Tables
========================================================= */

.page table {
  width: 100%;

  margin: 35px 0;

  border-collapse: collapse;

  font-family: var(--body-font);
  font-size: 23px;
}

.page th,
.page td {
  padding: 15px 18px;

  font-family: var(--body-font);
  font-size: inherit;

  text-align: left;
  vertical-align: top;
}

.page th {
  font-weight: 700;
}


/* =========================================================
   Forms
========================================================= */

.page label {
  display: block;

  margin-bottom: 9px;
}

.page input,
.page textarea,
.page select {
  width: 100%;

  padding: 10px 12px;

  border: 1px solid var(--border);
  border-radius: 7px;

  outline: none;

  background: var(--background);
  color: var(--text);

  font-family: var(--body-font);
  font-size: 25px;
  line-height: 1.4;
}

.page input:focus,
.page textarea:focus,
.page select:focus {
  border-color: var(--muted);
}

.page button {
  font-family: var(--body-font);
  font-size: 25px;
}

.page textarea {
  min-height: 180px;
  resize: vertical;
}


/* =========================================================
   Fieldsets
========================================================= */

.page fieldset {
  margin: 30px 0;
  padding: 20px;

  border: 1px solid var(--border);
}

.page legend {
  padding: 0 8px;
}


/* =========================================================
   Images / media
========================================================= */

.page img,
.page video,
.page iframe,
.page svg {
  max-width: 100%;
  height: auto;
}

.page figcaption {
  margin-top: 10px;
}


/* =========================================================
   Horizontal rule
========================================================= */

.page hr {
  margin: 50px 0;

  border: 0;
  border-top: 1px solid var(--border);
}


/* =========================================================
   Details / summary
========================================================= */

.page details,
.page summary {
  font-family: var(--body-font);
  font-size: 25px;
}

.page summary {
  cursor: pointer;
}


/* =========================================================
   Muted
========================================================= */

.muted,
.page .muted {
  color: var(--muted);
}


/* =========================================================
   Buttons
========================================================= */

.page button,
.button {
  cursor: pointer;
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 700px) {

  :root {
    --sidebar-width: 58px;
  }


  /* =======================================================
     Mobile sidebar
  ======================================================= */

  .sidebar {
    width: var(--sidebar-width);

    padding: 12px 6px;

    align-items: center;

    overflow-x: hidden;
  }


/* =======================================================
   Mobile logo
======================================================= */

.logo {
  display: block;
  color: var(--text);
}

.logo h1,
.logo h6 {
  margin: 0;
}


/* Normal desktop logo */

.logo h1 {
  font-family: var(--heading-font);
  font-size: 42px;
  line-height: 0.9;
}

.logo h6 {
  margin-top: 7px;

  font-family: var(--heading-font);
  font-size: 15px;
  line-height: 1;

  color: var(--muted);
}


/* =======================================================
   Mobile logo
======================================================= */

@media (max-width: 700px) {

  .logo {
    width: 44px;
    height: 90px;

    margin-bottom: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: visible;
  }

  .logo h1 {
    margin: 0;

    font-size: 30px;
    line-height: 1;

    /*
      Rotate the actual word rather than using
      writing-mode so Nihonium keeps its shape.
    */
    transform: rotate(-90deg);

    white-space: nowrap;
  }

  .logo h6 {
    display: none;
  }

}


  /* -------------------------------------------------------
     Mobile navigation
  ------------------------------------------------------- */

  .nav {
    width: 100%;

    align-items: center;
  }

  .nav__link {
    width: 44px;
    height: 44px;

    padding: 0;

    justify-content: center;

    border-radius: 8px;

    font-size: 20px;
  }

  .nav__link span:first-child {
    width: auto;
    min-width: 0;

    flex: 0 0 auto;
  }

  .nav__link span:last-child {
    display: none;
  }


  /* -------------------------------------------------------
     Mobile sidebar bottom
  ------------------------------------------------------- */

  .sidebar__bottom {
    width: 100%;

    align-items: center;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
  }


  /* =======================================================
     Mobile main
  ======================================================= */

  .main {
    width: calc(100% - var(--sidebar-width));

    margin-left: var(--sidebar-width);

    padding: 28px 18px 40px;
  }

  .page {
    width: 100%;
    max-width: none;
  }


  /* =======================================================
     Mobile headings
  ======================================================= */

  .page h1 {
    margin-bottom: 25px;
    font-size: 48px;
  }

  .page h2 {
    margin-top: 48px;
    margin-bottom: 18px;
    font-size: 38px;
  }

  .page h3 {
    margin-top: 38px;
    margin-bottom: 15px;
    font-size: 32px;
  }

  .page h4 {
    margin-top: 30px;
    margin-bottom: 13px;
    font-size: 28px;
  }

  .page h5 {
    margin-top: 26px;
    margin-bottom: 11px;
    font-size: 25px;
  }

  .page h6 {
    margin-top: 24px;
    margin-bottom: 10px;
    font-size: 22px;
  }


  /* =======================================================
     Mobile body text
  ======================================================= */

  .page p,
  .page li,
  .page dt,
  .page dd,
  .page blockquote,
  .page figcaption,
  .page address,
  .page label,
  .page legend {
    font-size: 22px;
    line-height: 1.55;
  }

  .page p {
    margin-bottom: 22px;
  }


  /* =======================================================
     Mobile lists
  ======================================================= */

  .page ul,
  .page ol {
    margin: 22px 0;
    padding-left: 30px;
  }

  .page li {
    margin-bottom: 8px;
  }


  /* =======================================================
     Mobile small text
  ======================================================= */

  .page small {
    font-size: 18px;
  }


  /* =======================================================
     Mobile code
  ======================================================= */

  .page code,
  .page kbd {
    font-size: 19px;
  }

  .page pre {
    padding: 16px;

    font-size: 18px;
  }


  /* =======================================================
     Mobile tables
  ======================================================= */

  .page table {
    display: block;

    width: 100%;

    overflow-x: auto;

    font-size: 20px;
  }

  .page th,
  .page td {
    padding: 11px 13px;

    font-size: 20px;
  }


  /* =======================================================
     Mobile forms
  ======================================================= */

  .page label {
    font-size: 21px;
  }

  .page input,
  .page textarea,
  .page select,
  .page button {
    font-size: 21px;
  }

  .page textarea {
    min-height: 150px;
  }


  /* =======================================================
     Mobile other
  ======================================================= */

  .page blockquote {
    padding-left: 18px;
  }

  .page hr {
    margin: 35px 0;
  }

  .page details,
  .page summary {
    font-size: 22px;
  }
}


/* =========================================================
   Very small phones
========================================================= */

@media (max-width: 380px) {

  :root {
    --sidebar-width: 52px;
  }

  .sidebar {
    padding-left: 4px;
    padding-right: 4px;
  }

  .nav__link,
  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .logo h1 {
    font-size: 24px;
  }

  .main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page h1 {
    font-size: 42px;
  }

  .page h2 {
    font-size: 34px;
  }

  .page h3 {
    font-size: 29px;
  }

  .page h4 {
    font-size: 26px;
  }

  .page h5 {
    font-size: 23px;
  }

  .page h6 {
    font-size: 21px;
  }

  .page p,
  .page li,
  .page dt,
  .page dd,
  .page blockquote,
  .page figcaption,
  .page address,
  .page label,
  .page legend {
    font-size: 20px;
  }
}
