/* ============================================================
   Fang Works — gallery hero
   High contrast · orange on near-black · contemporary art space
   ============================================================ */

@font-face {
  font-family: "Clash Display";
  font-style: normal;
  font-weight: 200 700;
  font-display: block;
  src: url("../assets/fonts/ClashDisplay-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
}

:root {
  --background: #0e0e0e;
  --foreground: #ff4d00;
  --white: #ffffff;
  --hero-line-width: clamp(0.5px, 0.078125vw, 1px);
  --hero-line-gap: clamp(4px, 0.625vw, 8px);
  --display: "Clash Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-weight: 600;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

a:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-start: max(1.25rem, env(safe-area-inset-top));
  padding-inline: clamp(1.25rem, 2.5vw, 2.5rem);
}

.site-header a {
  color: var(--foreground);
  touch-action: manipulation;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-block-size: 2.75rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.site-brand-icon {
  display: block;
  flex: none;
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.25rem;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.25em;
}

/* ============================================================
   Hero — type owns the frame
   ============================================================ */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100dvh;
  height: 100svh;
  overflow: clip;
  background: var(--background);
  padding-inline: 2.5vw;
}

.hero-content {
  display: grid;
  place-items: center;
  width: 100%;
}

.hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: var(--display);
  font-weight: 600;
  font-size: min(18vw, 30vh);
  line-height: 0.84;
  text-align: center;
  text-transform: uppercase;
  color: var(--foreground);
  user-select: none;
  pointer-events: none;
}

.hero-intro {
  position: absolute;
  inset-block-end: max(3.5rem, env(safe-area-inset-bottom));
  inset-inline: 0;
  margin: 0;
  margin-inline: auto;
  max-width: 48rem;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
  color: var(--white);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.hero-line {
  position: relative;
  display: block;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--foreground) 0 var(--hero-line-width),
    transparent var(--hero-line-width)
      calc(var(--hero-line-width) + var(--hero-line-gap))
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 1px var(--foreground))
    drop-shadow(
      0 0 3px color-mix(in srgb, var(--foreground) 72%, transparent)
    )
    drop-shadow(
      0 0 6px color-mix(in srgb, var(--foreground) 34%, transparent)
    );
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  line-height: 0.84;
  text-align: center;
}

.hero-title.has-reactive-lines .hero-line {
  background: none;
  filter: none;
}

.hero-line-canvas {
  position: absolute;
  filter:
    drop-shadow(0 0 1px var(--foreground))
    drop-shadow(
      0 0 4px color-mix(in srgb, var(--foreground) 74%, transparent)
    )
    drop-shadow(
      0 0 9px color-mix(in srgb, var(--foreground) 38%, transparent)
    );
  pointer-events: none;
}

@keyframes type-in {
  from {
    opacity: 0;
    transform: translateY(0.05em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-line {
    opacity: 0;
    animation: type-in 0.85s var(--ease) forwards;
  }

  .hero-line[data-line="fang"] {
    animation-delay: 0.05s;
  }

  .hero-line[data-line="works"] {
    animation-delay: 0.14s;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hero-title {
    font-size: min(15vw, 28vh);
  }
}

/* ============================================================
   Projects
   ============================================================ */

.projects {
  width: 100%;
  padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 2.5vw, 2.5rem)
    clamp(2rem, 3vw, 3rem);
  color: var(--white);
}

.projects-header {
  inline-size: min(100%, 60rem);
  margin-inline: auto;
  margin-block-end: 1.25rem;
}

.projects h2 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.project-list {
  inline-size: min(100%, 60rem);
  margin-inline: auto;
  border-block-start: 1px solid rgb(255 255 255 / 16%);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
  padding-block: clamp(3rem, 6vw, 5rem);
  border-block-end: 1px solid rgb(255 255 255 / 16%);
}

.project-screenshot {
  margin: 0;
}

.project-screenshot img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.project-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

.project-heading {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.project-icon {
  display: block;
  inline-size: 3.125rem;
  block-size: 3.125rem;
}

.project-icon img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.project-heading h3 {
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.8vw, 2.75rem);
  font-weight: 600;
  line-height: 1;
}

.project-description {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
}

.project-description p {
  margin: 0;
  color: var(--white);
  font-size: clamp(0.9375rem, 1.15vw, 1.125rem);
  font-weight: 400;
  line-height: 1.55;
  text-wrap: pretty;
}

.project-link {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 2.75rem;
  color: var(--foreground);
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.25em;
  touch-action: manipulation;
}

.project-link span[aria-hidden="true"] {
  transition: transform 180ms var(--ease);
}

.project-link:hover span[aria-hidden="true"] {
  transform: translate(0.15rem, -0.15rem);
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .project-row {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 3rem;
  }

  .project-content {
    gap: 1.75rem;
  }

  .project-icon {
    inline-size: 2.5rem;
    block-size: 2.5rem;
  }

  .project-link {
    margin-block-start: 0.125rem;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  padding: 1.5rem clamp(1.25rem, 2.5vw, 2.5rem)
    max(2rem, env(safe-area-inset-bottom));
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  inline-size: min(100%, 60rem);
  margin-inline: auto;
  text-align: center;
}

.site-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--foreground);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.site-footer-brand-icon {
  display: block;
  flex: none;
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.site-footer-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.site-footer-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 0.25rem;
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1;
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.25em;
  touch-action: manipulation;
}
