/* ============================================================
   marcocerrato.com — plain static site, no build step.
   Organized by section: Base / Shared / Header / Hero /
   Initiatives / Journey / Connect (incl. contact form) /
   Motion preferences.
   Colors and fonts live in the custom properties below.
   Breakpoints: md = 768px, lg = 1024px.
   ============================================================ */

:root {
  --ink: #111111;
  --ink-hover: #242424;
  --body-text: #374151;
  --muted: #6b7280;
  --faint: #898989;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --surface: #f5f5f5;
  --surface-hover: #fafafa;
  --pill-bg: #f8f9fa;
  --blue: #3b82f6;
  --success: #10b981;
  --error: #ef4444;
  --dark-bg: #101010;
  --dark-card: #1a1a1a;
  --dark-card-hover: #202020;
  --dark-line: #171717;
  --dark-line-soft: #262626;
  --dark-text: #a1a1aa;
  --dark-faint: #737373;
  --dark-faintest: #525252;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-pill: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: #ffffff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Scrollbar styling for a clean premium feel */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #ffffff;
}
::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}

/* ---------- Shared ---------- */

.section {
  max-width: 72rem;
  margin-inline: auto;
  padding: 6rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 1.5rem;
  user-select: none;
}

.display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.25;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.375rem;
  transition: background-color 150ms var(--ease);
}
.btn:hover {
  background: var(--ink-hover);
}
.btn--sm {
  height: 2.25rem;
  padding-inline: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
}
.btn--md {
  height: 2.5rem;
  padding-inline: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.btn--lg {
  height: 2.75rem;
  padding-inline: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.btn--light {
  background: #ffffff;
  color: var(--ink);
}
.btn--light:hover {
  background: var(--surface);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 4rem;
  padding-inline: 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.brand-name {
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.75rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  transition: opacity 150ms var(--ease);
}
.brand:hover .brand-name {
  opacity: 0.8;
}
.brand-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--ink);
}

.nav-pill {
  display: flex;
  align-items: center;
  position: relative;
  max-width: max-content;
  padding: 0.25rem;
  border-radius: 9999px;
  background: var(--pill-bg);
  box-shadow: var(--shadow-pill);
}

.nav-link {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 200ms var(--ease), background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.nav-link:hover {
  color: var(--ink);
}
.nav-link.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.header-cta {
  display: none;
}

@media (min-width: 768px) {
  .site-header {
    padding-inline: 3rem;
  }
  .nav-pill {
    padding: 0.375rem;
  }
  .nav-link {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  .btn--sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  .header-cta {
    display: block;
  }
}

/* ---------- Hero (About) ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-media {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
}
.hero-media picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 1rem;
  transition: transform 500ms var(--ease-out);
}
.hero-img:hover {
  transform: scale(1.01);
}
.hero-content {
  order: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-title {
  margin: 0 0 2rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.hero-copy {
  color: var(--body-text);
  font-size: 1rem;
  line-height: 1.625;
}
.hero-copy p {
  margin: 0;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4rem;
  }
  .hero-media {
    grid-column: span 5 / span 5;
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-inline: auto;
  }
  .hero-content {
    grid-column: span 7 / span 7;
    order: 2;
  }
  .hero-img {
    aspect-ratio: 1 / 1;
  }
  .hero-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  .hero-copy {
    font-size: 17px;
  }
}

@media (min-width: 1024px) {
  .hero-img {
    aspect-ratio: 1 / 1;
  }
  .hero-title {
    font-size: 3rem;
    line-height: 1;
  }
}

/* ---------- Section headers ---------- */

.section-head {
  max-width: 48rem;
  margin-bottom: 4rem;
}
.section-title {
  margin: 0 0 1.5rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.625;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  .section-sub {
    font-size: 17px;
  }
}

/* ---------- Initiatives (bento cards) ---------- */

.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 2rem;
  transition: transform 300ms var(--ease-out), border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.card:hover {
  transform: translateY(-0.25rem);
  border-color: var(--line);
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--faint);
}
.card-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  opacity: 0.8;
  transition: transform 200ms var(--ease);
}
.card:hover .card-dot {
  transform: scale(1.1);
}
.card-dot--orange { background: #fb923c; }
.card-dot--green  { background: #34d399; }
.card-dot--blue   { background: #3b82f6; }
.card-dot--pink   { background: #ec4899; }

.card-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  letter-spacing: -0.03em;
}
.card-text {
  margin: 0 0 2rem;
  color: var(--body-text);
  font-size: 15px;
  line-height: 1.625;
}
.card .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-title {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  .card .btn {
    width: auto;
    max-width: max-content;
  }
}

/* ---------- Journey (timeline) ---------- */

.timeline {
  position: relative;
  padding: 2.5rem 0;
}
.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2rem;
  width: 2px;
  background: var(--line);
  transform: translateX(-50%);
}
.timeline-progress {
  width: 100%;
  height: 0;
  background: var(--ink);
  transition: height 700ms var(--ease-out);
  transform-origin: top;
}

.timeline-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
}
/* Items are hidden only when JS is available (html.js), so the timeline
   still renders fully if JavaScript is disabled. */
.js .timeline-item {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.js .timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-content {
  width: 100%;
  padding-inline: 3.5rem;
}
.timeline-spacer {
  display: none;
}
.timeline-dot {
  position: absolute;
  left: 2rem;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 2px solid var(--line);
  transform: translateX(-50%);
  transition: border-color 300ms var(--ease);
}
.timeline-dot-inner {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--line);
}
.timeline-dot.active {
  border-color: var(--ink);
}
.timeline-dot-inner.active {
  background: var(--ink);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--faint);
}
.timeline-role {
  margin: 0.25rem 0;
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.timeline-org {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--blue);
}
.timeline-org:hover {
  text-decoration: underline;
}
.timeline-desc {
  margin: 0.75rem 0 0;
  color: var(--body-text);
  font-size: 14px;
  line-height: 1.625;
}

.journey-cta {
  display: flex;
  justify-content: center;
  margin-top: 5rem;
}

@media (min-width: 768px) {
  .timeline-line {
    left: 50%;
  }
  .timeline-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .timeline-content {
    width: 45%;
    padding-inline: 0;
    order: 1;
    text-align: right;
  }
  .timeline-spacer {
    display: block;
    width: 45%;
    order: 2;
  }
  .timeline-item--alt .timeline-content {
    order: 2;
    text-align: left;
  }
  .timeline-item--alt .timeline-spacer {
    order: 1;
  }
  .timeline-dot {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .timeline-role {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
  .timeline-desc {
    max-width: 28rem;
  }
  .timeline-item .timeline-desc {
    margin-left: auto;
  }
  .timeline-item--alt .timeline-desc {
    margin-left: 0;
  }
}

/* ---------- Connect (dark section) ---------- */

.connect {
  background: var(--dark-bg);
  border-top: 1px solid var(--dark-line);
  padding: 6rem 1.5rem;
}
.connect :focus-visible {
  outline-color: #ffffff;
}

.connect-inner {
  max-width: 72rem;
  margin-inline: auto;
}
.connect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.pill--dark {
  background: var(--dark-card);
  color: #ffffff;
  border: 1px solid var(--dark-line-soft);
}

.connect-title {
  margin: 0 0 1.5rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
  color: #ffffff;
}
.connect-text {
  margin: 0 0 2rem;
  color: var(--dark-text);
  font-size: 1rem;
  line-height: 1.625;
}

.connect-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--dark-line);
  text-align: center;
}
.connect-footer p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--dark-faintest);
}

.connect-portals {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.portal {
  display: block;
  background: var(--dark-card);
  border: 1px solid #0a0a0a;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.portal:hover {
  transform: translateY(-0.125rem);
  border-color: var(--dark-line-soft);
  background: var(--dark-card-hover);
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.portal-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--dark-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.portal-arrow {
  width: 1rem;
  height: 1rem;
  color: var(--dark-faint);
  transition: color 200ms var(--ease);
}
.portal:hover .portal-arrow {
  color: #ffffff;
}
.portal-title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: #ffffff;
  transition: color 200ms var(--ease);
}
.portal:hover .portal-title {
  color: var(--blue);
}
.portal-text {
  margin: 0.5rem 0 0;
  color: var(--dark-text);
  font-size: 0.875rem;
  line-height: 1.625;
}

@media (min-width: 768px) {
  .connect {
    padding-inline: 3rem;
  }
  .connect-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  .connect-text {
    font-size: 17px;
  }
}

@media (min-width: 1024px) {
  .connect-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4rem;
  }
  .connect-intro {
    grid-column: span 5 / span 5;
  }
  .connect-portals {
    grid-column: span 7 / span 7;
  }
  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Connect: contact form ---------- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--dark-card);
  border: 1px solid #0a0a0a;
  border-radius: 0.75rem;
}
.form-head {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--dark-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.form-field--wide {
  grid-column: 1 / -1;
}
.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--dark-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-optional {
  color: var(--dark-faintest);
  text-transform: none;
  letter-spacing: 0;
}
.form-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #ffffff;
  background: var(--dark-bg);
  border: 1px solid var(--dark-line-soft);
  border-radius: 0.375rem;
  transition: border-color 200ms var(--ease);
}
.form-input::placeholder {
  color: var(--dark-faintest);
}
.form-input:focus {
  outline: none;
  border-color: #ffffff;
}
.form-textarea {
  min-height: 6.5rem;
  line-height: 1.625;
  resize: vertical;
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.form-status {
  flex: 1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: var(--dark-faint);
}
.form-status--success {
  color: var(--success);
}
.form-status--error {
  color: var(--error);
}
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
