/* ============================================================
   Avery — Portfolio
   Design tokens derived from portfolio.pen (Desktop - 2)
   ============================================================ */
:root {
  --bg: #f0eee9;
  --ink: #000000;
  --card: rgba(255, 255, 255, 0.5);
  --card-border: rgba(59, 44, 7, 0.08);
  --hairline: rgba(0, 0, 0, 0.06);
  --subtle-fill: rgba(0, 0, 0, 0.02);
  --subtle-border: rgba(0, 0, 0, 0.12);

  --font-display: "Syne Mono", ui-monospace, monospace;
  --font-body: "Epilogue", system-ui, -apple-system, sans-serif;

  --sidebar-w: 348px;
  --gap: 48px;
  --radius-card: 16px;
  --radius-md: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.04em;
}

/* ============================================================
   Layout
   ============================================================ */
.layout {
  max-width: 1392px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: sticky;
  top: 24px;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  min-height: calc(100vh - 48px);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;

  padding: 32px;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 70px rgba(59, 44, 7, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ============================================================
   Preloader
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.loaded {
  opacity: 0;
  visibility: hidden;
}
.preloader-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  animation: preloader-pulse 1.1s ease-in-out infinite;
}
@keyframes preloader-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.avatar {
  width: 120px;
  height: 120px;
  margin-top: 8px;
  perspective: 800px;
}
.avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: avatar-flip 6s ease-in-out infinite;
}
.avatar-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.avatar-back {
  transform: rotateY(180deg);
}
@keyframes avatar-flip {
  0%, 42% {
    transform: rotateY(0deg);
  }
  50%, 92% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-inner {
    animation: none;
  }
}

.intro,
.vibe {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.intro .display,
.vibe .display {
  font-size: 24px;
}

.bio {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.72);
}

.vibe-list {
  list-style: none;
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  align-self: center;
  color: rgba(0, 0, 0, 0.72);
}

/* push the social + CTA cluster toward the bottom of the card */
.sidebar-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.socials a + a {
  padding-left: 16px;
  border-left: 1px solid rgba(0, 0, 0, 0.15);
}

.social {
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  transition: color 0.18s ease;
}
.social:hover {
  color: var(--ink);
}

.book-call {
  position: relative;
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
  transition: background 0.18s ease;
}
.book-call::before,
.book-call::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.book-call::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(102, 102, 102, 0.5));
  opacity: 0.25;
}
.book-call::after {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(102, 102, 102, 0.5));
  opacity: 0;
}
.book-call:hover::before {
  opacity: 0;
}
.book-call:hover::after {
  opacity: 0.25;
}

/* ============================================================
   Main content
   ============================================================ */
.content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.block {
  display: flex;
  flex-direction: column;
}

.section-label {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
}

/* PRESENT — AI Skillsmaxing */
.present {
  display: grid;
  grid-template-columns: 80px 1fr;
  column-gap: 24px;
  align-items: start;
}

.emoji-badge {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--card-border);
  display: grid;
  place-items: center;
  font-size: 44px;
  line-height: 1;
}

.present-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}

/* Portrait app demo videos (autoplaying phone recordings) */
.app-demos {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}
.app-demo {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000000;
}
.app-demo video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  transition: transform 0.4s ease;
}
.app-demo:hover video {
  transform: scale(1.04);
}
@media (max-width: 640px) {
  .app-demos {
    flex-direction: column;
  }
  .app-demo {
    flex: none;
    width: 100%;
  }
}

/* Work entries */
.entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  column-gap: 24px;
  padding: 40px 0;
}
.entry:first-of-type {
  padding-top: 0;
}
.entry + .entry {
  border-top: 1px solid var(--hairline);
}

.entry-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.entry-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 16px;
  row-gap: 2px;
}

.entry-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.entry-role {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.body {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.72);
}

/* keep tighter spacing between stacked description paragraphs */
.entry-body .body + .body {
  margin-top: -4px;
}

/* Featured project visuals */
.visuals {
  display: flex;
  flex-direction: column;
  gap: 34px;
  margin-top: 18px;
}
.visual {
  border-radius: var(--radius-card);
  overflow: hidden;
}
.visual img {
  display: block;
  width: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.visual:hover img {
  transform: scale(1.02);
}
.visual img.dark {
  background: #000000;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .layout {
    flex-direction: column;
    gap: 32px;
  }
  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    min-height: 0;
  }
  .sidebar-footer {
    margin-top: 8px;
    max-width: 360px;
    align-self: center;
  }
  .content {
    gap: 56px;
  }
}

@media (max-width: 560px) {
  .layout {
    padding: 16px;
  }
  .sidebar {
    padding: 56px 24px 28px;
  }
  .present,
  .entry {
    grid-template-columns: 64px 1fr;
    column-gap: 16px;
  }
  .emoji-badge,
  .entry-logo {
    width: 64px;
    height: 64px;
    font-size: 34px;
  }
  .entry-title,
  .entry-role {
    font-size: 18px;
  }
  .section-label {
    font-size: 18px;
  }
}
