/* ============================================================
   Sofia Ingrillì — Portfolio
   assets/style.css
   ============================================================ */

/* Google Fonts: Cormorant Garamond (display) + Inter (body) */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500&display=swap');

/* ============================================================
   RESET & ROOT
   ============================================================ */

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

:root {
  --bg:        #0c0c0b;
  --fg:        #edeae4;
  --mid:       #6a6a62;
  --subtle:    #1e1e1c;
  --border:    rgba(255,255,255,0.07);
  --accent:    #c8b89a;

  --serif:     'Cormorant Garamond', 'Georgia', serif;
  --sans:      'Inter', -apple-system, sans-serif;

  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================================
   SCROLL ANIMATION SYSTEM
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.22s; }
.reveal-delay-3 { transition-delay: 0.36s; }
.reveal-delay-4 { transition-delay: 0.5s; }

/* ============================================================
   NAV
   ============================================================ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px max(40px, calc((100% - 1290px) / 2 + 40px));
  transition: background 0.5s var(--ease-out), padding 0.4s var(--ease-out),
              border-color 0.5s var(--ease-out);
  border-bottom: 0.5px solid transparent;
}

nav.scrolled {
  background: rgba(12, 12, 11, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 14px max(40px, calc((100% - 1290px) / 2 + 40px));
  border-color: var(--border);
}

.nav-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  transition: opacity 0.3s;
}
.nav-name:hover { opacity: 0.6; }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 0.5px;
  background: var(--fg);
  transition: width 0.35s var(--ease-out);
}

.nav-links a:hover {
  color: var(--fg);
}
.nav-links a:hover::after {
  width: 100%;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
  width: 100%;
  max-width: 1290px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================================
   HERO
   ============================================================ */

#top {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 72px;
  overflow: hidden;
}

#top .container {
  position: relative;
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45);
  transform: scale(1.04);
  transition: transform 8s var(--ease-out);
}

.hero-media img.loaded {
  transform: scale(1);
}

/* Subtle gradient overlay for text legibility */
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(12,12,11,0.7) 0%,
    rgba(12,12,11,0.1) 50%,
    transparent 100%
  );
}

.hero-overlay {
  position: relative;
}

.hero-tag {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.9s var(--ease-out) 0.3s forwards;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 11vw, 100px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.1s var(--ease-out) 0.5s forwards;
}

.hero-sub {
  max-width: 380px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--mid);
  padding-top: 28px;
  border-top: 0.5px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.9s var(--ease-out) 0.8s forwards;
}

/* ============================================================
   MARQUEE
   ============================================================ */

.marquee-wrap {
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  padding: 13px 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-block;
  animation: scroll 24s linear infinite;
}

.marquee-track span {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
  margin-right: 56px;
}

.marquee-track span.dot {
  color: var(--accent);
  margin-right: 56px;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   ABOUT
   ============================================================ */

#about {
  padding: 100px 0;
  border-bottom: 0.5px solid var(--border);
}

.section-tag {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 36px;
  display: block;
}

.about-text {
  font-family: var(--serif);
  font-size: clamp(22px, 5.5vw, 34px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 820px;
}

.about-text em {
  font-style: italic;
  color: var(--accent);
}

/* ============================================================
   WORK
   ============================================================ */

#work {
  padding: 80px 0 100px;
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 56px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--border);
}

.work-header h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.work-years {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--mid);
}

/* Project items */
.project {
  border-top: 0.5px solid var(--border);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  align-items: start;
  transition: border-color 0.3s;
}

.project:last-child {
  border-bottom: 0.5px solid var(--border);
}

.project:hover .project-img img {
  transform: scale(1.03);
}

.project-col-left {
  /* image side */
}

.project-col-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 0;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.project-num {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--mid);
}

.project-cat {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 0.5px solid rgba(200,184,154,0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.project-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--subtle);
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}

.project h3 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.project p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--mid);
  max-width: 300px;
}

.project-link {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.3s, gap 0.35s var(--ease-out);
}

.project-link:hover {
  opacity: 1;
  gap: 18px;
}

.project-link svg {
  flex-shrink: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */

#contact {
  padding: 80px 0 96px;
  border-top: 0.5px solid var(--border);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-headline {
  font-family: var(--serif);
  font-size: clamp(38px, 5.5vw, 72px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 0.01em;
  position: sticky;
  top: 100px;
}

.contact-headline em {
  font-style: italic;
  color: var(--accent);
}

.contact-list {
  width: 100%;
}

.contact-item {
  display: grid;
  grid-template-columns: 40px 120px 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-top: 0.5px solid var(--border);
  transition: border-color 0.3s;
}

.contact-item:hover {
  border-color: rgba(255,255,255,0.15);
}

.contact-num {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--mid);
}

.contact-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
}

.contact-val {
  font-size: 15px;
  font-weight: 300;
  color: var(--fg);
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color 0.3s;
}

.contact-val::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 0.5px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out);
}

.contact-val:hover { color: var(--accent); }
.contact-val:hover::after { width: 100%; }

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 0.5px solid var(--border);
}

.footer-copy {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--mid);
}

.back-top {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.3s, letter-spacing 0.3s var(--ease-out);
}

.back-top:hover {
  color: var(--fg);
  letter-spacing: 0.22em;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   CUSTOM CURSOR (desktop only)
   ============================================================ */

@media (pointer: fine) {
  body { cursor: none; }

  .cursor-dot {
    position: fixed;
    width: 6px; height: 6px;
    background: var(--fg);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, background 0.2s, width 0.25s var(--ease-out), height 0.25s var(--ease-out);
  }

  .cursor-ring {
    position: fixed;
    width: 34px; height: 34px;
    border: 0.5px solid rgba(237,234,228,0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.18s var(--ease-out),
                width 0.35s var(--ease-out),
                height 0.35s var(--ease-out),
                border-color 0.3s,
                background 0.3s;
  }

  body.cursor-hover .cursor-ring {
    width: 56px; height: 56px;
    border-color: rgba(200,184,154,0.6);
    background: rgba(200,184,154,0.04);
  }

  a, button { cursor: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  nav { padding: 18px 24px; }
  nav.scrolled { padding: 12px 24px; }
  .nav-links { display: none; }

  .container { padding: 0 24px; }

  #top { padding-bottom: 64px; }

  #about  { padding: 72px 0; }
  #work   { padding: 64px 0 80px; }
  #contact{ padding: 64px 0 80px; }

  .project {
    grid-template-columns: 1fr;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-headline {
    position: static;
    font-size: clamp(34px, 9vw, 52px);
  }

  .contact-item {
    grid-template-columns: 28px 90px 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: clamp(44px, 13vw, 60px); }

  .contact-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .contact-num { display: none; }
}
