/* ============================
   Theme Variables
   ============================ */
:root {
  color-scheme: light dark;
  --base-100: oklch(100% 0 0);
  --base-200: oklch(98% 0 0);
  --base-300: oklch(95% 0 0);
  --base-content: oklch(21% 0.006 285.885);
  --neutral: oklch(14% 0.005 285.823);
  --neutral-content: oklch(92% 0.004 286.32);

  --muted: color-mix(in srgb, var(--base-content) 40%, transparent);
  --accent: light-dark(#c2410c, #fb923c);
  --font-berkeleymono: "Berkeley Mono", monospace;
  --font-roboto: "Roboto", sans-serif;
  --font-firacode: "Fira Code", monospace;

  --a4l: 1120px;
  --a4s: 794px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --base-100: oklch(25.33% 0.016 252.42);
    --base-200: oklch(23.26% 0.014 253.1);
    --base-300: oklch(21.15% 0.012 254.09);
    --base-content: oklch(97.807% 0.029 256.847);
  }
}

/* ============================
   Typing Cursor
   ============================ */
.typing-cursor {
  animation: blink 0.6s infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 0;
  }
  50%,
  99% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ============================
   Typing Cursor
   ============================ */
.typing-cursor {
  animation: blink 0.6s infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 0;
  }
  50%,
  99% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ============================
   Shared Button
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--base-content);
  border: 1px solid var(--base-content);
  background: var(--base-100);
  padding: 0.5rem 0.75rem;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  width: fit-content;
}

.btn:hover {
  background: var(--base-200);
}

/* ============================
   Reset
   ============================ */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Roboto-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/Roboto-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Berkeley Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/BerkeleyMono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Berkeley Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/BerkeleyMono-Oblique.ttf") format("truetype");
}
@font-face {
  font-family: "Berkeley Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/BerkeleyMono-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Berkeley Mono";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/BerkeleyMono-Bold-Oblique.ttf") format("truetype");
}

/* ============================
   Print
   ============================ */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  :root {
    color-scheme: light;
    --base-100: oklch(100% 0 0);
    --base-content: oklch(21% 0.006 285.885);
    --neutral: oklch(14% 0.005 285.823);
    --neutral-content: oklch(92% 0.004 286.32);
  }
  body {
    print-color-adjust: exact;
  }
}

/* ============================
   Reset
   ============================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-berkeleymono);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--base-100);
  color: var(--base-content);
}

h1,
h2,
h3,
h4 {
  font-size: inherit;
  font-weight: inherit;
}
a {
  color: inherit;
  text-decoration: inherit;
}
ul {
  list-style: none;
}

/* ============================
   Shared Layout Utilities
   ============================ */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-row {
  flex-direction: row;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.grow {
  flex-grow: 1;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.block {
  display: block;
}
.hidden {
  display: none;
}
.w-full {
  width: 100%;
}
.w-fit {
  width: fit-content;
}
.h-full {
  height: 100%;
}
.mx-auto {
  margin-inline: auto;
}

/* ============================
   Shared Components
   ============================ */

/* ============================
   Home Page
   ============================ */
.home-body {
  background: var(--base-100);
  color: var(--base-content);
  overflow-x: hidden;
}

.home-body > * + * {
  margin-top: 5rem;
}

.home-header {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.home-header .inner {
  width: fit-content;
  margin: 0 auto;
  color: var(--base-content);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  height: 100%;
  max-height: 24rem;
}

.home-header h1 {
  font-size: 1.875rem;
  font-weight: normal;
}

.home-header h1 > div:nth-child(2) {
  color: var(--accent);
}

.home-body .section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-body .section .content {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  justify-content: center;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .home-body .section .content {
    padding: 0 2.5rem;
  }
}

.home-body .section-main {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}

.home-h2 {
  display: flex;
  font-size: 1.875rem;
  padding-bottom: 3rem;
  color: var(--base-content);
}

.home-h2 > :first-child {
  color: var(--accent);
  margin-right: 0.2rem;
}

.home-h2 .hash {
  color: var(--accent);
}

.home-section-link {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-section-link .art {
  color: var(--muted);
  font-size: 1em;
}

#home-jump-up .btn-icon,
.home-body .btn .btn-icon,
.resume-body .btn .btn-icon {
  color: var(--muted);
}

#home-jump-up {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
}

.home-section-link .lucide-chevron-down {
  color: var(--muted);
}

.home-section-link .inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  color: var(--base-content);
  width: fit-content;
}

.link {
  text-decoration: underline;
  text-decoration-color: var(--muted);
}

.home-link {
  color: var(--base-content);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  width: fit-content;
}

.home-link .lucide {
  width: 1.25rem;
  height: 1.25rem;
}

.home-link .lucide-link-2,
.home-link .lucide-github {
  color: var(--muted);
}

.home-link .label {
  width: fit-content;
}

/* Home project */
.home-project {
  margin-bottom: 1rem;
}

.home-project .carousel-wrap {
  display: inline-flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
  scroll-behavior: smooth;
}

.home-project .carousel-wrap::-webkit-scrollbar {
  display: none;
}

.home-project .carousel-slide {
  box-sizing: content-box;
  display: flex;
  flex: none;
  scroll-snap-align: start;
  width: calc(100% - 2px);
  border: 1px solid var(--muted);
  position: relative;
  flex-direction: column;
  overflow: hidden;
  overflow-x: auto;
}

.home-project .carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  aspect-ratio: 16 / 9;
}

.home-project .nav {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 50%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.home-project .carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  background: var(--base-200);
  color: var(--base-content);
  border: 1px solid var(--base-200);
}

.home-project .carousel-btn .lucide {
  width: 1.5rem;
  height: 1.5rem;
}

.home-project .carousel-btn:hover {
  background: var(--base-300);
  border-color: var(--base-300);
}

.home-project .title {
  font-size: 1.125rem;
  color: var(--base-content);
}

/* Home contacts */
.home-contacts {
  color: var(--base-content);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.home-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
}

.home-contact-item .lucide {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted);
}

.home-body .lucide-file-user {
  color: var(--muted);
  width: 1rem;
  height: 1rem;
}

/* Tag list on home page */
.home-tags {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

.home-bio {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ============================
   Resume Page
   ============================ */
.resume-body {
  background: var(--base-100);
  color: var(--base-content);
}

/* Resume header (print/download buttons) */
.resume-body > header {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  padding: 2.5rem 0;
}

/* Resume main content area */
.resume-body .btn .lucide {
  color: var(--muted);
}
.resume-body > main {
  font-family: var(--font-roboto);
  min-height: var(--a4l);
  max-width: var(--a4s);
  margin: 0 auto;
  padding: 1.5rem;
}

@media print {
  .resume-body > header {
    display: none;
  }
}

/* Name + contacts layout */
.resume-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

@media (min-width: 640px) {
  .resume-layout {
    flex-direction: row;
  }
}

.resume-layout > :first-child {
  flex-grow: 1;
}

/* Name */
.resume-body h1 {
  font-size: 1.5rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--base-content);
}

.resume-body h1 + p {
  font-size: 1.25rem;
}

/* Bio */
.resume-body .bio {
  font-size: 0.875rem;
  color: var(--base-content);
  margin-top: 0.25rem;
  padding-bottom: 2rem;
  max-width: 65ch;

  @media print {
    padding-bottom: 1rem;
  }
}

/* Contacts */
.resume-contacts {
  flex-grow: 1;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .resume-contacts {
    margin-bottom: 0;
  }
}

.resume-contacts li {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  color: var(--base-content);
}

.resume-contacts li a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.resume-contacts .lucide {
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
}

.resume-contacts .right {
  flex-grow: 1;
  text-align: right;
}

.resume-body article {
  padding-bottom: 2rem;

  @media print {
    padding-bottom: 1rem;
  }
}

.resume-body section {
  padding-bottom: 1rem;

  @media print {
    padding-bottom: 0.25rem;
  }
}

.resume-body h2 {
  font-size: 1.25rem;
  color: var(--base-content);
  text-transform: uppercase;
  font-weight: 700;
}

.resume-body section h3 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.resume-body section h3 .text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--base-content);
}

.resume-body section h3 .desc {
  color: var(--base-content);
}

.resume-body article ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.resume-body article ul li {
  margin-top: 0.25rem;
}

.resume-body strong {
  font-weight: 400;
  color: var(--base-100);
  background: var(--base-content);
  padding: 0 0.25rem;
  margin-right: 0.25rem;
}

.resume-body a {
  color: var(--base-content);
}

/* ============================
   Rotation Utilities
   ============================ */
.rot-90 {
  rotate: 90deg;
}
.rot-neg-90 {
  rotate: -90deg;
}

/* ============================
   SVG Icons
   ============================ */
.lucide {
  display: inline-block;
}
