/* -----------------------

   Bertie Stylesheet
   Simple Styling for bertie.aligbe.co
   Author: Chuck Aligbe - www.dezain.io

   -------------------- */

@import url("https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/metropolis.min.css");
@import url("https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/jetbrains-mono.min.css");

/* -----------------------
   Variables
   -------------------- */

:root {
  /* Turquoise: #0ac2c2 */
  --clr-turque-30: hsl(180 100% 80%);
  --clr-turque-40: hsl(180 100% 60%);
  --clr-turque-50: hsl(180 100% 40%);
  --clr-turque-60: hsl(180 100% 30%);
  --clr-turque-70: hsl(180 100% 20%);

  /* Royal: #0066cc */
  --clr-royal-30: hsl(200 100% 80%);
  --clr-royal-40: hsl(200 100% 60%);
  --clr-royal-50: hsl(200 100% 40%);
  --clr-royal-60: hsl(200 100% 30%);
  --clr-royal-70: hsl(200 100% 20%);

  /* Clement: #ffaa00 */
  --clr-clement-30: hsl(40 100% 80%);
  --clr-clement-40: hsl(40 100% 70%);
  --clr-clement-50: hsl(40 100% 50%);
  --clr-clement-60: hsl(40 100% 40%);
  --clr-clement-70: hsl(40 100% 30%);

  /* Tomate: #ffaa00 */
  --clr-tomate-30: hsl(10 100% 80%);
  --clr-tomate-40: hsl(10 100% 60%);
  --clr-tomate-50: hsl(5 100% 50%);
  --clr-tomate-60: hsl(7 100% 40%);
  --clr-tomate-70: hsl(8 100% 30%);

  /* Monochrome: #999999 */
  --clr-mono-30: hsl(0 0% 90%);
  --clr-mono-40: hsl(0 0% 80%);
  --clr-mono-50: hsl(0 0% 60%);
  --clr-mono-60: hsl(0 0% 40%);
  --clr-mono-70: hsl(0 0% 20%);

  /* Color Tokens */
  --clr-surface: var(--clr-mono-30);
  --clr-surface-alt: hsl(from var(--clr-clement-30) h s 95%);

  --clr-contrast: var(--clr-mono-70);
  --clr-contrast-alt: #666;

  --clr-primary: var(--clr-turque-50);
  --clr-primary-light: var(--clr-turque-30);
  --clr-primary-dark: var(--clr-turque-70);

  --clr-secondary: var(--clr-royal-50);
  --clr-secondary-light: var(--clr-royal-30);
  --clr-secondary-dark: var(--clr-royal-70);

  --clr-error: var(--clr-tomate-50);
  --clr-error-light: var(--clr-tomate-30);
  --clr-error-dark: var(--clr-tomate-70);

  --body-type: "Metropolis", Inter, system-ui, Helvetica, Arial, sans-serif;
  --mono-type: "JetBrains Mono", ui-monospace, Monaco, Courier, monospace;

}

/* -----------------------
   CSS Reset
   -------------------- */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* -----------------------
   Global Styles
   -------------------- */

body {
  background-color: var(--clr-surface-alt);
  color: #222;
  font-family: var(--body-type);
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem;
}

header {
  margin-bottom: 2rem;
}

main, section, article {
  margin-bottom: 2rem;
}

:is(main, section, article) > *:last-child {
  margin-bottom: 0;
}

.site-wrapper {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.site-wrapper > :is(header, footer) {
  width: 100%;
  flex: 0 0 auto;
}

.site-wrapper > main {
  width: 100%;
  flex: 2 0 auto;
}

header#header {
  text-align: center;
}

#header h1 {
  font-size: 2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4ch;
}

nav#site-nav {
  width: 100%;
  font-size: 1.25rem;
}

.nav-list,
nav > menu,
nav > .menu,
nav > [role="menu"] {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    margin-bottom: 1rem;
    padding: 0;
    justify-content: center;
}

.site-wrapper > main {
  max-width: min(50rem, 100% - 3rem);
  margin-inline: auto;
}

body#home .site-wrapper > main {
  max-width: 90rem;
}

a {
  font-weight: bold;
  color: var(--clr-royal-50);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover, a:focus {
  opacity: 0.75;
  text-decoration: underline;
}

footer#footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

@media screen and (min-width: 80rem) {
  body {
    font-size: 1.2rem;
  }
}


/* -----------------------
   Typography Styles
   -------------------- */

p {
  margin-block: 0 1rem;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--clr-contrast);
  margin-block: 0.5rem 1.5rem;
  line-height: 1.2;
  font-weight: 800;
}

h1 {
  font-size: calc(1rem * pow(1.2, 5));
}

h2 {
  font-size: calc(1rem * pow(1.2, 4));
}

h3 {
  font-size: calc(1rem * pow(1.2, 3));
}

h4 {
  font-size: calc(1rem * pow(1.2, 2));
}

h5 {
  font-size: 1.2rem;
}

h6 {
  font-size: 1rem;
  text-transform: uppercase;
}

blockquote {
  margin: 0.5rem;
  padding: 0 1rem;
  border-left: 4px solid var(--clr-contrast-alt);
}

ul, ol {
  line-height: 2;
  padding-inline-start: 2.5rem;
}

:is(ul, ol) li {
  padding-inline-start: 0.25rem;
}

*:not(li, dt) > :where(dl, ul, ol, menu) {
    margin-bottom: 1rem;
}

dt {
    font-weight: bold;
}

dt:not(:first-of-type) {
    margin-block-start: 1rem;
}

dd {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-inline-start: 2.5rem;
}

hr {
    margin-block: 0.5rem;
    border: none;
    border-top: 2px solid var(--clr-mono-50);
}

samp,
pre,
code,
kbd {
    font-family: var(--mono-type);
}

caption,
figcaption,
.caption {
    font-size: 0.8em;
    font-style: italic;
}

@media screen and (min-width: 40rem) {
  h1 {
    font-size: calc(1rem * pow(1.25, 5));
  }

  h2 {
    font-size: calc(1rem * pow(1.25, 4));
  }

  h3 {
    font-size: calc(1rem * pow(1.25, 3));
  }

  h4 {
    font-size: calc(1rem * pow(1.25, 2));
  }

  h5 {
    font-size: 1.25rem;
  }
}

/* -----------------------
   Image Styles
   -------------------- */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle; /* Prevents extra space below image */
}

figure {
    max-width: 100%;
    margin-block: 1rem;
}

figure > img {
  margin-inline: auto;
}

figcaption {
    margin-block: 0.5rem;
    text-align: center;
}




/* -----------------------
   Homepage Styles
   -------------------- */

#header hr {
  max-width: min(25rem, 100% - 8rem);
  margin-inline: auto;
}

.two-cols .col:first-of-type {
  margin-bottom: 2rem;
}

section > .container {
  max-width: min(50rem, 100%);
  margin-inline: auto;
}

#hero .col:last-of-type {
  padding-block: 1rem 2rem;
}

#hero h2 {
  font-size: 3rem;
  margin-block: 0.5rem;
}

#hero .subheading {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

#hero .tagline {
  font-size: 1.25rem;
  line-height: 1.8;
}

#about, #works {
  padding: 2rem 1.5rem;
  background-color: hsl(from var(--clr-primary) h 40 85);
}

#works {
  font-size: 1.1rem;
}

#contact {
  font-size: 1.25rem;
}

.contact-item {
  display: flex;
  gap: 0.5em;
}

.contact-item img {
  width: 1.25em;
  height: 1.25em;
}

@media screen and (min-width: 50rem) {
  .two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .col:has(:not(img)) {
    padding: 2rem;
  }

  #hero .col:last-of-type {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  #hero h2 {
    font-size: 4rem;
  }

  #hero .subheading {
    font-size: 1.5rem;
  }

  #hero .tagline {
    font-size: 1.5rem;
  }

  #works {
    font-size: 1.25rem;
  }

  #contact {
    font-size: 1.5rem;
  }

  #contact h2 {
    font-size: 3rem;
  }

  #contact .col:first-of-type {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* -----------------------
   Posts Styles
   -------------------- */

ul#articles {
  padding: 0 2rem;
  list-style: none;
}

#articles li {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.125rem;
  border-bottom: 2px dotted var(--clr-mono-50);
  margin-bottom: 0.5rem;
}

.article-header h2 {
  margin-bottom: 1rem;
}

.article-header .meta {
  color: var(--clr-mono-50);
}

.article-footer {
  color: var(--clr-mono-50);
  font-style: italic;
  text-align: right;
  margin-block: 2rem;
}
