/* ================================
   Samuel Cardoso — Portfolio
   ================================ */

:root {
  --bg: #070a10;
  --bg-soft: #0c1018;
  --card: rgba(16, 21, 31, 0.72);
  --card-solid: #10151f;
  --text: #f5f7fb;
  --muted: #98a2b3;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #6ee7ff;
  --accent-2: #8b5cf6;
  --accent-3: #22d3a6;
  --max: 1180px;
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background:
    radial-gradient(circle at 20% 10%, rgba(110, 231, 255, .07), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(139, 92, 246, .08), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

/* Header */
.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), var(--max));
  height: 70px;
  padding: 0 18px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 10, 16, .72);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(18px);
  z-index: 100;
  transition: .3s ease;
}

.site-header.scrolled {
  top: 10px;
  background: rgba(7, 10, 16, .92);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 1rem "Space Grotesk", sans-serif;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  font-weight: 800;
  box-shadow: 0 8px 30px rgba(110, 231, 255, .16);
}

.brand-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  color: #bdc5d2;
  font-size: .9rem;
  font-weight: 500;
  transition: .2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav .nav-cta {
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
}

.menu-toggle {
  display: none;
}

/* Global */
.section {
  position: relative;
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 115px 0;
}

.section-heading {
  margin-bottom: 52px;
  max-width: 760px;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.section-heading h2,
.contact-card h2 {
  font: 600 clamp(2.25rem, 5vw, 4.3rem)/1.04 "Space Grotesk", sans-serif;
  letter-spacing: -.055em;
}

.section-heading h2 span {
  color: #7c8799;
}

.btn {
  min-height: 52px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  font-weight: 650;
  font-size: .92rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a8f2ff);
  color: #041014;
  box-shadow: 0 12px 35px rgba(110, 231, 255, .13);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .035);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: #bbc4d1;
  border-radius: 9px;
  font-size: .78rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  padding-top: 150px;
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  align-items: center;
  gap: 60px;
}

.hero-glow {
  position: absolute;
  pointer-events: none;
  filter: blur(0px);
}

.glow-one {
  width: 430px;
  height: 430px;
  left: -180px;
  top: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 231, 255, .09), transparent 67%);
}

.glow-two {
  width: 560px;
  height: 560px;
  right: -260px;
  top: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .11), transparent 68%);
}

.eyebrow {
  width: fit-content;
  margin-bottom: 24px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(34, 211, 166, .2);
  border-radius: 999px;
  background: rgba(34, 211, 166, .055);
  color: #b9e9dc;
  font-size: .78rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 5px rgba(34, 211, 166, .08);
}

.hero h1 {
  max-width: 820px;
  font: 650 clamp(3rem, 6.7vw, 6.5rem)/.95 "Space Grotesk", sans-serif;
  letter-spacing: -.065em;
}

.gradient-text {
  background: linear-gradient(110deg, var(--accent), #bfc6ff 52%, #9c7cff);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-description {
  max-width: 690px;
  margin-top: 30px;
  color: #a7b0bf;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
}

.hero-description strong {
  color: #e8ecf3;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.hero-metrics {
  margin-top: 52px;
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border);
}

.hero-metrics div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-metrics strong {
  font: 600 .95rem "Space Grotesk", sans-serif;
}

.hero-metrics span {
  color: #788293;
  font-size: .77rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.code-card {
  width: 100%;
  max-width: 480px;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent),
    rgba(11, 15, 23, .88);
  box-shadow: 0 35px 80px rgba(0, 0, 0, .28);
  transform: perspective(900px) rotateY(-3deg) rotateX(2deg);
}

.code-top {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
}

.window-dots span:nth-child(1) { background: #ff6b6b; }
.window-dots span:nth-child(2) { background: #ffd166; }
.window-dots span:nth-child(3) { background: #41d3a2; }

.code-file {
  margin: auto;
  transform: translateX(-22px);
  color: #7f8998;
  font-size: .76rem;
}

.code-card pre {
  padding: 36px 28px 28px;
  overflow: auto;
  color: #c9d1dc;
  font: 500 .9rem/1.9 Consolas, Monaco, monospace;
}

.code-keyword { color: #c084fc; }
.code-var { color: #80e6ff; }
.code-string { color: #94e2c1; }
.code-true { color: #fbbf75; }

.terminal-line {
  margin: 16px 22px 0;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,.22);
  font: .75rem Consolas, monospace;
}

.terminal-arrow {
  color: var(--accent-3);
}

.terminal-command {
  color: #9ca6b6;
}

.terminal-cursor {
  width: 6px;
  height: 15px;
  background: var(--accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.floating-chip {
  position: absolute;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(15, 20, 29, .9);
  color: #cbd3df;
  backdrop-filter: blur(12px);
  font-size: .76rem;
  font-weight: 700;
  box-shadow: 0 15px 35px rgba(0,0,0,.25);
}

.chip-a { top: 10%; right: -2%; animation: float 5s ease-in-out infinite; }
.chip-b { bottom: 14%; left: -4%; animation: float 5.7s ease-in-out infinite .5s; }
.chip-c { bottom: 2%; right: 8%; animation: float 6.1s ease-in-out infinite 1s; }

@keyframes float {
  50% { transform: translateY(-9px); }
}

.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5f6978;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.scroll-indicator i {
  width: 56px;
  height: 1px;
  background: #3b4450;
}

/* About */
.about {
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.about-copy {
  color: #919baa;
  font-size: 1rem;
}

.about-copy p + p {
  margin-top: 20px;
}

.about-copy .lead {
  color: #dfe5ed;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.48;
  letter-spacing: -.02em;
}

.about-copy strong {
  color: #eef2f7;
}

.about-cards {
  display: grid;
  gap: 12px;
}

.mini-card {
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  transition: transform .25s ease, border-color .25s ease;
}

.mini-card:hover {
  transform: translateX(5px);
  border-color: rgba(110,231,255,.22);
}

.mini-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(110, 231, 255, .07);
  color: var(--accent);
  font-size: 1.1rem;
}

.mini-card small {
  color: #6f7988;
  text-transform: uppercase;
  font-size: .66rem;
  letter-spacing: .08em;
}

.mini-card h3 {
  margin: 2px 0 4px;
  font: 600 1.05rem "Space Grotesk";
}

.mini-card p {
  color: #8f99a9;
  font-size: .84rem;
}

/* Skills */
.skills-section {
  border-top: 1px solid var(--border);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skill-group {
  min-height: 245px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  transition: .25s ease;
}

.skill-group:hover {
  border-color: rgba(110,231,255,.2);
  transform: translateY(-3px);
}

.skill-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 32px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: rgba(110,231,255,.07);
  font: 700 .9rem "Space Grotesk";
}

.skill-group h3 {
  margin-bottom: 15px;
  font: 600 1.25rem "Space Grotesk";
}

/* Projects */
.projects-section {
  border-top: 1px solid var(--border);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  min-height: 390px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 0%, rgba(139,92,246,.05), transparent 35%),
    rgba(255,255,255,.02);
  overflow: hidden;
  position: relative;
  transition: .3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,.16);
}

.project-featured {
  grid-column: span 2;
  min-height: 480px;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6f7987;
  font: 600 .72rem "Space Grotesk";
}

.project-number {
  color: #7b8492;
}

.project-status {
  padding: 6px 9px;
  border: 1px solid rgba(34,211,166,.16);
  border-radius: 999px;
  color: #8fdcc7;
  background: rgba(34,211,166,.05);
}

.project-arrow {
  font-size: 1.1rem;
}

.project-content {
  max-width: 620px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.project-type {
  color: var(--accent);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
}

.project-card h3 {
  margin: 8px 0 12px;
  font: 600 clamp(1.6rem, 3vw, 2.25rem) "Space Grotesk";
  letter-spacing: -.035em;
}

.project-card p:not(.project-type) {
  max-width: 570px;
  color: #929cab;
  font-size: .92rem;
}

.project-card .tags {
  margin-top: 20px;
}

.project-featured .project-content {
  width: 58%;
}

.project-art {
  position: absolute;
  right: -70px;
  top: 95px;
  width: 49%;
  height: 300px;
  transform: rotate(-4deg);
  opacity: .95;
}

.system-art {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: #0b1018;
  box-shadow: 0 25px 70px rgba(0,0,0,.3);
  display: grid;
  grid-template-columns: 60px 1fr;
  overflow: hidden;
}

.mock-sidebar {
  background: #111824;
  border-right: 1px solid var(--border);
}

.mock-content {
  padding: 35px 24px;
}

.mock-content > span {
  display: block;
  width: 68%;
  height: 9px;
  margin-bottom: 10px;
  background: #1c2635;
  border-radius: 99px;
}

.mock-content > span:nth-child(2) { width: 44%; }
.mock-content > span:nth-child(3) { width: 28%; margin-bottom: 32px; }

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mock-grid i {
  display: block;
  height: 70px;
  border-radius: 10px;
  border: 1px solid rgba(110,231,255,.08);
  background: linear-gradient(135deg, rgba(110,231,255,.08), rgba(139,92,246,.04));
}

/* Timeline */
.experience-section {
  border-top: 1px solid var(--border);
}

.timeline {
  max-width: 930px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 50px;
  padding: 0 0 52px 34px;
  border-left: 1px solid var(--border);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(110,231,255,.07);
}

.timeline-date {
  color: #747e8d;
  font-size: .78rem;
  font-weight: 600;
}

.timeline-type {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.timeline-content h3 {
  margin: 6px 0 10px;
  font: 600 1.35rem "Space Grotesk";
}

.timeline-content p:last-child {
  max-width: 650px;
  color: #929cab;
  font-size: .9rem;
}

/* Contact */
.contact-section {
  padding-bottom: 80px;
}

.contact-card {
  padding: clamp(32px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: end;
  border: 1px solid rgba(110,231,255,.12);
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 90%, rgba(110,231,255,.08), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(139,92,246,.08), transparent 35%),
    rgba(255,255,255,.02);
}

.contact-card h2 {
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
}

.contact-card p {
  max-width: 640px;
  margin-top: 18px;
  color: #96a0af;
}

.contact-actions {
  min-width: 190px;
}

.contact-actions .btn {
  width: 100%;
}

.social-links {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.social-links a {
  color: #929cab;
  font-size: .78rem;
}

.social-links a:hover {
  color: var(--text);
}

/* Footer */
.footer {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 32px 0 45px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 30px;
  align-items: center;
  border-top: 1px solid var(--border);
  color: #6d7684;
  font-size: .72rem;
}

.footer .brand {
  color: var(--text);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s ease, transform .75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .nav {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    padding: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(7,10,16,.97);
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 10px;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 6px;
    border: 0;
    border-radius: 11px;
    background: rgba(255,255,255,.04);
    cursor: pointer;
  }

  .menu-toggle span {
    width: 18px;
    height: 1px;
    background: #dce2eb;
    transition: .2s ease;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 160px;
    gap: 70px;
  }

  .hero-visual {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
  }

  .code-card {
    max-width: 560px;
  }

  .scroll-indicator {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .project-featured .project-content {
    width: 100%;
  }

  .project-art {
    opacity: .24;
    right: -120px;
  }

  .contact-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .contact-actions {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .section {
    width: min(calc(100% - 28px), var(--max));
    padding: 88px 0;
  }

  .site-header {
    width: calc(100% - 20px);
    top: 10px;
  }

  .hero {
    padding-top: 135px;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(3rem, 14vw, 4.8rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-visual {
    margin-top: 10px;
  }

  .code-card {
    transform: none;
  }

  .floating-chip {
    display: none;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-featured {
    grid-column: auto;
  }

  .project-card,
  .project-featured {
    min-height: 420px;
  }

  .project-art {
    width: 80%;
    right: -180px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: 26px;
  }

  .contact-card {
    padding: 30px 22px;
    border-radius: 23px;
  }

  .footer {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
