/* darioenchelli.me — site-specific layer
   Lives on top of denkhub-core.css + colors_and_type.css.
   Personal profile site: photo-first, first person, intentionally not SaaS. */

:root {
  --de-navy:  #1a2c5e;   /* logo disc color (sampled from de-lockup) */
  --de-green: #79c142;   /* logo crescent color (personal accent only) */
}

/* ───────────── base ───────────── */
body { min-height: 100vh; font-family: var(--font-system-stack); }

body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(0,179,255,0.08), transparent 60%),
    radial-gradient(50% 40% at 90% 0%, rgba(141,125,255,0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ───────────── header (floats over cover; transparent always) ───────────── */
.public-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 0;
  transition: padding var(--motion-base) ease, backdrop-filter var(--motion-base) ease;
}
/* When scrolled past the cover: subtle blur + slight compact padding.
   No solid background — keeps the floating feel. */
.public-header.is-scrolled {
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg-color) 28%, transparent);
}
.public-header.is-scrolled .header-inner { padding-top: 10px; padding-bottom: 10px; }
.public-header.is-scrolled .logo-lockup img { height: 22px; }

.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px clamp(20px, 3vw, 44px);
  transition: padding var(--motion-base) ease;
}
.header-inner .logo-lockup { grid-column: 2; justify-self: center; }
.header-inner .header-cta  { grid-column: 3; justify-self: end; }
.logo-lockup img { transition: height var(--motion-base) ease; }
.logo-lockup {
  display: inline-flex; align-items: center;
  text-decoration: none;
  transition: opacity var(--motion-base) ease;
}
.logo-lockup:hover { opacity: 0.82; }
.logo-lockup img {
  height: 34px; width: auto;
  /* the lockup SVG ships in navy on white; we invert it to read on dark */
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.header-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--surface-color) 60%, transparent);
  transition: color var(--motion-base) ease, border-color var(--motion-base) ease;
}
.header-cta:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent-color) 28%, var(--border-color)); }
.header-cta svg { width: 14px; height: 14px; opacity: 0.7; }

/* ───────────── HERO — full-bleed cinematic cover ───────────── */
.cover {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  /* header is fixed and floats over us; cover photo extends behind it */
}
/* Photo lives on the RIGHT half of the cover.
   Left half is the bg (deep black) where the type breathes.
   A long horizontal fade dissolves the photo's left edge into black. */
.cover-photo {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 55%;
  z-index: -2;
  overflow: hidden;
}

.cover-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* JS overrides object-position dynamically (see fitFocal in index.html).
     Static fallback kicks in if JS fails or before it loads. */
  object-position: 70% 35%;
  display: block;
}

/* Photo region width per breakpoint — JS handles vertical/horizontal anchor of the face */
@media (max-width: 1180px) { .cover-photo { width: 58%; } }
@media (max-width: 940px)  { .cover-photo { width: 64%; } }

/* Mobile: photo becomes a defined band at the TOP of the cover (~62vh).
   Text sits below on solid black. Bottom of the photo fades to bg via the
   ::after gradient — no abrupt edge, and the face naturally rises higher
   because the photo region itself sits in the upper viewport. */
@media (max-width: 820px) {
  .cover-photo {
    width: 100%;
    top: 0; bottom: auto;
    height: 62vh;
  }
}
/* Long horizontal dissolve from black (left) to fully visible photo (right).
   On mobile we switch to a vertical dissolve so the face stays clear up top
   and the text reads on solid black at the bottom. */
.cover-photo::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(
      90deg,
      var(--bg-color)   0%,
      rgba(0,0,0,0.96)  6%,
      rgba(0,0,0,0.72) 18%,
      rgba(0,0,0,0.42) 34%,
      rgba(0,0,0,0.18) 52%,
      rgba(0,0,0,0.04) 75%,
      rgba(0,0,0,0)   100%
    ),
    linear-gradient(180deg,
      rgba(0,0,0,0.32) 0%,
      rgba(0,0,0,0)   18%,
      rgba(0,0,0,0)   72%,
      rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
@media (max-width: 820px) {
  /* Sfumata sotto la foto: trasparente in alto, fonde nel bg in basso.
     Il photo wrapper è alto 62vh, il fade copre l'ultimo 35% così il bordo
     basso si dissolve nel nero invece di tagliare netto. */
  .cover-photo::after {
    background: linear-gradient(
      180deg,
      transparent       0%,
      transparent      55%,
      rgba(0,0,0,0.55) 75%,
      rgba(0,0,0,0.92) 90%,
      var(--bg-color) 100%
    );
  }
}
/* Make sure the rest of the cover (left half) reads as the brand black. */
.cover { background: var(--bg-color); }

/* subtle grain over the whole cover for cinematic feel */
.cover::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.85 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.cover-inner {
  width: 100%;
  /* top padding accounts for the fixed header (≈70px) + breathing room */
  padding: 90px clamp(40px, 8vw, 160px) 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}
.cover-text {
  max-width: 560px;
}
.cover-aside {
  position: absolute;
  right: clamp(20px, 3vw, 44px);
  bottom: 36px;
}
@media (max-width: 820px) {
  .cover { min-height: 92vh; }
  .cover-inner {
    padding: 28px 22px 40px;
    justify-content: flex-end;  /* text drops to the bottom; face owns the top */
  }
  .cover-text { max-width: 100%; }
}

.cover-meta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245,245,247,0.75);
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.cover-meta .meta-bar {
  width: 32px; height: 1px; background: rgba(245,245,247,0.55);
}
.cover-name {
  font-family: var(--font-display-stack);
  font-size: clamp(56px, 12vw, 168px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin: 0;
  color: var(--text-primary);
  text-wrap: balance;
}
.cover-name .surname {
  display: block;
  background: linear-gradient(135deg, #00b3ff 0%, #a1c4fd 55%, #f5f5f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cover-tag {
  margin: 22px 0 0;
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.5;
  color: rgba(245,245,247,0.86);
  max-width: 32ch;
}
.cover-tag strong { color: var(--text-primary); font-weight: 600; }

.cover-links {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cover-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgba(245,245,247,0.92);
  text-decoration: none;
  font-size: 13px;
  transition: border-color var(--motion-base) ease, background var(--motion-base) ease, transform var(--motion-base) ease;
}
.cover-links a:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.5);
}
.cover-links a.primary {
  background: linear-gradient(135deg, rgba(0,179,255,0.32), rgba(141,125,255,0.22));
  border-color: rgba(0,179,255,0.55);
  color: var(--text-primary);
}
.cover-links a svg { width: 14px; height: 14px; }

/* right-side aside in hero — small "live now" + scroll cue */
.cover-aside {
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  justify-self: end;
}
@media (max-width: 720px) { .cover-aside { display: none; } }
.cover-aside .live-mark {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 11.5px; color: rgba(245,245,247,0.86);
  text-transform: uppercase; letter-spacing: 0.16em; font-weight: 500;
}
.cover-aside .live-mark .live-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--de-green);
  box-shadow: 0 0 0 4px rgba(121,193,66,0.22);
  animation: pulse 2.4s ease-in-out infinite;
}
.cover-aside .scroll-cue {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(245,245,247,0.6);
  text-transform: uppercase; letter-spacing: 0.18em;
}
.cover-aside .scroll-cue svg { width: 14px; height: 14px; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ───────────── adesso (a la /now) ───────────── */
.now-block {
  padding: 56px 0 32px;
}
.now-block .now-card {
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-color) 84%, transparent), var(--surface-color));
  box-shadow: var(--shadow-card);
  position: relative;
}
.now-block .now-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 12px; color: var(--text-secondary);
}
.now-block .now-head .live-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--de-green);
  box-shadow: 0 0 0 4px rgba(121,193,66,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.now-block .now-head .now-when {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 10.5px; font-weight: 500;
}
.now-block h2 {
  font-family: var(--font-display-stack);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600; letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.now-block ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px;
}
.now-block li {
  position: relative;
  padding-left: 22px;
  font-size: 15px; line-height: 1.55; color: var(--text-secondary);
}
.now-block li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent-color);
}
.now-block li strong { color: var(--text-primary); font-weight: 600; }
.now-block li a { color: var(--accent-color); text-decoration: none; }
.now-block li a:hover { text-decoration: underline; }

/* ───────────── sections ───────────── */
section.pad { padding: 56px 0; position: relative; }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-display-stack);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600; letter-spacing: -0.02em;
  margin: 0;
}
.section-head .section-aside {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ───────────── tappe / timeline ───────────── */
.timeline { display: flex; flex-direction: column; }
.timeline .row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border-color);
}
.timeline .row:first-child { border-top: 0; padding-top: 6px; }
.timeline .when {
  font-family: var(--font-rounded-stack);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  padding-top: 3px;
}
.timeline .what h3 {
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 2px;
  color: var(--text-primary);
}
.timeline .what .role {
  font-size: 13px; color: var(--text-secondary); margin: 0 0 4px;
}
.timeline .what p {
  font-size: 13.5px; line-height: 1.55; color: var(--text-secondary);
  margin: 0;
}
.timeline .what .partners {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.timeline .what .partners span {
  font-size: 11px;
  padding: 3px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-color) 50%, transparent);
}
@media (max-width: 600px) {
  .timeline .row { grid-template-columns: 1fr; gap: 6px; }
}

/* education sub-row inside timeline */
.education-row { opacity: 0.86; }

/* ───────────── progetti — logo grid (4 brand) ───────────── */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 880px) { .logo-grid { grid-template-columns: repeat(2, 1fr); } }

.logo-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; text-decoration: none; color: inherit;
  padding: 36px 22px 28px;
  min-height: 200px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface-color) 84%, transparent),
    var(--surface-color));
  box-shadow: var(--shadow-card);
  transition: border-color var(--motion-base) ease, box-shadow var(--motion-base) ease, transform var(--motion-base) ease;
  position: relative;
  overflow: hidden;
}
.logo-card::before {
  /* chrome highlight, signature DenkHub card lip */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent-color) 18%, transparent) 50%,
    transparent 100%);
}
.logo-card:hover {
  border-color: color-mix(in srgb, var(--accent-color) 32%, var(--border-color));
  box-shadow: var(--shadow-soft);
}

.logo-card .logo-img {
  height: 64px; width: 100%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.logo-card .logo-img img,
.logo-card .logo-img svg {
  max-height: 100%;
  max-width: 80%;
  width: auto; height: auto;
  object-fit: contain;
  /* force every brand mark to render white, regardless of native fill */
  filter: brightness(0) invert(1);
  opacity: 0.92;
  transition: opacity var(--motion-base) ease;
}
.logo-card:hover .logo-img img,
.logo-card:hover .logo-img svg {
  opacity: 1;
}

.logo-card-name {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
  display: block; margin-bottom: 4px;
}
.logo-card-role {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: block;
}

/* ───────────── trovami qui (link grid, smaller than before) ───────────── */
.link-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 880px) { .link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .link-grid { grid-template-columns: 1fr; } }

.link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--surface-color) 70%, transparent);
  color: inherit; text-decoration: none;
  transition: border-color var(--motion-base) ease, background var(--motion-base) ease;
}
.link-card:hover {
  border-color: color-mix(in srgb, var(--accent-color) 32%, var(--border-color));
  background: color-mix(in srgb, var(--surface-color) 88%, transparent);
}
.link-card .li-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface-color) 90%, transparent);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.link-card .li-icon svg { width: 16px; height: 16px; }
.link-card .li-body { flex: 1; min-width: 0; }
.link-card .li-label {
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary); display: block;
}
.link-card .li-handle {
  font-size: 12px; color: var(--text-secondary);
  display: block; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-card .li-arrow { color: var(--text-secondary); transition: transform var(--motion-base) ease, color var(--motion-base) ease; }
.link-card:hover .li-arrow { color: var(--accent-color); transform: translateX(2px); }

.link-card.primary {
  background:
    linear-gradient(135deg, rgba(0,179,255,0.16), rgba(141,125,255,0.08)),
    color-mix(in srgb, var(--surface-color) 84%, transparent);
  border-color: color-mix(in srgb, var(--accent-color) 26%, var(--border-color));
}
.link-card.primary .li-icon { background: rgba(0,179,255,0.18); border-color: color-mix(in srgb, var(--accent-color) 30%, transparent); color: var(--accent-color); }

/* ───────────── footer ───────────── */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0 56px;
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 12.5px;
}
footer.site-footer .ft-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px;
  align-items: start;
}
@media (max-width: 720px) {
  footer.site-footer .ft-grid { grid-template-columns: 1fr; gap: 22px; }
}
footer.site-footer h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 500; color: var(--text-secondary);
  margin: 0 0 10px;
}
footer.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
footer.site-footer a { color: var(--text-secondary); text-decoration: none; }
footer.site-footer a:hover { color: var(--text-primary); }
footer.site-footer .ft-logo img {
  height: 18px; width: auto;
  filter: brightness(0) invert(1); opacity: 0.86;
  display: block; margin-bottom: 10px;
}
footer.site-footer .ft-tagline { line-height: 1.55; max-width: 36ch; margin: 0; }
footer.site-footer .legal {
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 11.5px;
}
footer.site-footer .made { display: inline-flex; align-items: center; gap: 6px; }
footer.site-footer .made .dot-green { width: 6px; height: 6px; border-radius: 999px; background: var(--de-green); }

/* ───────────── motion ───────────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(8px); transition: opacity 600ms ease, transform 600ms ease; }
  .reveal.in { opacity: 1; transform: none; }
}
