/* ============================================================
   filipsw.com — redesign
   Minimal black / gray / white. Edit the variables below to tune.
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --fg: #f2f2f0;
  --muted: #8a8a8a;
  --line: #262626;
  --accent: #f2f2f0; /* keep monochrome; swap for a color if you ever want one */
  --font: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------
   Subtle film grain over everything (pure CSS, no image needed)
   ------------------------------------------------------------ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   Background particles (canvas injected by js/main.js)
   ------------------------------------------------------------ */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Custom cursor (elements injected by js/main.js, mouse-only)
   ------------------------------------------------------------ */
body.custom-cursor,
body.custom-cursor a,
body.custom-cursor button {
  cursor: none;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1000;
  border-radius: 50%;
  mix-blend-mode: difference;
  opacity: 0;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.3s ease,
              opacity 0.3s ease;
}

/* ring grows over clickable things, shrinks on press */
body.cursor-hover .cursor-ring {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.12);
}

body.cursor-down .cursor-ring {
  width: 28px;
  height: 28px;
}

/* ------------------------------------------------------------
   Header / nav
   ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--pad);
  mix-blend-mode: difference; /* stays readable over any section */
}

.site-header .logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  position: relative;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(2rem, 6vh, 5rem);
  position: relative;
}

.hero h1 {
  font-size: clamp(3rem, 12.5vw, 12rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero h1 .row {
  display: block;
  overflow: hidden;
}

.hero h1 .row > span {
  display: block;
  transform: translateY(110%);
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero h1 .row:nth-child(2) > span { animation-delay: 0.12s; }

@keyframes rise {
  to { transform: translateY(0); }
}

.hero .hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade 1s ease 0.6s forwards;
}

@keyframes fade { to { opacity: 1; } }

.hero .hero-meta p {
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero .hero-meta .scroll-hint {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Sections — shared
   ------------------------------------------------------------ */
section {
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  scroll-margin-top: 1rem; /* keeps anchored sections clear of the fixed nav */
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */
.about .statement {
  font-size: clamp(1.5rem, 3.4vw, 3rem);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 24em;
}

.about .statement .dim { color: var(--muted); }

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-top: clamp(3rem, 8vh, 5rem);
}

.about-grid h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1rem;
}

.about-grid ul { list-style: none; }
.about-grid li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Projects
   ------------------------------------------------------------ */
.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 7vh, 5rem) 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
}

.project:first-of-type { padding-top: 0; }

/* alternate image side on even rows */
.project:nth-of-type(even) .project-media { order: 2; }

.project-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
}

.project-media img,
.project-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.02);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.8s ease;
}

.project:hover .project-media img,
.project:hover .project-media svg {
  transform: scale(1.08);
  filter: grayscale(0.4) contrast(1.05);
}

.project-info .index {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: block;
  margin-bottom: 1.25rem;
}

.project-info h3 {
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.project-info p {
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 1.5rem;
}

.project-info .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.project-info .tags span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.project-info .view {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.project-info .view .arrow {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.project:hover .view .arrow { transform: translateX(6px); }

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.contact { padding-bottom: 2rem; }

.contact .big-link {
  display: block;
  font-size: clamp(2.5rem, 9vw, 8.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: clamp(2rem, 6vh, 4rem) 0;
  transition: color 0.3s ease;
}

.contact .big-link:hover { color: var(--muted); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.contact-links a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  transition: color 0.3s ease;
}

.contact-links a:hover { color: var(--fg); }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem var(--pad);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Scroll-reveal (elements with .reveal fade in via js/main.js)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero h1 .row > span { animation: none; transform: none; }
  .hero .hero-meta { animation: none; opacity: 1; }
}

/* ------------------------------------------------------------
   Project detail pages
   ------------------------------------------------------------ */
.detail-hero {
  padding: calc(5rem + 8vh) var(--pad) 0;
}

.detail-hero .back {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 3rem;
  transition: color 0.3s ease;
}

.detail-hero .back:hover { color: var(--fg); }

.detail-hero h1 {
  font-size: clamp(2.75rem, 9vw, 8rem);
  line-height: 0.95;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}

.detail-meta h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.detail-meta p { font-size: 0.95rem; }

.detail-media {
  margin: 0 var(--pad);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}

.detail-media img, .detail-media svg {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1);
}

.detail-body {
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
  max-width: 70ch;
}

.detail-body h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
  margin: 3rem 0 1rem;
}

.detail-body h2:first-child { margin-top: 0; }

.detail-body p {
  color: #c9c9c6;
  margin-bottom: 1.25rem;
}

.detail-body .demo-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.9rem 2rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: background 0.3s ease, color 0.3s ease;
}

.detail-body .demo-link:hover {
  background: var(--fg);
  color: var(--bg);
}

.next-project {
  display: block;
  padding: clamp(4rem, 10vh, 7rem) var(--pad);
  border-top: 1px solid var(--line);
}

.next-project .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: block;
  margin-bottom: 1rem;
}

.next-project .title {
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.next-project:hover .title { color: var(--muted); }

/* ------------------------------------------------------------
   Mobile
   ------------------------------------------------------------ */
@media (max-width: 720px) {
  .project {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .project:nth-of-type(even) .project-media { order: 0; }
  .hero .hero-meta { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 1.25rem; }
  .site-footer { flex-direction: column; gap: 0.5rem; }
}
