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

:root {
  /* Scale variables */
  --scale-xs: clamp(32px, 3rem, 64px); /* 48px */
  --scale-sm: clamp(36px, 3.375rem, 72px); /* 54px */
  --scale-md: clamp(40px, 3.75rem, 80px); /* 60px */
  --scale-lg: clamp(44px, 4.125rem, 88px); /* 66px */
  --scale-xl: clamp(48px, 4.5rem, 96px); /* 72px */
  --scale-2xl: clamp(56px, 5.25rem, 112px); /* 84px */
  --scale-3xl: clamp(64px, 6rem, 128px); /* 96px */

  /* Space variables */
  --space-2xs: 0.5rem; /* 8px */
  --space-xs: 1rem; /* 16px */
  --space-sm: 1.5rem; /* 24px */
  --space-md: 2rem; /* 32px */
  --space-lg: 2.5rem; /* 40px */
  --space-xl: 3rem; /* 48px */

  /* Font size variables */
  --font-size-xs: clamp(12px, 0.875rem, 28px); /* 14px */
  --font-size-sm: clamp(14px, 1rem, 32px); /* 16px */
  --font-size-md: clamp(18px, 1.25rem, 40px); /* 20px */
  --font-size-lg: clamp(22px, 1.5rem, 48px); /* 24px */
  --font-size-hero: clamp(2.5rem, 12vw, 15rem); /* Name heading */

  --max-width: 2000px;
  --gutter: clamp(20px, 3.5vw, 80px);

  --background: #0d0d0d;
  --background-rgb: 13, 13, 13;

  --text: #fff;
  --text-rgb: 255, 255, 255;

  --accent: #008b90;
  --accent-rgb: 0, 139, 144;

  --header-height: var(--scale-xl);

  /* Typography tokens */
  --letter-spacing-tight: 0.3px;
  --letter-spacing-wide: 1px;

  --line-height-tight: 0.9;
  --line-height-normal: 1.5;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Border tokens */
  --border-width: 2px;
  --border-color: #e3e3e3;
  --border-radius-full: 999px;
  --outline-width: 2px;
  --outline-offset: 2px;
}

/* ===========================
   General Styles
   =========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none;
    animation: none;
  }
}

@supports (font: -apple-system-body) {
  html {
    font: -apple-system-body;
  }
}

html {
  font-family: "Be Vietnam Pro", "Roboto", sans-serif;
}

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

body {
  overflow-x: hidden;

  min-height: 100vh;

  background: var(--background);

  color: var(--text);
  font-size: var(--font-size-md);
}

.site-container {
  position: relative;

  overflow: hidden;

  max-width: var(--max-width);
  min-height: 100vh;

  margin: 0 auto;

  background-image: url("../assets/images/headshot.png");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
}

header,
main {
  position: relative;
  z-index: 1;

  max-width: var(--max-width);
  margin: 0 auto;
}

iconify-icon {
  display: inline-block;

  width: 1em;
  height: 1em;
}

/* ===========================
   Anchor Styles
   =========================== */

/* Default styles */
a {
  --font-size: var(--font-size-sm);
  --min-height: var(--scale-xs);
  --padding: 0 var(--space-sm);

  position: relative;

  display: inline-flex;

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

  min-height: var(--min-height);
  padding: var(--padding);

  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-full);

  color: var(--text);

  font-size: var(--font-size);

  letter-spacing: var(--letter-spacing-tight);
  text-decoration: none;

  white-space: nowrap;

  cursor: pointer;

  transition: background-color 0.3s ease-in-out;

  gap: var(--space-xs);
}

/* Clear styles: icon only on small screens */
a.clear {
  --font-size: var(--font-size-lg);

  min-height: 2em;
  padding: 0;

  aspect-ratio: 1 / 1;
}

/* Outline styles: all screen sizes */
a.outline {
  border-color: rgba(var(--text-rgb), 0.6);

  background: rgba(var(--background-rgb), 0.6);

  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

/* Hover styles */
a:hover {
  background-color: rgba(var(--text-rgb), 0.12);
}

/* Active styles (pointer down) */
a:active {
  background: rgba(var(--text-rgb), 0.08);
}

/* Visible focus for keyboard navigation */
a:focus-visible {
  border-color: var(--border-color);
  outline: var(--outline-width) solid transparent;
  outline-offset: var(--outline-offset);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.5),
    0 0 12px rgba(255, 255, 255, 0.3);
}

/* ===========================
   Header
   =========================== */

header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  width: 100%;
  min-height: var(--header-height);

  padding: var(--space-2xs) var(--gutter);
}

header .content {
  display: flex;

  align-items: center;
  justify-content: space-between;

  width: 100%;
}

header img {
  width: var(--scale-lg);
  height: var(--scale-lg);
  object-fit: contain;
}

header ul {
  display: flex;

  flex-wrap: wrap;

  align-items: center;
  justify-content: space-between;
  list-style: none;
  gap: var(--space-2xs);

  margin: 0;
}

header li {
  display: flex;
}

header ul a .link-text {
  display: none;
}

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

main section {
  display: flex;

  flex-flow: column;
  justify-content: start;

  min-height: calc(100vh - var(--header-height));
  padding: var(--gutter);

  text-align: center;
}

main h1 {
  margin: 0;

  font-family: "Panamera", "Helvetica Neue", sans-serif;
  font-size: var(--font-size-hero);
  line-height: var(--line-height-tight);
}

main p {
  line-height: var(--line-height-normal);
}

main h1,
main p {
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.7),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

/*
 * Apply extra margin to the contact button to account for
 * the background image on smaller screens
 */
main #contact-button {
  margin-bottom: 400px;
}

/* ===========================
   Media Queries
   =========================== */

/* X-small screens */
@media (max-width: 365px) {
  header img {
    width: var(--scale-sm);
  }

  header ul {
    padding: 0;
    gap: 0;
  }
}

/* Tablets */
@media (min-width: 768px) {
  header .content {
    width: auto;
  }
}

/* Laptops and Desktops */
@media (min-width: 1025px) {
  :root {
    --header-height: var(--scale-3xl);
  }

  a {
    --min-height: var(--scale-sm);
  }

  .site-container {
    background-position: calc(100% + 4rem) bottom;
  }

  header ul {
    display: flex;

    padding: 0 var(--space-md);

    gap: initial;
  }

  /* Display label with icons on larger screens */
  header ul a .link-text {
    display: inline;
  }

  /* Clear the icon only styles when label is visible */
  a.clear {
    --font-size: var(--font-size-md);

    min-height: var(--min-height);
    padding: var(--padding);

    aspect-ratio: auto;
  }

  main section {
    justify-content: center;

    max-width: 50%;

    text-align: start;
    gap: var(--space-md);
  }
}

/* Large desktops */
@media (min-width: 1600px) {
  .site-container {
    background-position: right bottom;
  }
}
