/* Ishan Portfolio - Authentic Pure Black Stylesheet
   Faithful reproduction of ingrassiadaniel.it visual layout & mechanics */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* Clash Display - Modern High-Impact Geometric Editorial Grotesque */
@font-face {
  font-family: 'Clash Display';
  src: url('/fonts/ClashDisplay-Regular.woff2') format('woff2'),
       url('https://cdn.fontshare.com/wf/VFMK2COV3DN37JR7JQ4CAOJPZ7KWKNY7/ODD5YJNDLHZZB2MIT3DPVH4EIHAMZ34D/BSY64LPTT3OPLVKAZKL3AHKRWZ3D74AC.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Clash Display';
  src: url('/fonts/ClashDisplay-Medium.woff2') format('woff2'),
       url('https://cdn.fontshare.com/wf/2GQIT54GKQY3JRFTSHS4ARTRNRQISSAA/3CIP5EBHRRHE5FVQU3VFROPUERNDSTDF/JTSL5QESUXATU47LCPUNHZQBDDIWDOSW.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Clash Display';
  src: url('/fonts/ClashDisplay-Semibold.woff2') format('woff2'),
       url('https://cdn.fontshare.com/wf/FPDAZ2S6SW4QMSRIIKNNGTPM6VIXYMKO/5HNPQ453FRLIQWV2FNOBUU3FKTDZQVSG/Z3MGHFHX6DCTLQ55LJYRJ5MDCZPMFZU6.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Clash Display';
  src: url('/fonts/ClashDisplay-Bold.woff2') format('woff2'),
       url('https://cdn.fontshare.com/wf/BFBSY7LX5W2U2EROCLVVTQP4VS7S4PC3/IIUX4FGTMD2LK2VWD3RVTAS4SSMUN7B5/53RZKGODFYDW3QHTIL7IPOWTBCSUEZK7.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --background: #000000;
  --foreground: #f0f2f0;
  --muted: #8b8f8c;
  --accent: #f4ce15;
  --accent-secondary: #379777;
  --font-sans: 'Clash Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: var(--background);
  color: var(--foreground);
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: var(--accent);
  color: var(--background);
}

/* =========================================================================
   Typography (Matching exact proportional vw/vh scales from ingrassiadaniel.it)
   ========================================================================= */

.t-16 { font-size: 0.833333vw; line-height: 1.14583vw; letter-spacing: 0.05em; font-weight: 500; }
.t-15, p { font-size: 0.78125vw; line-height: 1.04167vw; letter-spacing: -0.01em; }
.t-20 { font-size: 1.04167vw; line-height: 1.30208vw; letter-spacing: -0.015em; font-weight: 500; }
.t-27 { font-size: 1.40625vw; line-height: 1.66667vw; letter-spacing: -0.02em; font-weight: 500; }
.t-30 { font-size: 1.625vw; line-height: 1.9vw; letter-spacing: -0.025em; font-weight: 500; }
.t-49 { font-size: 2.55208vw; line-height: 3.07292vw; letter-spacing: -0.03em; font-weight: 600; }
.t-60 { font-size: 3.125vw; line-height: 3.38542vw; letter-spacing: -0.035em; font-weight: 600; }
.t-85 { font-size: 4.42708vw; line-height: 5.3125vw; letter-spacing: -0.04em; font-weight: 700; }

@media (orientation: portrait), (max-width: 900px) {
  .t-16 { font-size: 1.62963vh; line-height: 2.24074vh; }
  .t-15, p { font-size: 1.52778vh; line-height: 2.03704vh; }
  .t-20 { font-size: 2.03704vh; line-height: 2.5463vh; }
  .t-27 { font-size: 2.75vh; line-height: 3.25926vh; }
  .t-30 { font-size: 3.05556vh; line-height: 3.56481vh; }
  .t-49 { font-size: 4.99074vh; line-height: 6.00926vh; }
  .t-60 { font-size: 6.11111vh; line-height: 6.62037vh; }
  .t-85 { font-size: 8.65741vh; line-height: 10.3889vh; }
}

/* =========================================================================
   Noise Layer (5-step infinite grain animation)
   ========================================================================= */

.noise-layer {
  position: fixed;
  top: -110%;
  left: -50%;
  width: 300%;
  height: 300%;
  background-image: url('/noise.jpg');
  opacity: 0.1;
  z-index: 10;
  pointer-events: none;
  animation: 3s steps(5, end) infinite noiseGrain;
}

@keyframes noiseGrain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translateY(15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* =========================================================================
   Preloader
   ========================================================================= */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--background);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  opacity: 1;
  filter: blur(0px);
  transition: opacity 0.7s, filter 0.7s;
}

.preloader[data-dismissing="true"] {
  opacity: 0;
  filter: blur(10px);
}

.preloader-count {
  color: var(--foreground);
  font-size: clamp(2rem, 4vw, 4rem);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.6s, filter 0.6s;
}

.preloader-count[data-entered="true"] {
  opacity: 1;
  filter: blur(0px);
}

/* =========================================================================
   Custom Cursor with Ribbon Comet Tail
   ========================================================================= */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-cursor[data-visible="true"] {
  opacity: 1;
}

.custom-cursor-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.custom-cursor-head {
  --s: 8px;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--foreground);
  box-shadow: 0 0 10px 2px var(--foreground);
  will-change: transform;
  border-radius: 50%;
  transition: width 0.3s, height 0.3s, margin 0.3s, background-color 0.3s, box-shadow 0.3s;
  position: absolute;
  top: 0;
  left: 0;
}

.custom-cursor[data-hover="true"] .custom-cursor-head {
  --s: 40px;
  box-shadow: inset 0 0 0 1px var(--foreground);
  background: transparent;
}

/* =========================================================================
   Three.js Particle Scene Canvas
   ========================================================================= */

.particle-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--background);
  pointer-events: none;
}

.particle-scene canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* =========================================================================
   Layout Sections
   ========================================================================= */

.content {
  position: relative;
  z-index: 1;
}

/* Hero Section (Frame 00) */
.hero-section {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 100svh;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-copy {
  pointer-events: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25vw;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35vw;
  pointer-events: auto;
}

.hero-kicker {
  font-family: var(--font-clash, 'Clash Display', -apple-system, sans-serif);
  font-size: clamp(0.78rem, 0.92vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.2;
}

#heroIshan {
  font-weight: 600;
  letter-spacing: -0.035em;
  font-size: 2.05vw;
  line-height: 2.2vw;
  margin: 0;
  pointer-events: auto;
}

#heroRole {
  text-align: right;
  font-weight: 500;
  letter-spacing: -0.025em;
  font-size: 1.8vw;
  line-height: 2.1vw;
  justify-content: flex-end;
  margin: 0;
  pointer-events: auto;
}

@media (orientation: portrait), (max-width: 900px) {
  .hero-section {
    align-items: stretch;
    padding-block: 5vw;
  }
  .hero-copy {
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
  }
  .hero-left {
    gap: 0.8vh;
  }
  .hero-kicker {
    font-size: 1.6vh;
    letter-spacing: 0.08em;
  }
  #heroIshan {
    text-align: left;
    font-size: 3.6vh;
    line-height: 3.8vh;
  }
  #heroRole {
    text-align: right;
    font-size: 3.2vh;
    line-height: 3.8vh;
  }
}

/* Statement Section (Frame 02) */
.statement-section {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 100svh;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.statement-copy {
  pointer-events: none;
  max-width: 41.6667vw;
  display: flex;
  flex-direction: column;
  gap: 1.48vh;
}

@media (orientation: portrait) {
  .statement-section { padding-block: 5vw; }
  .statement-copy { max-width: 100%; }
}

/* Location / Map Section (Frame 04) */
.location-section {
  position: relative;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100svh;
}

.location-label {
  position: fixed;
  bottom: 8svh;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  opacity: var(--italy-ready, 0);
  filter: blur(calc((1 - var(--italy-ready, 0)) * 10px)) brightness(var(--italy-ready, 0));
  transition: opacity 0.3s ease, filter 0.3s ease;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
}

/* Philosophy Section (Frame 06) */
.philosophy-section {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  height: 100svh;
}

.philosophy-content {
  pointer-events: none;
  position: fixed;
  inset: 0;
  width: 90vw;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  opacity: var(--work-ready, 0);
  filter: blur(calc((1 - var(--work-ready, 0)) * 10px)) brightness(var(--work-ready, 0));
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.philosophy-line {
  text-align: center;
  text-wrap: balance;
  max-width: 50vw;
  margin: 0 auto;
}

@media (orientation: portrait), (max-width: 900px) {
  .philosophy-line { max-width: 90%; }
}

/* =========================================================================
   Selected Works - Pinned Horizontal Carousel (Frame 08 - 11)
   ========================================================================= */

.works-section {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 420svh; /* Calibrated scroll space driving the pinned horizontal track */
}

.works-kicker {
  position: fixed;
  top: 5.92593vh;
  left: 0;
  z-index: 20;
}

.works-kicker-label {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  margin: 0;
  position: absolute;
  top: 0;
  left: 4.16667vw;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.4s, filter 0.4s;
}

.works-kicker-label[data-active="true"] {
  opacity: 1;
  filter: blur(0px);
}

.works-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.works-stage[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
}

.works-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  margin-top: 4.62963vh;
  overflow: hidden;
}

.works-track {
  display: flex;
  align-items: center;
  gap: 12vw;
  width: max-content;
  will-change: transform;
  padding-left: 20vw;
  padding-right: 30vw;
}

/* Individual Project Card Tile */
.playground-tile {
  flex: none;
  display: block;
}

.tile-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.tile-media {
  aspect-ratio: 16 / 9;
  width: 50vw;
  position: relative;
  border-radius: 14px;
  overflow: visible;
  transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

@media (orientation: portrait) {
  .tile-media { width: 85vw; }
}

.tile-media canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.tile-link:hover .tile-media canvas {
  filter: none;
}

.tile-circle-btn {
  position: absolute;
  top: 1.8vw;
  right: 1.8vw;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(8, 10, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.tile-link:hover .tile-circle-btn {
  transform: scale(1.1);
  background: rgba(18, 24, 32, 0.95);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
}

.tile-arrow {
  font-size: 1.2rem;
  color: inherit;
  transition: transform 0.3s ease;
}

.tile-link:hover .tile-arrow {
  transform: translate(2px, -2px);
}

.playground-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25vw;
  margin-top: 2.77vh;
}

.caption-title {
  color: var(--foreground);
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.caption-meta {
  display: flex;
  align-items: baseline;
  gap: 0.833vw;
}

.caption-info, .caption-year {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Closing Wrap (Frame 12) */
.closing-wrap {
  position: absolute;
  inset: 0;
  width: 90vw;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 5;
}

.closing-line {
  font-family: var(--font-clash, 'Clash Display', -apple-system, sans-serif);
  font-weight: 500;
  text-align: left;
  text-wrap: balance;
  max-width: 33.3333vw;
  color: var(--foreground);
  margin: 0;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.5s ease-out, filter 0.5s ease-out;
}

.closing-line[data-active="true"] {
  opacity: 1;
  filter: blur(0px);
}

@media (orientation: portrait) {
  .closing-line { max-width: 100%; }
}

/* =========================================================================
   Contacts & Rectangular Chalk-Dust Frame (Frame 14)
   ========================================================================= */

.contacts-section {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 100svh;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contacts-copy {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.388vh;
  position: relative;
}

.contacts-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contacts-email-wrap {
  position: relative;
  display: inline-block;
}

.contacts-email {
  color: var(--foreground);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-decoration: none;
  font-size: clamp(2.5rem, 5.5vw, 6rem);
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.3s ease;
}

.contacts-email:hover {
  color: #ffffff;
}

.copy-toast {
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.copy-toast[data-active="true"] {
  opacity: 1;
}

.contacts-subline {
  color: var(--muted);
}

.contacts-link {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.3s ease-in-out;
}

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

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

.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  width: 90vw;
  margin: 0 auto;
  padding: 2.22222vh 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.833333vw;
}

.footer-line {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  font-size: clamp(0.65rem, 0.75vw, 0.9rem);
}

.footer-link {
  text-decoration: none;
  display: inline-block;
}

.footer-link:hover .footer-line {
  color: var(--foreground);
}

@media (orientation: portrait) {
  .site-footer {
    text-align: center;
    justify-content: center;
    row-gap: 6vw;
    padding: 10vw 0;
  }
}

/* =========================================================================
   Project Detail Modal
   ========================================================================= */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--background);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.5s;
}

.project-modal[data-active="true"] {
  opacity: 1;
  visibility: visible;
}

.project-modal-container {
  width: 90vw;
  max-width: 67.7vw;
  margin: 0 auto;
  padding: 5.18vh 0;
}

@media (orientation: portrait) {
  .project-modal-container { max-width: 100%; }
}

.modal-back-btn {
  cursor: pointer;
  background: transparent;
  border: none;
  margin-bottom: 5.92vh;
  padding: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3125vw;
  color: var(--foreground);
  transition: color 0.3s ease-in-out;
}

.modal-back-btn:hover {
  color: var(--muted);
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25vw;
  margin-bottom: 1.85vh;
}

.modal-title {
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.modal-meta {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-hero-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050508;
  border: 1px solid rgba(240, 242, 240, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5vh;
}

.modal-hero-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-tagline {
  color: var(--foreground);
  margin-bottom: 3vh;
}

.modal-desc-p {
  max-width: 41.6667vw;
  margin-bottom: 2.22vh;
  color: var(--foreground);
  line-height: 1.6;
}

@media (orientation: portrait) {
  .modal-desc-p { max-width: 100%; }
}

.modal-section {
  margin: 6vh 0;
}

.modal-section-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5vh;
}

.modal-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52vw;
  list-style: none;
}

.modal-stack-item {
  border: 1px solid var(--muted);
  color: var(--foreground);
  padding: 0.55vh 0.72vw;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}
