/* ===========================================================
   ATTILIO · PORTFOLIO 2026
   Editorial / Atelier digitale
   =========================================================== */

:root {
  --ink: #0d0c0a;
  --ink-2: #161410;
  --cream: #efe9dc;
  --cream-dim: #cfc8b9;
  --muted: #857f73;
  --line: rgba(239, 233, 220, 0.10);
  --line-strong: rgba(239, 233, 220, 0.18);
  --accent: #ff5e2b;

  --pad-x: clamp(1.25rem, 4vw, 4rem);
  --section-gap: clamp(6rem, 12vw, 10rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--cream);
  overflow-x: hidden;
}

/* hide native scrollbar — replaced by custom progress bar */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* custom scroll progress bar (top of page) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  z-index: 200;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  box-shadow: 0 0 14px rgba(255, 94, 43, 0.45);
  will-change: transform;
}

html {
  scroll-behavior: auto;
}

body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv01';
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

/* hide custom cursor on touch / mobile / coarse-pointer devices */
@media (hover: none), (pointer: coarse), (max-width: 880px) {
  body { cursor: auto !important; }
  .cursor-wrap { display: none !important; }
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* ============== GRAIN OVERLAY ============== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='1'/></svg>");
  animation: grain 8s steps(8) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -5%); }
  20% { transform: translate(-10%, 5%); }
  30% { transform: translate(5%, -10%); }
  40% { transform: translate(-5%, 15%); }
  50% { transform: translate(-10%, 5%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 10%); }
  80% { transform: translate(-15%, 0); }
  90% { transform: translate(10%, 5%); }
}

/* ============== CUSTOM CURSOR ============== */
.cursor-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  z-index: 10001;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid var(--cream);
  opacity: 0.5;
  transition: width 0.3s, height 0.3s, opacity 0.3s, background 0.3s;
  z-index: 10000;
}

.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  opacity: 1;
  background: rgba(255, 94, 43, 0.08);
  border-color: var(--accent);
}

.cursor-ring.is-text {
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: difference;
}

/* ============== LOADER ============== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-inner {
  width: min(560px, 80vw);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loader-mark {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loader-bar {
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.loader-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--accent);
}

.loader-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  font-style: italic;
  letter-spacing: -0.02em;
  text-align: center;
  margin-top: 0.5rem;
  opacity: 0;
}

/* ============== NAV ============== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem var(--pad-x);
  pointer-events: none;
  opacity: 0;
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  pointer-events: auto;
  background: rgba(13, 12, 10, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.65rem 1.25rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1;
}

.nav-logo .font-display {
  color: var(--cream);
  transition: color 0.3s;
}
.nav-logo:hover .font-display {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  position: relative;
  color: var(--cream-dim);
  transition: color 0.3s;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}
.nav-link::before {
  content: attr(data-num);
  font-size: 9px;
  color: var(--accent);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.3s, transform 0.3s;
}
.nav-link:hover {
  color: var(--cream);
}
.nav-link:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.5s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 94, 43, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255, 94, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 94, 43, 0); }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-inner { grid-template-columns: 1fr 1fr; }
  .nav-meta { font-size: 9px; }
}

/* ============== HERO ============== */
.hero {
  min-height: 100vh;
  position: relative;
  padding: 7rem var(--pad-x) 3rem;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  overflow: hidden;
}

.hero-rail {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  letter-spacing: 0.4em;
}
.hero-rail-left { left: 0.5rem; }
.hero-rail-right { right: 0.5rem; }

@media (max-width: 1024px) {
  .hero-rail { display: none; }
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2rem;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-top-l {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.block-line {
  width: 36px;
  height: 1px;
  background: var(--cream-dim);
  display: inline-block;
}

.hero-top-r {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* hero title */
.hero-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  margin: 0;
  align-self: center;
  font-size: clamp(3.25rem, 11.5vw, 13rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: clamp(0.25rem, 1vw, 1rem);
  padding: clamp(1rem, 4vw, 4rem) 0;
}

.hero-line {
  display: flex;
  align-items: baseline;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  flex-wrap: wrap;
}

.line-1 { padding-left: clamp(2rem, 8vw, 8rem); }
.line-2 { padding-left: clamp(0rem, 2vw, 2rem); }
.line-3 { padding-left: clamp(4rem, 12vw, 12rem); }
.line-4 { padding-left: clamp(1rem, 5vw, 5rem); }

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  letter-spacing: 0.1em;
  color: var(--accent);
  align-self: flex-start;
  padding-top: 1.5em;
  font-style: normal;
}

.hero-em {
  font-style: italic;
  position: relative;
  font-size: 1.18em;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.hero-em-small {
  font-style: italic;
  color: var(--accent);
  font-size: 0.7em;
}

.asterisk {
  font-style: normal;
  color: var(--accent);
  font-size: 0.7em;
  vertical-align: super;
  margin-left: 0.05em;
}

.hero-word {
  display: inline-block;
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-bottom-l {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.hero-note {
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--cream-dim), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--accent);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0%   { transform: translateY(-100%); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateY(400%); opacity: 0; }
}

/* corner marks */
.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
}
.corner-tl { top: 1rem; left: 1rem; border-right: 0; border-bottom: 0; }
.corner-tr { top: 1rem; right: 1rem; border-left: 0; border-bottom: 0; }
.corner-bl { bottom: 1rem; left: 1rem; border-right: 0; border-top: 0; }
.corner-br { bottom: 1rem; right: 1rem; border-left: 0; border-top: 0; }

/* ============== SECTION FRAME ============== */
.section {
  padding: var(--section-gap) var(--pad-x);
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.section-num {
  color: var(--accent);
  flex-shrink: 0;
}

.section-label {
  color: var(--cream-dim);
  flex-shrink: 0;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* ============== ABOUT ============== */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-photo-wrap {
  position: sticky;
  top: 6rem;
  display: flex;
  gap: 1rem;
}

.about-photo {
  margin: 0;
  position: relative;
  flex: 1;
}

.photo-mask {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--ink-2);
  border: 1px solid var(--line);
  clip-path: inset(0 0 100% 0);
}

.photo-mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.4) contrast(1.05) brightness(0.95);
  transition: filter 0.6s ease;
}

.about-photo:hover .photo-mask img {
  filter: grayscale(0) contrast(1) brightness(1);
}

.photo-caption {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.about-photo-side {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.4em;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.about-text {
  padding-top: 2rem;
}

.about-eyebrow {
  margin: 0 0 1.5rem;
}

.about-title {
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 2.5rem;
  color: var(--cream);
}

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

.about-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--cream-dim);
  margin-bottom: 2.5rem;
  max-width: 56ch;
}

.dropcap::first-letter {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 3.5em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.1em 0 0;
  color: var(--accent);
}

.kbd {
  display: inline-block;
  padding: 0.1em 0.5em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cream);
  margin: 0 0.1em;
}

.about-meta {
  list-style: none;
  padding: 1.5rem 0 0;
  margin: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.about-meta li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

/* ============== STACK ============== */
.stack-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.stack-title {
  font-size: clamp(1.75rem, 4.2vw, 3.5rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 18ch;
}

.stack-title em {
  font-style: italic;
  color: var(--accent);
}

.marquee {
  position: relative;
  overflow: hidden;
  margin: 0 calc(var(--pad-x) * -1);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
}

.marquee + .marquee {
  border-top: 0;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}

.m-item {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cream);
  font-style: italic;
  transition: color 0.3s;
  cursor: default;
}

.m-item:hover { color: var(--accent); }

.m-item-alt {
  font-style: normal;
  color: var(--cream-dim);
  -webkit-text-stroke: 1px var(--cream);
  -webkit-text-fill-color: transparent;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.m-item-alt:hover {
  -webkit-text-stroke: 1px var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.m-dot {
  color: var(--accent);
  font-size: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
}

/* stack grid */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 880px) {
  .stack-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.stack-col-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stack-col-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.5;
  font-weight: 400;
}

.stack-list li {
  position: relative;
  padding-left: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  transition: padding-left 0.3s, color 0.3s;
}

.stack-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.5em;
  line-height: 1;
}

.stack-list li:hover {
  padding-left: 1.75rem;
  color: var(--accent);
}

.stack-list em {
  font-style: italic;
  color: var(--cream-dim);
}

/* ============== WORK / EXPERIENCE ============== */
.section-work {
  position: relative;
}

.work-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.work-title {
  font-size: clamp(1.75rem, 4.2vw, 3.5rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0;
}

.work-title em {
  font-style: italic;
  color: var(--accent);
}

.work-list {
  border-top: 1px solid var(--line-strong);
}

.work-item {
  display: block;
  border-bottom: 1px solid var(--line-strong);
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  position: relative;
  transition: padding 0.4s;
  color: inherit;
  text-decoration: none;
}

.work-item:hover {
  padding-left: 1.5rem;
}

.work-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.4s;
}

.work-item:hover::before {
  width: 4px;
}

.work-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: clamp(1rem, 3vw, 3rem);
  align-items: baseline;
}

.work-num {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  align-self: center;
}

.work-name {
  font-size: clamp(2.25rem, 6.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 400;
  color: var(--cream);
  transition: color 0.4s;
}

.work-name em {
  font-style: italic;
}

.work-item:hover .work-name {
  color: var(--accent);
}

.work-role {
  color: var(--cream-dim);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  align-self: center;
}

.work-arrow {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--cream-dim);
  transition: transform 0.4s, color 0.4s;
  align-self: center;
}

.work-item:hover .work-arrow {
  color: var(--accent);
  transform: translate(0.25rem, -0.25rem);
}

.work-meta {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding-left: clamp(2rem, 5vw, 5rem);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s, margin 0.4s;
}

.work-item:hover .work-meta {
  max-height: 200px;
  opacity: 1;
  margin-top: 1.5rem;
}

.work-desc {
  margin: 0;
  color: var(--cream-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 60ch;
}

.work-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream-dim);
  align-self: end;
  justify-content: flex-end;
}

@media (max-width: 880px) {
  .work-row { grid-template-columns: auto 1fr auto; }
  .work-arrow { display: none; }
  .work-meta { grid-template-columns: 1fr; }
  .work-tags { justify-content: flex-start; }
}

/* floating preview */
.work-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 260px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  border: 1px solid var(--line-strong);
  background: var(--ink-2);
  overflow: hidden;
  will-change: transform;
}

.work-preview-inner {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: var(--ink-2);
  filter: contrast(1.02);
}

@media (max-width: 720px) {
  .work-preview { width: 280px; height: 180px; }
}

@media (hover: none) {
  .work-preview { display: none; }
}

/* ============== MANIFESTO ============== */
.section-manifesto {
  position: relative;
}

.manifesto-wrap {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  padding: 2rem 0;
}

.manifesto-eyebrow {
  margin: 0 0 2rem;
}

.manifesto-text {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
  color: var(--cream);
  border: 0;
  quotes: none;
}

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

.m-line {
  display: block;
  overflow: hidden;
}

.manifesto-sign {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.manifesto-line {
  width: 60px;
  height: 1px;
  background: var(--cream-dim);
}

/* ============== CONTACT ============== */
.section-contact {
  padding-bottom: clamp(8rem, 14vw, 12rem);
}

.contact-wrap {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.contact-eyebrow {
  margin: 0;
}

.contact-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(4rem, 16vw, 16rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  margin: 0;
  font-weight: 400;
  color: var(--cream);
}

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

.c-line {
  display: block;
  overflow: hidden;
}

.c-line:nth-child(2) {
  padding-left: clamp(2rem, 6vw, 6rem);
}

.contact-mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  align-self: flex-start;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.5rem;
  transition: border-color 0.3s;
}

.contact-mail:hover {
  border-color: var(--accent);
}

.contact-mail-text {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--cream);
  transition: color 0.3s;
}

.contact-mail:hover .contact-mail-text {
  color: var(--accent);
}

.contact-mail-arrow {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1rem, 2.5vw, 2rem);
  color: var(--cream-dim);
  transition: transform 0.3s, color 0.3s;
}

.contact-mail:hover .contact-mail-arrow {
  color: var(--accent);
  transform: translate(0.25rem, -0.25rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 720px) {
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.contact-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-val {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--cream);
}

.contact-socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  color: var(--cream-dim);
  position: relative;
  transition: color 0.3s;
  display: inline-block;
}

.social-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

.social-link:hover {
  color: var(--accent);
}

.social-link:hover::after {
  width: 100%;
}

/* ============== FOOTER ============== */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--pad-x) 1.5rem;
  margin-top: auto;
  position: relative;
}

.footer-marquee {
  overflow: hidden;
  margin: -2.5rem calc(var(--pad-x) * -1) 2.5rem;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.footer-track {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
  width: max-content;
  font-size: clamp(2rem, 5vw, 4rem);
  font-style: normal;
  line-height: 1;
  color: var(--cream-dim);
  will-change: transform;
}

.footer-track em {
  font-style: italic;
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============== UTIL ============== */
.magnetic {
  display: inline-block;
  will-change: transform;
}

/* hide initial states for GSAP reveals */
.js-hero-line { overflow: hidden; }
.js-reveal { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .grain { display: none; }
}

/* ============== TOUCH / COARSE-POINTER OVERRIDES ==============
   Neutralize every :hover effect on devices without a real mouse,
   so a tap doesn't get stuck in "sticky hover" state. */
@media (hover: none), (pointer: coarse) {
  .nav-logo:hover .font-display { color: var(--cream); }
  .nav-link:hover { color: var(--cream-dim); }
  .nav-link:hover::before { opacity: 0; transform: translateY(-2px); }
  .about-photo:hover .photo-mask img { filter: grayscale(0.4) contrast(1.05) brightness(0.95); }
  .m-item:hover { color: var(--cream); }
  .m-item-alt:hover {
    -webkit-text-stroke: 1px var(--cream);
    -webkit-text-fill-color: transparent;
  }
  .stack-list li:hover { padding-left: 1.25rem; color: inherit; }
  .work-item:hover { padding-left: 0; }
  .work-item:hover::before { width: 0; }
  .work-item:hover .work-name { color: var(--cream); }
  .work-item:hover .work-arrow { color: var(--cream-dim); transform: none; }
  .work-item:hover .work-meta { max-height: 0; opacity: 0; margin-top: 1rem; }
  .contact-mail:hover { border-color: var(--line-strong); }
  .contact-mail:hover .contact-mail-text { color: var(--cream); }
  .contact-mail:hover .contact-mail-arrow { color: var(--cream-dim); transform: none; }
  .social-link:hover { color: var(--cream-dim); }
  .social-link:hover::after { width: 0; }
}
