:root {
  --bg: #000;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.18);
  --box: rgba(8, 8, 8, 0.72);
}

* { box-sizing: border-box; }

html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }

body {
  margin: 0;
  font: 400 17px/1.65 "Raleway", system-ui, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
}

#bg { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }

h1, h2, h3 { font-family: "Merriweather", Georgia, serif; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); font-weight: 900; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
a { color: var(--fg); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.label { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: .4em; }

/* the floating content box, redmihype-style */
.box {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 28vh auto 0;
  padding: 32px 36px 90px; /* bottom padding leaves room for the flower overlap */
  background: var(--box);
  border: 1px solid var(--line);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, .6);
}
@media (max-width: 820px) { .box { margin: 18vh 16px 0; padding: 24px 20px 80px; } }

nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
nav a {
  text-decoration: none; font-size: .85rem; letter-spacing: .05em;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted);
  transition: background .2s, color .2s;
}
nav a:hover, nav a:focus-visible { color: var(--bg); background: var(--fg); }
nav a[aria-current="page"] { color: var(--fg); border-color: var(--fg); }

section { margin: 0 0 56px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; }
.card ul { margin: 0; padding-left: 1.1em; color: var(--muted); }

.job { border-left: 1px solid var(--line); padding: 0 0 8px 22px; margin-bottom: 36px; position: relative; }
.job::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; background: var(--fg); border-radius: 50%; }
.job .when { font-size: .85rem; color: var(--muted); }

.contact-list { list-style: none; padding: 0; margin: 0 0 40px; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; }
.contact-list .k { color: var(--muted); min-width: 110px; display: inline-flex; align-items: center; gap: 10px; }
.contact-list svg { width: 18px; height: 18px; fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact-list svg.fill { fill: var(--fg); stroke: none; }

/* GitHub title + repo cards */
.gh-title a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.gh-title a:hover { text-decoration: underline; }
.gh-title svg { width: 26px; height: 26px; fill: var(--fg); }
#repos { margin-bottom: 40px; }
#repos .card { text-decoration: none; }
#repos .card h3 { text-decoration: underline; }

/* GitHub contributions, greyscale */
.gh { display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column; grid-auto-columns: 10px; gap: 3px; overflow-x: auto; padding-bottom: 6px; margin-bottom: .8em; }
.gh i { border-radius: 2px; }
.gh i[data-l="0"] { background: #1c1c1c; }
.gh i[data-l="1"] { background: #4a4a4a; }
.gh i[data-l="2"] { background: #7a7a7a; }
.gh i[data-l="3"] { background: #b0b0b0; }
.gh i[data-l="4"] { background: #f2f2f2; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--fg); background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px;
}
input:focus, textarea:focus { outline: 1px solid var(--fg); }
textarea { min-height: 150px; resize: vertical; }
button, .btn {
  justify-self: start; font: 600 .9rem "Raleway", sans-serif; letter-spacing: .08em;
  padding: 10px 26px; color: var(--bg); background: var(--fg); border: 0; border-radius: 3px; cursor: pointer;
}
.btn { display: inline-block; text-decoration: none; animation: btn-in .6s cubic-bezier(.7, 0, .2, 1) 1.2s both; } /* wipes in as the page finishes typing */
@keyframes btn-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .btn { animation: none; } }
.hp { position: absolute; left: -9999px; }

/* foreground flowers at the very bottom, overlapping the box a little */
.flowers {
  position: relative; z-index: 2; pointer-events: none;
  height: 200px; margin-top: -70px; overflow: hidden;
}
.flowers svg { width: 100%; height: 100%; display: block; }

/* typewriter loader */
.tw { visibility: hidden; }
.tw.on { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* page transitions: the content box fades out/in while the particles morph behind it */
.box { transition: opacity .45s ease, transform .45s ease; }
html.leaving .box { opacity: 0; transform: translateY(12px); }
.box:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .box { transition: none; } }
