/* -------------------------------------------
----------------------------------------------
   DESIGN SYSTEM
----------------------------------------------
------------------------------------------- */

/* -------------------------------------------
   RESET & BASE
------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

/* -------------------------------------------
   VARIABLES
------------------------------------------- */

:root {
  /* ===============================
      COLOR PALETTE (Primitives)
     =============================== */

  --neutral-0: #ffffff;
  --neutral-50: #e8e8e8;
  --neutral-100: #d0d0d0;
  --neutral-200: #b8b8b9;
  --neutral-400: #89898a;
  --neutral-600: #595a5b;
  --neutral-700: #414243;
  --neutral-800: #2a2b2c;
  --neutral-900: #121314;

  /* ===============================
      COLOR TOKENS (Semantic)
     =============================== */

  /* ---------- Content ---------- */

  --content-primary: var(--neutral-900);
  --content-secondary: var(--neutral-800);
  --content-subtle: var(--neutral-400);

  /* ---------- Background ---------- */

  --background-primary: var(--neutral-0);
  --background-secondary: var(--neutral-50);

  /* ---------- Border ---------- */

  --border-light: var(--neutral-200);

  /* ===============================
      TYPOGRAPHY TOKENS
     =============================== */

  /* ---------- Family ---------- */

  --font-primary: "Inter", sans-serif;
  --font-secondary: "Geist Mono", monospace;

  /* ---------- Size ---------- */

  --text-title: clamp(1.5rem, 4vw, 2rem);
  --text-heading: clamp(1.25rem, 3vw, 1.75rem);
  --text-subheading: clamp(1.125rem, 2.5vw, 1.5rem);

  --text-body-md: 1rem;
  --text-body-sm: 0.875rem;
  --text-label-md: 0.875rem;
  --text-label-sm: 0.75rem;

  /* ---------- Weight ---------- */

  --fw-regular: 400;
  --fw-bold: 600;

  /* ---------- Line Height ---------- */

  --lh-tight: 1.2;
  --lh-base: 1.4;
}

/* -------------------------------------------
   GLOBAL STYLES
------------------------------------------- */

body {
  font-family: var(--font-primary);
  font-size: var(--text-body-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--content-primary);
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===============================
   UTILITIES
=============================== */

/* ---------- Headings ---------- */

.text-title {
  font-family: var(--font-primary);
  font-size: var(--text-title);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
}

.text-heading {
  font-family: var(--font-primary);
  font-size: var(--text-heading);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
}

.text-subheading {
  font-family: var(--font-primary);
  font-size: var(--text-subheading);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
}

/* ---------- Body ---------- */

.text-body-md {
  font-family: var(--font-primary);
  font-size: var(--text-body-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
}
.text-body-sm {
  font-family: var(--font-primary);
  font-size: var(--text-body-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
}

/* Modifier */

.text-bold {
  font-weight: var(--fw-bold);
}

/* ---------- Labels ---------- */

.text-label-md {
  font-family: var(--font-secondary);
  font-size: var(--text-label-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--content-subtle);
}

.text-label-sm {
  font-family: var(--font-secondary);
  font-size: var(--text-label-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--content-subtle);
}

/* -------------------------------------------
   MISC
------------------------------------------- */

::selection {
  color: var(--content-primary);
  background-color: var(--neutral-200);
}

/* -------------------------------------------
   ACCESSIBILITY: FOCUS STATES
------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--content-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.link-icon:focus-visible,
.work-item:focus-visible {
  outline: 2px solid var(--content-primary);
  outline-offset: 4px;
}

/* -------------------------------------------
   ICONS
------------------------------------------- */

.material-symbols-outlined {
  justify-content: center;
  vertical-align: middle;
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
}

.material-symbols-outlined {
  font-size: 24px !important;
  font-variation-settings:
    "wght" 300,
    "opsz" 24,
    "FILL" 0,
    "GRAD" 0;
}

/* -------------------------------------------
   BUTTONS
------------------------------------------- */

/* ---------- Reset ---------- */

button,
input[type="submit"],
input[type="reset"] {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
}

/* -------------------------------------------
   LINKS
------------------------------------------- */

/* ---------- Reset ---------- */

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

.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
  transition: opacity 0.5s ease;
}

.link-icon:hover {
  opacity: 0.5;
}

/* -------------------------------------------
   LAYOUT: WRAPPER
------------------------------------------- */

.page-wrapper {
  max-width: 768px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 10vw, 5rem);
}

.page-wrapper--work-detail {
  gap: 2.5rem;
}

/* -------------------------------------------
----------------------------------------------
   HOMEPAGE
----------------------------------------------
------------------------------------------- */

/* -------------------------------------------
   COMPONENT: INTRO
------------------------------------------- */

.intro {
  max-width: 512px;
}

.intro__name {
  margin-bottom: 0.25rem;
}

.intro__description {
  margin: 2.5rem 0;
  color: var(--content-secondary);
}

.intro__description p + p {
  margin-top: 1.25rem;
}

/* -------------------------------------------
   COMPONENT: WORK
------------------------------------------- */

#work-grid {
  scroll-margin-top: 6rem;
}

.work__header {
  margin-bottom: 2.5rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.work-item {
  text-decoration: none;
  color: inherit;
  display: block;
}

.work-item:hover .work-item__image {
  transform: scale(1.05);
}

.work-item__image-container {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.work-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: var(--background-secondary);
  transition: transform 0.5s ease;
}

.work-item__details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.work-item__meta {
  color: var(--content-subtle);
}

/* -------------------------------------------
   COMPONENT: FOOTER
------------------------------------------- */

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.footer__email-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.spin {
  animation: footer-spin 1s linear infinite;
}

@keyframes footer-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.footer__social {
  display: flex;
  gap: 1.5rem;
}

.footer__copyright {
  color: var(--content-subtle);
}

/* -------------------------------------------
----------------------------------------------
   WORK DETAIL PAGE
----------------------------------------------
------------------------------------------- */

/* ---------- Details ---------- */

.work-detail__title {
  margin: 2.5rem 0 1.5rem 0;
  text-align: center;
}

.work-detail__meta {
  text-align: center;
}

.work-detail__hero-image {
  width: 100%;
  border-radius: 0.5rem;
  margin: 2.5rem 0;
}

/* ---------- Body ---------- */

.work-detail__body .text-heading {
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.work-detail__body .text-heading:first-child {
  margin-top: 0rem;
}

.work-detail__body .text-subheading {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.work-detail__body p.text-body-md {
  margin-bottom: 1.5rem;
  color: var(--content-secondary);
}

.work-detail__body > *:last-child {
  margin-bottom: 0;
}

/* Lists */

.work-detail__list {
  list-style-type: disc !important;
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  color: var(--content-secondary);
}
.work-detail__list-item {
  display: list-item !important;
  margin-bottom: 0.25rem;
}

/* ---------- Media Blocks ---------- */

.work-detail__media {
  margin: 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.work-detail__caption {
  color: var(--content-subtle);
}

/* Media Types */

.work-detail__image {
  width: 100%;
  border-radius: 0.5rem;
  display: block;
}

/* ---------- Quotes ---------- */

.work-detail__quote {
  margin: 3rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-light);
  color: var(--content-secondary);
}

/* ---------- Thank You ---------- */

.thank-you {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5rem 0;
}

.thank-you__image {
  width: 5rem;
  margin-bottom: 1.5rem;
}

.thank-you__message {
  text-align: center;
  margin-bottom: 1.5rem;
}

.thank-you__link {
  text-align: center;
}

/* -------------------------------------------
----------------------------------------------
   ADDITIONAL PAGES
----------------------------------------------
------------------------------------------- */

/* -------------------------------------------
   404
------------------------------------------- */

.error-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-404__image {
  width: 5rem;
  margin-bottom: 1.5rem;
}

.error-404__title {
  margin-bottom: 1.5rem;
}

.error-404__description {
  margin-bottom: 1.5rem;
  text-align: center;
}

/* -------------------------------------------
   COMPONENT: SKELETON
------------------------------------------- */

.skeleton__media {
  background-color: var(--neutral-50);
  position: relative;
  overflow: hidden;
}

.skeleton__text {
  background-color: var(--neutral-50);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.skeleton__text--title {
  height: 1.25rem;
  width: 60%;
}

.skeleton__text--meta {
  height: 1rem;
  width: 40%;
}

/* Detail Specific Skeleton Layouts */
.skeleton-detail {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers the title skeleton like real UI */
}

.skeleton__text--back {
  height: 0.875rem;
  width: 4rem;
  align-self: flex-start;
  margin-bottom: 2.5rem;
}

.skeleton__text--title-lg {
  height: 2.5rem;
  width: 80%;
  margin-bottom: 1.5rem;
}

.skeleton__text--meta-center {
  height: 0.75rem;
  width: 30%;
  margin-bottom: 2.5rem;
}

.skeleton__media--hero {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: 0.5rem;
  margin-bottom: 2.5rem;
}

.skeleton__text--body {
  height: 1rem;
  width: 100%;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.skeleton__text--body-short {
  height: 1rem;
  width: 60%;
  align-self: flex-start;
}

/* Shimmer Animation */
/* Update the selector to be more inclusive */
.skeleton__media::after,
.skeleton__text::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite ease-in-out;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
