/* Reset */
html, body, div, span, h1, h2, h3, p, a, strong, em, ul, li, section, footer, time, button, figure, figcaption, img {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
section, footer { display: block; }
ul { list-style: none; }
*, *:before, *:after { box-sizing: border-box; }

:root {
  --viewport-height: 100vh;
  --ink: #FFFFFF;
  --ink-dim: rgba(255,255,255,0.588);
  --ink-faint: rgba(255,255,255,0.32);
  --settle: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html { font-size: 15pt; }

body {
  -webkit-text-size-adjust: none;
  line-height: 1.0;
  min-height: var(--viewport-height);
  min-width: 320px;
  overflow-x: hidden;
  word-wrap: break-word;
  background-color: #000000;
}

::selection {
  background: rgba(255,255,255,0.85);
  color: #000000;
}

/* Night canvas: the cursor is a small light over a field of dots */
#night {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 2.5s ease 0.4s;
}
body:not(.is-loading) #night { opacity: 1; }

strong { color: inherit; font-weight: bolder; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.25s ease, opacity 0.25s ease;
}
a:hover { text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: 1px dotted var(--ink);
  outline-offset: 3px;
}

/* Layout */
#wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--viewport-height);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

#main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 0;
  flex-shrink: 0;
  max-width: 100%;
  position: relative;
  text-align: left;
  z-index: 1;
  transition: opacity 1s ease 0s, transform 1s ease 0s;
}

#main > .inner {
  --padding-horizontal: 3.375rem;
  --padding-vertical: 0rem;
  --spacing: 0.75rem;
  --width: 36rem;
  max-width: 100%;
  position: relative;
  width: var(--width);
  z-index: 1;
  padding: var(--padding-vertical) var(--padding-horizontal);
}

#main > .inner > * > * {
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}
#main > .inner > * > :first-child { margin-top: 0 !important; }
#main > .inner > * > :last-child { margin-bottom: 0 !important; }

body.is-loading #main {
  opacity: 0;
  transform: scale(0.94375);
}

/* Dividers */
hr {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  min-height: 1rem;
  padding: 0;
  position: relative;
  width: 100%;
}
hr:before {
  content: '';
  width: 100%;
  height: 1px;
  border-top: dotted 1px var(--ink);
  transform-origin: left center;
}
#divider08:before {
  border-top: 0;
  background-color: var(--ink);
}

/* Text */
h2, p { position: relative; }

h2 {
  color: var(--ink);
  font-family: 'Andada Pro', serif;
  font-size: 1.375em;
  line-height: 1.5;
  font-weight: 400;
}

p, .list {
  color: var(--ink);
  font-family: 'Andada Pro', serif;
  font-size: 1em;
  line-height: 1.5;
  font-weight: 400;
}

#text06, #text07, #text08, #text09 {
  font-family: 'Assistant', sans-serif;
}

/* Plain colors instead of Carrd's background-clip text, which can't fade in smoothly */
#text05 { color: var(--ink-dim); }
#text05 strong { color: rgba(255,255,255,0.79); }

/* Handles next to social links */
.handle {
  color: var(--ink-faint);
  font-size: 0.9em;
  margin-left: 0.35em;
}

/* Header + tabs: one pair of brackets marks where you are and follows your pointer */
#header { margin-bottom: var(--spacing); }

.tabs {
  --tab-pad: 0.55em;
  display: inline-flex;
  margin-left: calc(var(--tab-pad) * -1);
  position: relative;
  font-family: 'Assistant', sans-serif;
  font-size: 1em;
  line-height: 1.5;
}
.tabs a {
  position: relative;
  z-index: 1;
  padding: 0 var(--tab-pad);
  color: rgba(255,255,255,0.42);
  text-decoration: none;
  transition: color 0.45s ease;
}
.tabs a:hover,
.tabs a:focus-visible,
.tabs a[aria-current] {
  color: var(--ink);
}
.tabs a:focus-visible { outline-offset: 0; }

.tabs-frame {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  pointer-events: none;
  transition: transform 0.6s var(--settle), width 0.6s var(--settle), opacity 0.35s ease;
}
.tabs-frame:before,
.tabs-frame:after {
  position: absolute;
  top: 0;
  color: var(--ink);
}
.tabs-frame:before { content: '['; left: 0; }
.tabs-frame:after { content: ']'; right: 0; }
.tabs-frame.is-previewing { opacity: 0.5; }
.tabs:not(.is-ready) .tabs-frame { transition: none; }

/* Email copy */
.copy {
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-family: 'Assistant', sans-serif;
  font-size: 0.8em;
  margin-left: 0.5em;
  padding: 0 0.15em;
  transition: color 0.25s ease;
}
.copy:hover { color: var(--ink); }

/* A button that reads like a link (discord: click copies the username) */
.copy.copy-link {
  color: inherit;
  font-size: 1em;
  margin-left: 0;
  padding: 0;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
.copy.copy-link:hover { text-decoration: none; }
.copy-status {
  color: var(--ink-faint);
  font-size: 0.8em;
  margin-left: 0.35em;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.copy-status.is-shown { opacity: 1; }

/* Lists */
.list { display: block; }
.list ul {
  display: inline-block;
  max-width: 100%;
  text-align: left;
  vertical-align: middle;
}
.list ul li {
  display: flex;
  position: relative;
  margin-top: 0.5rem;
  transition: opacity 0.5s ease;
}
.list ul li:first-child { margin-top: 0 !important; }
.list ul li:before {
  content: '';
  display: block;
  flex-grow: 0;
  flex-shrink: 0;
  order: 1;
  position: relative;
  background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2040%2040%22%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%2210%22%20fill%3D%22%23FFFFFF%22%20%2F%3E%3C%2Fsvg%3E');
  background-position: left 60%;
  background-repeat: no-repeat;
  background-size: contain;
  height: 1.5rem;
  line-height: 1.5rem;
  min-width: 0.5625rem;
}
.list ul li:after {
  content: '';
  display: block;
  flex-grow: 0;
  flex-shrink: 0;
  order: 2;
  pointer-events: none;
  width: 0.625rem;
}
.list ul li p {
  flex-grow: 1;
  flex-shrink: 1;
  order: 3;
}
#list01 ul { width: auto; }

/* Portfolio: each project is a cover and a few words */
.works {
  display: flex;
  flex-direction: column;
}
.work {
  position: relative;
  padding: 0.175rem 0;
  transition: opacity 0.5s ease;
}

/* Timeline: gray years hang in the margin left of the projects, threaded by a faint line with a dot per entry.
   The rows themselves keep their position; the timeline sits outside the column. */
.work-year {
  --rail: 1.1rem;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: calc(var(--rail) + 0.6rem);
  color: var(--ink-faint);
  font-family: 'Assistant', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.work-year:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: var(--rail);
  width: 1px;
  background: rgba(255,255,255,0.14);
}
.work:first-child .work-year:before { top: 50%; }
.work:last-child .work-year:before { bottom: 50%; }
.work-year:after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(var(--rail) - 2px);
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}

/* Too narrow for a margin timeline: the year sits as a small label above its project instead */
@media (max-width: 736px) {
  .work-year {
    position: static;
    width: auto;
    display: block;
    padding: 0.35rem 0 0;
  }
  .work-year:before,
  .work-year:after { display: none; }
}
.work.is-gone { opacity: 0.5; }
@media (hover: hover) {
  .works:hover .work { opacity: 0.3; }
  .works:hover .work:hover { opacity: 1; }
}

/* The whole row is one link; on hover a faint frame gathers cover and text into a box */
.work-link {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0 -0.6rem;
  padding: 0.6rem;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.6s ease, background-color 0.6s ease;
}
.work-link:hover,
.work-link:focus-visible {
  border-color: rgba(255,255,255,0.2);
  background-color: rgba(255,255,255,0.035);
}
.work-link:focus-visible {
  outline: none;
  border-color: rgba(255,255,255,0.55);
}

.work-cover {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 8.5rem;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.14);
  transition: border-color 0.6s ease;
}
.work-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.62);
  transform: scale(1.04);
  transition: filter 0.9s ease, transform 1.4s var(--settle);
}
.work-link:hover .work-cover,
.work-link:focus-visible .work-cover { border-color: rgba(255,255,255,0.45); }
.work-link:hover .work-cover img,
.work-link:focus-visible .work-cover img {
  filter: grayscale(0) brightness(1);
  transform: scale(1);
}

/* No image yet: a dotted frame holding the project's first letter */
.work-cover.is-empty { border-style: dotted; }
.work-cover.is-empty img { display: none; }
.work-cover.is-empty:after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.28);
  font-family: 'Andada Pro', serif;
  font-size: 1.6em;
  font-style: italic;
}

.work-text { min-width: 0; }
.work-name {
  line-height: 1.35;
}
.work-status {
  color: var(--ink-faint);
  font-family: 'Assistant', sans-serif;
  font-size: 0.8em;
  margin-left: 0.6em;
}
.work-desc {
  color: var(--ink-dim);
  line-height: 1.4;
  margin-top: 0.15rem;
}

@media (max-width: 480px) {
  .work-link { gap: 0.9rem; }
  .work-cover { width: 6.5rem; }}

/* Entry: things come into focus, like eyes adjusting to the dark */
.is-entering > * {
  animation: focus-in 1.1s var(--settle) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.is-entering > h2 {
  animation: flip-in 1.8s var(--settle) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.is-entering > hr:before {
  animation: draw 1.4s var(--settle) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.is-entering > hr { animation: none; }

section.is-leaving > * {
  opacity: 0;
  filter: blur(5px);
  transition: opacity 0.32s ease, filter 0.32s ease;
}

@keyframes focus-in {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}
@keyframes flip-in {
  from { opacity: 0; filter: blur(4px); transform: perspective(1000px) rotateX(16.875deg); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 1680px) {
  html { font-size: 11pt; }
}

@media (max-width: 980px) {
  html { font-size: 9pt; }
}

@media (max-width: 736px) {
  #main > .inner { --padding-horizontal: 2rem; }
  hr:before { width: 100rem; }
}

@media (max-width: 480px) {
  #main > .inner { --spacing: 0.65625rem; }
}

@media (max-width: 360px) {
  #main > .inner {
    --padding-horizontal: 1.5rem;
    --spacing: 0.5625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #main, #night, .tabs-frame, section.is-leaving > *, .work-cover img { transition: none !important; }
  .is-entering > *,
  .is-entering > h2,
  .is-entering > hr:before { animation: none !important; }
}
