/* CSS reset --------------------------------------------------------------- */

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Page setup -------------------------------------------------------------- */

html {
  --os2g-red: #f00;
  --os2g-blue: #69f;
  --os2g-text: light-dark(#222, #ccd);
  --os2g-faded-text: light-dark(#889, #889);
  --os2g-bg: light-dark(#fff, #000);
  --os2g-bg2: light-dark(#eeeef0, #1a1a22);
  --os2g-error: light-dark(#c44, #c44);
  --os2g-highlight: light-dark(var(--os2g-red), var(--os2g-blue));

  --os2g-font-family: Outfit, sans-serif;
  --os2g-rule-width: 2px;

  font: 13pt var(--os2g-font-family);
  line-height: 1.5;
  color: var(--os2g-text);
  background: var(--os2g-bg);
  hyphens: auto;
}

body {
  padding: 1rem;
  margin: auto;

  max-width: 50rem;
  min-height: 100vh;

  display: grid;
  grid-template:
    "nav" min-content
    "head" min-content
    "main" 1fr
    "foot" min-content
    / 1fr;
}

header {
  grid-area: head;
  text-align: center;
  margin-block: 2rem;
}

nav {
  grid-area: nav;
  text-align: center;
}

nav button {
  border-radius: 8px;
  border: none;
  background: none;

  color: var(--os2g-highlight);
  font: 1.1rem var(--os2g-font-family);

  padding: 0.3rem;
}

nav button:hover {
  background: var(--os2g-bg2);
}

nav button:active {
  color: var(--os2g-bg);
  background: var(--os2g-highlight);
}

main {
  grid-area: main;
}

footer {
  grid-area: foot;

  text-align: center;
  font-size: 0.8rem;
  margin-top: 4rem;
}

@media (width > 50rem) {
  body {
    grid-template:
      "head head" min-content
      "main nav" 1fr
      "foot foot" min-content
      / 1fr min-content;
  }

  nav {
    border-left: var(--os2g-rule-width) solid var(--os2g-highlight);
    padding-left: 1rem;
    margin-left: 1rem;
  }

  nav form {
    position: sticky;
    top: 1rem;
  }

  nav button {
    display: block;
    width: 100%;
  }
}

/* Element formatting ------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  line-height: 1.2;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li {
  margin-block: 0.5rem;
}

a {
  text-decoration: none;
  white-space: nowrap;

  color: var(--os2g-highlight);

  &:hover {
    text-decoration: underline 0.1rem solid var(--os2g-highlight);
  }

  &.hidden-link {
    color: var(--os2g-text);

    &:hover {
      text-decoration: none;
    }
  }
}

button {
  cursor: pointer;
  padding: 0.25rem;
  border: var(--os2g-rule-width) solid var(--os2g-highlight);
  border-radius: 0.5rem;
  color: var(--os2g-text);
  background: none;
  font: 0.9rem / 1.2 var(--os2g-font-family);
}

button:hover {
  background: var(--os2g-bg2);
}

button:active {
  background: var(--os2g-highlight);
  border-color: var(--os2g-bg);
  color: var(--os2g-bg);
}

ul,
ol {
  margin-left: 2ch;
}

ul {
  list-style-type: " - ";
}

ul.inline {
  margin: 0;
}

ul.inline li {
  display: block;
  margin: 0;
}

ul.inline li::before {
  content: " | ";
  color: var(--os2g-highlight);
}

@media (width > 50rem) {
  ul.inline li {
    display: inline;
  }

  ul.inline li:first-child::before {
    content: none;
  }
}

section + section {
  margin-top: 2rem;
}

input[type="text"],
textarea,
label {
  display: block;
}

input[type="text"],
textarea {
  padding: 0.5rem;
  font: 0.9rem / 1.2 var(--os2g-font-family);
  border: var(--os2g-rule-width) solid var(--os2g-faded-text);
  color: var(--os2g-text);
  background: none;
  border-radius: 0.5rem;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  margin: 0.5rem;
}

dl.schedule {
  display: grid;
  grid-template-columns: min-content 1fr;

  dt,
  dd {
    padding: 0.1rem 0.5rem;
  }

  dt {
    white-space: nowrap;
    color: var(--os2g-faded-text);
    padding-right: 1rem;

    &:nth-child(4n + 1) {
      background: var(--os2g-bg2);
    }
  }

  dd {
    border-left: var(--os2g-rule-width) solid var(--os2g-highlight);
    padding-left: 1rem;

    &:nth-child(4n - 2) {
      background: var(--os2g-bg2);
    }
  }
}

figure {
  text-align: center;
  padding: 0.5rem;
}

figcaption {
  font-size: 0.8rem;
  color: var(--os2g-faded-text);
}

/* Classes ----------------------------------------------------------------- */

*.text-error {
  color: var(--os2g-error);
}

*.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (width > 50rem) {
  *.float-right {
    float: right;
  }
}

/* Profile ----------------------------------------------------------------- */

section.profile {
  display: grid;
  column-gap: 1rem;
  align-items: start;
  max-width: 30rem;
  margin-inline: auto;
  grid-template:
    "name  img" min-content
    "meta  img" 1fr
    "bio   bio" min-content
    "links links" min-content
    / 1fr 150px;

  @media (width > 50rem) {
    max-width: 100%;
    padding: 1rem;
    grid-template:
      "name img" min-content
      "meta img" min-content
      "bio  img" 1fr
      "bio  links" min-content
      / 1fr 150px;
  }
}

h3.profile-name {
  grid-area: name;
  margin-bottom: 0;
}

section.alumni h3.profile-name::after {
  content: " Alumni";
  color: var(--os2g-faded-text);
}

ul.profile-meta {
  grid-area: meta;
}

img.profile-pic {
  grid-area: img;
  border-radius: 1rem;
}

p.profile-bio {
  grid-area: bio;
}

ul.profile-linktree {
  grid-area: links;
  margin: 0;
}

ul.profile-linktree:not(:empty)::before {
  content: "Links: ";
}

ul.profile-linktree li {
  margin: 0;
  display: inline;
}

ul.profile-linktree li + li::before {
  content: " & ";
}

@media (width > 50rem) {
  ul.profile-linktree::before {
    display: block;
    margin-top: 0.5rem;
  }

  ul.profile-linktree li {
    display: block;
  }

  ul.profile-linktree li::before,
  ul.profile-linktree li + li::before {
    content: " - ";
  }
}

/* Profile Form ------------------------------------------------------------ */

form.profile-form {
  display: grid;
  gap: 1rem;

  grid-template:
    "name name" min-content
    "major major" min-content
    "bio bio" min-content
    "links links" min-content
    "role role" min-content
    "joined joined" min-content
    "imgpath imgpath" min-content
    "isalumni isalumni" min-content
    "copy download" min-content
    "profile profile" min-content
    / 1fr 1fr;

  @media (width > 50rem) {
    grid-template:
      "name role" min-content
      "major joined" min-content
      "bio bio" min-content
      "links imgpath" min-content
      "links isalumni" 1fr
      "copy download" min-content
      "profile profile" min-content
      / 1fr 1fr;
  }
}

*[name="name"] {
  grid-area: name;
}

*[name="major"] {
  grid-area: major;
}

*[name="bio"] {
  grid-area: bio;
}

*[name="role"] {
  grid-area: role;
}

*[name="joined"] {
  grid-area: joined;
}

label.for-alumni {
  grid-area: isalumni;
}

*[name="img-path"] {
  grid-area: imgpath;
}

*[name="profile"] {
  grid-area: profile;
}

button.profile-form-copy {
  grid-area: copy;
}

button.profile-form-download {
  grid-area: download;
}

ul.profile-form-links {
  grid-area: links;
  position: relative;
  margin-left: 0;
}

ul.profile-form-links::before {
  content: "Links: ";
}

ul.profile-form-links li {
  display: grid;
  gap: 0.5rem;

  grid-template:
    "linkhref" min-content
    "linktext" min-content
    "removelink" min-content
    / 1fr;
}

button.add-link {
  position: absolute;
  top: 0;
  right: 0;
}

*[name="link-text"] {
  grid-area: linktext;
}

*[name="link-href"] {
  grid-area: linkhref;
}

button.remove-link {
  grid-area: removelink;
}

/* Animations -------------------------------------------------------------- */

@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

*.kf-fadein {
  opacity: 0;
  animation: fadein 0.5s forwards;
}

@keyframes fromleft {
  from {
    opacity: 0;
    left: -1rem;
  }
  to {
    opacity: 1;
    left: 0;
  }
}

*.kf-fromleft {
  position: relative;
  animation: fromleft 0.5s;
}

*.kf-fromleft-container > * {
  position: relative;
  animation: fromleft 0.5s;
}

@keyframes fromright {
  from {
    opacity: 0;
    right: -1rem;
  }
  to {
    opacity: 1;
    right: 0;
  }
}

*.kf-fromright {
  position: relative;
  animation: fromright 0.5s;
}

@keyframes fromtop {
  from {
    opacity: 0;
    top: -1rem;
  }
  to {
    opacity: 1;
    top: 0;
  }
}

*.kf-fromtop {
  position: relative;
  animation: fromtop 0.5s;
}

@keyframes frombottom {
  from {
    opacity: 0;
    bottom: -1rem;
  }
  to {
    opacity: 1;
    bottom: 0;
  }
}

*.kf-frombottom {
  position: relative;
  animation: frombottom 0.5s;
}

@keyframes slowfade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

*.kf-slowfade {
  animation: slowfade 1s;
}

/* Glitch animation from <https://alvarotrigo.com/blog/css-text-animations/> */
@keyframes glitch {
  0% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  1% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  2% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  3% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  4% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  5% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  6% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  7% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  8% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  9% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  10% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  11% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  12% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  13% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  14% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  15% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  16% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  17% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  18% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  19% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  20% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  21% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  22% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  23% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  24% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  25% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  26% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0.5px);
  }
  27% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0.5px);
  }
  28% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  29% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  30% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  31% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  32% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  33% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  34% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  35% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  36% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  37% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  38% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  39% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  40% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  41% {
    text-shadow: 45px 0 0 #0c33f5, -45px 0 0 lime;
    filter: blur(0);
  }
  42% {
    text-shadow: 0 0 0 #0c33f5, 0 0 0 lime;
    filter: blur(0);
  }
  43% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  44% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  45% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  46% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  47% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  48% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  49% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  50% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  51% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  52% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  53% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  54% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  55% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0.5px);
  }
  56% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0.5px);
  }
  57% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0.5px);
  }
  58% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  59% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  60% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  61% {
    text-shadow: 30px 0 0 red, -30px 0 0 lime;
    filter: blur(0);
  }
  62% {
    text-shadow: 0 0 0 red, 0 0 0 lime;
    filter: blur(0);
  }
  63% {
    text-shadow: 1px 0 0 red, -1px 0 0 #0c33f5;
    filter: blur(0);
  }
  64% {
    text-shadow: 1px 0 0 red, -1px 0 0 #0c33f5;
    filter: blur(0);
  }
  65% {
    text-shadow: 1px 0 0 red, -1px 0 0 #0c33f5;
    filter: blur(0);
  }
  66% {
    text-shadow: 1px 0 0 red, -1px 0 0 #0c33f5;
    filter: blur(0.5px);
  }
  67% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0.5px);
  }
  68% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  69% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  70% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  71% {
    text-shadow: 50px 0 0 red, -50px 0 0 #0c33f5;
    filter: blur(0);
  }
  72% {
    text-shadow: 0 0 0 red, 0 0 0 #0c33f5;
    filter: blur(0);
  }
  73% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  74% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  75% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  76% {
    text-shadow: 3px 0 0 red, -3px 0 0 #0c33f5;
    filter: blur(0);
  }
  77% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  78% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  79% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  80% {
    text-shadow: -3px 0 0 red, 3px 0 0 #0c33f5;
    filter: blur(0);
  }
  81% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  82% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0);
  }
  83% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  84% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  85% {
    text-shadow: 1px 0 0 red, -1px 0 0 lime;
    filter: blur(0.5px);
  }
  86% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  87% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0.5px);
  }
  88% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  89% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  90% {
    text-shadow: -3px 0 0 red, 3px 0 0 lime;
    filter: blur(0);
  }
  91% {
    text-shadow: 60px 0 0 lime, -60px 0 0 #0c33f5;
    filter: blur(0);
  }
  92% {
    text-shadow: 0 0 0 lime, 0 0 0 #0c33f5;
    filter: blur(0);
  }
  92% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  93% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  94% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  95% {
    text-shadow: 0.8px 0 0 #0c33f5, -0.8px 0 0 lime;
    filter: blur(0);
  }
  96% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  97% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  98% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  99% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
  100% {
    text-shadow: -3px 0 0 #0c33f5, 3px 0 0 lime;
    filter: blur(0);
  }
}

*.kf-glitch:hover {
  animation: glitch 3s steps(100) infinite;
}

/* Fonts ------------------------------------------------------------------- */

@font-face {
  font-family: Outfit;
  src: url("./fonts/Outfit-Regular.ttf");
}

@font-face {
  font-family: Outfit;
  src: url("./fonts/Outfit-Bold.ttf");
  font-weight: bold;
}
