/* ============================================================
   Emanuele Vinci — personal site
   Plain CSS, no build step. Mobile-first.
   ============================================================ */

:root {
  --accent: #ff6a1a;          /* warm orange */
  --accent-dark: #e2560c;
  --accent-soft: #fff1e8;     /* pale orange wash */
  --ink: #171310;             /* near-black warm */
  --ink-soft: #4b433d;
  --bg: #fffaf6;              /* warm off-white */
  --surface: #ffffff;
  --border: #ece2d9;
  --radius-pill: 999px;
  --radius-lg: 22px;
  --maxw: 1080px;
  --avatar: clamp(180px, 40vw, 224px);   /* About / Chi sono profile photo */
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 10px 16px;
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

/* language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.lang-switch a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.lang-switch a:hover { text-decoration: none; color: var(--ink); }
.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}

/* main navigation */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 15px;
}
.main-nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: var(--ink-soft);
}
.main-nav a:hover {
  text-decoration: none;
  color: var(--ink);
  background: var(--accent-soft);
}
.main-nav a[aria-current="page"] {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 17px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */
main section { padding-block: clamp(56px, 9vw, 104px); }
.section-alt { background: var(--accent-soft); }

.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 14px;
}

h1, h2, h3 {
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}

.section-lead {
  max-width: 62ch;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink-soft);
  margin: 0 0 28px;
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(64px, 12vw, 132px) !important;
}
.hero h1 {
  font-size: clamp(3rem, 11vw, 6.5rem);
  font-weight: 700;
}
.hero .pitch {
  font-size: clamp(1.5rem, 4.4vw, 2.6rem);
  font-weight: 700;
  color: var(--accent-dark);
  max-width: 20ch;
  margin: 0 0 16px;
  line-height: 1.1;
}
.hero .subline {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 32px;
}

/* ---------- App category marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  margin-block: 12px 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 14px;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px -10px rgba(0,0,0,.3);
}
.cat-pill svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--accent);
}

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

/* ---------- Course topics ---------- */
.topics {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 720px;
}
.topics li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
}
.topics li::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

/* ---------- About ---------- */
.about p {
  max-width: 60ch;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

/* ---------- Contact ---------- */
.contact .email-link {
  display: inline-block;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 4px;
}
.contact .email-link:hover { color: var(--accent-dark); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Hero photo ---------- */
.hero-photo-wrap { margin: 0 0 26px; }
.hero-photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  padding: 4px;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 12px 32px -14px color-mix(in srgb, var(--accent) 60%, transparent);
}
.hero-photo--fallback {
  place-items: center;
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: 0;
  color: #fff;
  background: var(--accent);
}

/* ---------- Profile photo (About / Chi sono) ---------- */
/* Left-aligned circle sitting inside the orange section, with clear space
   above (so its top never touches the white/orange boundary) and below. */
.bio-head { padding-block: clamp(44px, 7vw, 72px) clamp(40px, 6vw, 56px) !important; }
/* Equal gap above and below the photo at every width. */
.bio-body { padding-top: 26px !important; }

.about-photo {
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 50%;
  object-fit: cover;
  padding: 4px;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 12px 32px -14px color-mix(in srgb, var(--accent) 60%, transparent);
  margin: 0 0 26px;
}

/* ---------- Home intro + teasers ---------- */
.home-intro {
  max-width: 58ch;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink-soft);
  margin: 4px 0 32px;
}
.teasers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 0;
}
.teaser {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: 0 6px 20px -14px rgba(0,0,0,.4);
}
.teaser h3 { font-size: 1.35rem; margin: 0 0 10px; }
.teaser p { color: var(--ink-soft); margin: 0 0 18px; flex: 1 1 auto; }

.arrow-link { font-weight: 700; color: var(--accent-dark); }
.arrow-link:hover { color: var(--ink); }

/* ---------- Subpage heading + generic prose ---------- */
.page-intro {
  max-width: 66ch;
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.prose p {
  max-width: 66ch;
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.prose a { word-break: break-word; }
.format-line {
  max-width: 66ch;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 26px;
}
.note {
  max-width: 66ch;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 22px 0 0;
}

/* ---------- Technologies grid ---------- */
.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 6px 20px -14px rgba(0,0,0,.4);
}
.tech-card h3 { font-size: 1.2rem; margin: 0 0 8px; }
.tech-card p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Course syllabus ---------- */
.syllabus {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 26px;
  display: grid;
  gap: 14px;
}
.syllabus li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.syllabus li::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.syllabus h3 { font-size: 1.08rem; margin: 0 0 4px; line-height: 1.2; }
.syllabus p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Contact form ---------- */
.contact-form {
  max-width: 560px;
  display: grid;
  gap: 14px;
  margin: 6px 0 20px;
}
.contact-form .field { display: grid; gap: 6px; }
.contact-form label { font-weight: 600; font-size: 15px; }
.contact-form select,
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button.btn { justify-content: center; }
.contact-form select:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.contact-fallback {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0;
}
.contact-fallback a { font-weight: 600; }

/* ---------- Footer contact ---------- */
.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 8px 0 0;
}
.footer-contact a { font-weight: 600; }

/* ---------- Responsive tweaks ---------- */
@media (min-width: 620px) {
  .topics { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .teasers { grid-template-columns: repeat(3, 1fr); }
  .tech-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .main-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .marquee { overflow-x: auto; }
  .marquee__track { animation: none; }
  .btn:hover { transform: none; }
}
