/* =========================================================
   Vincenzo Accardi — personal site v2
   Theme: Mediterranean Light
   Palette: white + lemon + azure + sage + coral accent
   Signature: coloured left-border cards for portfolio items
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --white:       #FFFFFF;
  --bg:          #F7F8FC;
  --bg-card:     #FFFFFF;
  --border:      #E4E8F0;

  --text:        #1A1F2E;
  --text-2:      #4A5168;
  --text-3:      #8892A4;

  --azure:       #3B82F6;
  --azure-light: #EFF6FF;
  --lemon:       #F59E0B;
  --lemon-light: #FFFBEB;
  --sage:        #10B981;
  --sage-light:  #ECFDF5;
  --coral:       #F43F5E;
  --coral-light: #FFF1F2;
  --violet:      #8B5CF6;
  --violet-light:#F5F3FF;

  /* card accent colors (cycling) */
  --c0: var(--azure);
  --c1: var(--sage);
  --c2: var(--lemon);
  --c3: var(--coral);
  --c4: var(--violet);

  --f-display: 'DM Sans', sans-serif;
  --f-body:    'Inter', sans-serif;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 8px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.1);

  --container: 1040px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: var(--azure); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.topbar-brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}
.topbar-nav {
  display: flex;
  gap: 4px;
  list-style: none;
}
.topbar-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.topbar-nav a:hover {
  background: var(--azure-light);
  color: var(--azure);
  text-decoration: none;
}
@media (max-width: 600px) { .topbar-nav { display: none; } }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: 64px 0 56px;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-avatar {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--azure);
}
.hero-avatar-placeholder {
  flex: none;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azure) 0%, var(--violet) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 2rem;
  color: white;
  box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--azure);
}
.hero-text { flex: 1; min-width: 200px; }
.hero-name {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-role {
  font-size: 1.1rem;
  color: var(--text-2);
  margin-top: 6px;
}
.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  color: var(--text-3);
  margin-top: 10px;
}
.hero-location i { color: var(--coral); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* social */
.social-row { display: flex; gap: 8px; margin-top: 20px; }
.social-row a {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1rem;
  transition: all .2s;
  text-decoration: none;
}
.social-row a:hover {
  background: var(--azure-light);
  border-color: var(--azure);
  color: var(--azure);
  transform: translateY(-2px);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--azure);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}
.btn-primary:hover { background: #2563eb; box-shadow: 0 4px 16px rgba(59,130,246,.4); }

.btn-outline {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--azure); color: var(--azure); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-danger { background: var(--coral-light); border-color: var(--coral); color: var(--coral); }
.btn-danger:hover { background: var(--coral); color: white; }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 4px;
}
.section-title {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-text p {
  color: var(--text-2);
  margin-bottom: 1em;
}
.about-text p:last-child { margin-bottom: 0; }

/* =========================================================
   PORTFOLIO CARDS — signature left-border
   ========================================================= */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .portfolio-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 580px)  { .portfolio-grid { grid-template-columns: 1fr; } }

.p-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 20px 24px;
  border-left: 4px solid var(--azure);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* accent color cycle */
.p-card:nth-child(5n+1) { border-left-color: var(--azure);  }
.p-card:nth-child(5n+2) { border-left-color: var(--sage);   }
.p-card:nth-child(5n+3) { border-left-color: var(--lemon);  }
.p-card:nth-child(5n+4) { border-left-color: var(--coral);  }
.p-card:nth-child(5n+5) { border-left-color: var(--violet); }

.p-card-title {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.p-card-title a { color: inherit; text-decoration: none; }
.p-card-title a:hover { color: var(--azure); text-decoration: none; }

.p-card-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  flex: 1;
  line-height: 1.55;
}

.p-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--azure);
  text-decoration: none;
  margin-top: 4px;
}
.p-card-link:hover { text-decoration: underline; }
.p-card-link i { font-size: 0.75rem; }

.empty-note {
  color: var(--text-3);
  font-size: 0.9rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

/* =========================================================
   EXPERIENCE TIMELINE
   ========================================================= */
.timeline { display: flex; flex-direction: column; gap: 0; }

.t-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.t-item:first-child { padding-top: 0; }
.t-item:last-child  { border-bottom: none; }

.t-period {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
  padding-top: 3px;
  line-height: 1.4;
}

.t-role {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.t-company {
  font-size: 0.9rem;
  color: var(--azure);
  font-weight: 500;
  margin-bottom: 8px;
}
.t-company a { color: inherit; }
.t-company a:hover { text-decoration: underline; }
.t-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .t-item { grid-template-columns: 1fr; gap: 4px; }
}

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 700px) { .skills-grid { grid-template-columns: 1fr; } }

.s-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.s-group-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
}

/* =========================================================
   CONTACT STRIP
   ========================================================= */
.contact-card {
  background: linear-gradient(135deg, var(--azure) 0%, var(--violet) 100%);
  border-radius: var(--radius);
  padding: 36px;
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.contact-card h3 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.contact-card p { opacity: .85; font-size: 0.95rem; }
.contact-card .btn-white {
  background: white;
  color: var(--azure);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.contact-card .btn-white:hover { background: var(--azure-light); }

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin-top: 20px;
}
.contact-details .ci {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
}
.contact-details .ci i { color: var(--azure); width: 16px; text-align: center; }
.contact-details a { color: var(--text-2); }
.contact-details a:hover { color: var(--azure); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-3);
}
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--azure); }

/* =========================================================
   ADMIN
   ========================================================= */
.admin-body { background: var(--bg); min-height: 100vh; }

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 16px;
  justify-content: space-between;
}
.admin-topbar h1 {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.admin-topbar .badge {
  background: var(--azure-light);
  color: var(--azure);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 3px 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.admin-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 32px;
  overflow-x: auto;
}
.admin-tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--azure); text-decoration: none; }
.admin-tab.active { color: var(--azure); border-bottom-color: var(--azure); }

.panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.panel h2 {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=url],
.field input[type=password],
.field textarea {
  width: 100%;
  font-family: var(--f-body);
  font-size: 0.95rem;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 0.78rem; color: var(--text-3); margin-top: 5px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row-2 { grid-template-columns: 1fr; } }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* list items in admin */
.list-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row .meta { flex: 1; min-width: 0; }
.list-row .meta .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--azure);
  display: block;
  margin-bottom: 3px;
}
.list-row .meta h3 {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.list-row .meta p {
  font-size: 0.85rem;
  color: var(--text-2);
  word-break: break-word;
}
.list-row .ops {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}
.list-row form { margin: 0; }
.list-row .btn { width: 100%; justify-content: center; }

.flash {
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.flash-ok  { background: var(--sage-light);  color: #065f46; }
.flash-err { background: var(--coral-light); color: #9f1239; }

/* diag box */
.diag-box {
  background: var(--lemon-light);
  border: 1.5px solid var(--lemon);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.diag-box h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.diag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.diag-chips .chip { background: white; border-color: var(--lemon); }
.diag-box p { color: var(--text-2); margin-top: 8px; }
.diag-box code {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 0.85em;
}

/* login */
.login-shell { max-width: 380px; margin: 14vh auto 0; padding: 0 24px; }
.login-shell .panel { text-align: left; }
.login-shell h1 { font-family: var(--f-display); font-size: 1.4rem; margin-bottom: 4px; }
.login-shell .sub { font-size: 0.875rem; color: var(--text-3); margin-bottom: 24px; }

/* =========================================================
   Accessibility & reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
