:root {
  --bg: #050505;
  --card: #141414;
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #f4f4f4;
  --muted: #8d8d8d;
  --dim: #5e5e5e;
  --radius: 22px;
  color-scheme: dark;
}

@font-face {
  font-family: Rubik;
  src: url("../assets/Rubik-Regular.woff2") format("woff2"),
       url("../assets/Rubik-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

html::-webkit-scrollbar { width: 0; height: 0; }

body {
  position: relative;
  margin: 0;
  background: #070707;
  color: var(--text);
  font-family: Rubik, "Segoe UI", sans-serif;
  font-synthesis: weight;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

[hidden] { display: none !important; }

.damascus {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

/* smooth fade between the home page and /projects/ (skipped where unsupported) */
@view-transition { navigation: auto; }

/* faint, still film grain over the background */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("../assets/grain.png") repeat;
  background-size: 128px 128px;
  opacity: 0.02;
}

main {
  position: relative;
  z-index: 1;
  background: transparent;
}

html.no-gl main {
  background-color: #616161;
  background-image:
    linear-gradient(#070707, #070707),
    linear-gradient(180deg, #070707 0%, #222222 42%, #3a3a3a 72%, #616161 100%);
  background-repeat: no-repeat;
  background-size: 100% 100vh, 100% 200vh;
  background-position: 0 0, 0 100vh;
}

@supports (height: 100svh) {
  html.no-gl main {
    background-size: 100% 100svh, 100% 200svh;
    background-position: 0 0, 0 100svh;
  }
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@keyframes area-fall {
  from { opacity: 0; transform: translateY(-28px); }
  to { opacity: 1; transform: translateY(0); }
}

@supports (animation-timeline: view()) {
  .screen {
    view-timeline-name: --area;
    view-timeline-axis: block;
  }

  .profile,
  .about-inner,
  .projects-inner {
    animation: area-fall linear both;
    animation-timeline: --area;
    animation-range: entry 0% entry 55%;
  }
}

.dot:focus-visible,
.socials a:focus-visible,
.socials button:focus-visible,
.scroll-hint:focus-visible,
.presence:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.dots {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dot {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.dot span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}

.dot.active span {
  background: #fff;
  transform: scale(1.35);
}

.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 18px 14px;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.scroll-hint {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  transition: opacity 0.3s ease;
}

.scroll-hint svg {
  width: 16px;
  height: 16px;
  animation: bob 1.6s ease-in-out infinite;
}

.scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- profile ---------- */

.hero {
  display: grid;
  place-items: center;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -24px;
}

.avatar-wrap {
  position: relative;
  width: 156px;
  height: 156px;
  margin-bottom: 18px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 34%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16), 0 16px 40px rgba(0, 0, 0, 0.45);
}

.profile h1 {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  /* same white glow as the link icons below it */
  text-shadow:
    0 0 3px #fff,
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 16px rgba(255, 255, 255, 0.45);
}

.socials {
  display: flex;
  align-items: center;
  gap: 22px;
}

.socials a,
.socials button {
  position: relative;
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.socials button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.socials svg {
  width: 28px;
  height: 28px;
  filter:
    drop-shadow(0 0 3px #fff)
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.45));
}

.socials a:hover,
.socials button:hover { transform: translateY(-2px); }

/* The username under a copy-only icon: on hover/focus, and after a click. */
.social-tip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.socials button:hover .social-tip,
.socials button:focus-visible .social-tip,
.socials button.show-tip .social-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- showcase card ---------- */

.showcase {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  margin-top: 14px;
  padding: 0 18px 16px;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.showcase[hidden] { display: none; }

.showcase:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.showcase:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.showcase-photo {
  display: block;
  width: calc(100% + 36px);
  height: 120px;
  margin: 0 -18px 10px;
  object-fit: cover;
  filter: grayscale(1) brightness(0.8);
  transition: filter 0.3s ease;
}

.showcase:hover .showcase-photo,
.showcase:focus-visible .showcase-photo { filter: grayscale(1) brightness(1); }

.showcase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.showcase-label {
  color: #9a9a9a;
  font-size: 12px;
  white-space: nowrap;
}

.showcase .chips { justify-content: flex-end; }

.showcase-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.showcase-line {
  color: #a3a3a3;
  font-size: 13.5px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .showcase-photo { height: 96px; }
}

/* ---------- about ---------- */

.about {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 72px;
}

.about-inner { width: min(860px, 100%); }

.about h2 {
  margin: 0 0 16px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bio {
  padding: 16px 20px;
  color: #cfcfcf;
  font-size: 14.5px;
  line-height: 1.5;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 14px;
  margin-top: 14px;
}

.presence {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 92px;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.presence:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.presence-pfp {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.presence-name {
  font-weight: 650;
  font-size: 15px;
}

.presence-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.clock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 14px;
  min-height: 92px;
}

.wall-clock {
  --digit: 36px;
  position: relative;
  display: flex;
  align-items: flex-start;
  height: var(--digit);
  overflow: hidden;
  color: #fff;
  font-size: 38px;
  font-weight: 500;
  line-height: var(--digit);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.wall-clock::before,
.wall-clock::after {
  content: "";
  position: absolute;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 9px;
  pointer-events: none;
}

.wall-clock::before {
  top: 0;
  background: linear-gradient(to top, transparent, #141414);
}

.wall-clock::after {
  bottom: 0;
  background: linear-gradient(to bottom, transparent, #141414);
}

.wall-clock > div { display: flex; }

.wall-clock .tick {
  line-height: 30px;
  padding: 0 1px;
}

.wall-clock .move {
  animation: wall-roll 0.6s linear forwards;
}

@keyframes wall-roll {
  from { transform: translateY(0); }
  to { transform: translateY(-36px); }
}

.when {
  color: #9a9a9a;
  font-size: 12px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.skill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #dedede;
  font-size: 12.5px;
}

.skill svg { width: 14px; height: 14px; flex: none; }

/* ---------- projects ---------- */

.projects {
  display: grid;
  place-items: center;
  padding: 80px 24px;
}

.projects-inner {
  width: min(720px, 100%);
}

.projects h2 {
  margin: 0 0 18px 6px;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.project {
  background: #141416;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.project + .project { margin-top: 18px; }

.project-more {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 2px 0;
  color: #ffffffb2;
  text-decoration: none;
}

.project-more-text {
  display: inline-block;
  color: #ffffffb2;
  font-size: clamp(1.2rem, 1.2vw, 1.15rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: color 0.2s ease;
}

.project-more:hover .project-more-text { color: #fff; }

.project-photo {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center;
}

/* photos sit slightly dimmed and come up to full brightness on hover or focus */
.project-photo,
.blog-post-photo {
  filter: grayscale(1) brightness(0.8);
  transition: filter 0.35s ease;
}
.project-toggle:hover .project-photo,
.project-toggle:focus-visible .project-photo,
.project.is-open .project-photo,
.blog-post:hover .blog-post-photo,
.blog-post:focus-within .blog-post-photo {
  filter: grayscale(1) brightness(1);
}

.now {
  margin: 12px 0 0;
  color: var(--muted, #8a8a8a);
  padding: 0 20px;
  font-size: 14px;
}
.now[hidden] { display: none; }

.project-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-summary {
  display: block;
  padding: 14px 18px 16px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(20, 20, 22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ececec;
  font-size: 11px;
}

.project-copy {
  display: block;
  margin-top: 12px;
}

.project-title {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-line {
  display: block;
  margin-top: 6px;
  max-width: 46ch;
  color: #a3a3a3;
  font-size: 13.5px;
  line-height: 1.45;
}

.project-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.project.is-open .project-details { grid-template-rows: 1fr; }

.project-details-inner {
  overflow: hidden;
  visibility: hidden;
}

.project.is-open .project-details-inner { visibility: visible; }

.project-details p {
  margin: 0 18px;
  color: #c8c8c8;
  font-size: 14.5px;
  line-height: 1.5;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 18px 18px;
}

.project-links a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.project-links a:hover { background: rgba(255, 255, 255, 0.16); }

.project-toggle:focus-visible,
.project-links a:focus-visible,
.project-more:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .about { padding: 56px 24px 64px; }
  .about-grid { grid-template-columns: 1fr; }
  .avatar-wrap { width: 128px; height: 128px; }
  .profile h1 { font-size: 26px; }
  .about h2 { font-size: 28px; }
  .projects h2 { font-size: 34px; }
  .socials { gap: 16px; }
  .socials svg { width: 22px; height: 22px; }
  .dots { right: 3px; }
  .hud { font-size: 11px; }
  .scroll-hint span { font-size: 11px; }
}

/* ---------- /projects/ ---------- */

html.projects-page {
  scroll-snap-type: none;
  scrollbar-width: thin;
}

html.projects-page::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html.projects-page::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.blog.is-hidden,
.post.is-hidden {
  display: none;
}

.blog {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  padding: 48px 24px 80px;
}

.blog-inner {
  width: min(960px, 100%);
  margin: 0 auto;
}

.blog-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.blog-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  text-decoration: none;
}

.blog-back svg {
  width: 22px;
  height: 22px;
}

.blog-back:hover { color: #fff; }

.blog-heading {
  margin: 0;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.blog-post {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 24px;
}

.blog-post:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-post-photo,
.post-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #141416;
}

.blog-post-title {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.blog-post-title a {
  color: inherit;
  text-decoration: none;
}

.blog-post-title a:hover { color: #fff; }

.blog-post-copy {
  color: #c8c8c8;
  font-size: 15px;
  line-height: 1.55;
}

.blog-post-copy p { margin: 0 0 12px; }

.blog-post-links {
  margin: 18px 0 0;
}

.post {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.post-inner {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 36px;
  align-items: start;
}

.post-media {
  display: grid;
  gap: 12px;
}

.post-bar {
  margin: 0;
  min-height: 42px;
  align-items: center;
}

.post-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.post-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.post-copy {
  color: #c8c8c8;
  font-size: 16px;
  line-height: 1.6;
}

.post-copy p { margin: 0 0 14px; }

.blog-back:focus-visible,
.blog-post-title a:focus-visible,
.blog-post-links a:focus-visible,
.post-bar a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .blog { padding: 32px 18px 64px; }
  .blog-heading { font-size: 34px; }
  .blog-post {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .blog-post-title { font-size: 24px; }
  .post { padding: 32px 18px 64px; place-items: start; }
  .post-inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .post-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .project-photo, .blog-post-photo, .showcase-photo { transition: none; }
  .scroll-hint svg { animation: none; }
  .project-details { transition: none; }
  .profile,
  .about-inner,
  .projects-inner {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
