/* Fabio Ottaviani Inspired Portfolio Styles */

/* Reset & Base */
*, *:after, *:before {
  box-sizing: border-box;
}

html {
  font-size: 10px;
  scroll-behavior: smooth;
}

body {
  background: #fff;
  color: #000;
  margin: 0;
  padding: 0;
  font-family: Matter, Helvetica, Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.3;
}

#root {
  padding: 4.4rem 5rem 6rem;
}

@media (max-width: 440px) {
  #root {
    padding: 4.4rem 2.5rem 6rem;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   SPLIT LETTER ANIMATION - Zendigital style
   Double-span reveal with ScrollTrigger
   ============================================ */

.animated-text-section {
  overflow: hidden;
  margin-bottom: 2rem;
}

.text-container {
  position: relative;
  width: 100%;
}

.word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.1em;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.word-item {
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 500;
  font-family: Matter, Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: inline-flex;
  color: #000;
  margin-right: 0.3em;
}

.letter {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.15em;
}

.letter span:first-child {
  display: block;
}

.letter span:last-child {
  position: absolute;
  bottom: 100%;
  left: 0;
}

/* Subtitle description styling */
.tech-stack-description {
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.4;
  margin-top: 1.5rem;
  opacity: 0.8;
}

/* Mobile breakpoints */
@media (max-width: 768px) {
  .word-item {
    font-size: clamp(2.5rem, 10vw, 6rem);
  }

  .word-list {
    gap: 0.05em;
  }
}

@media (max-width: 480px) {
  .word-item {
    font-size: clamp(2rem, 12vw, 5rem);
  }

  .tech-stack-description {
    font-size: 1.4rem;
  }
}

@media (max-width: 320px) {
  .word-item {
    font-size: clamp(1.5rem, 10vw, 3rem);
  }
}

/* Remove visited state for links */
a:visited {
  color: inherit;
}

/* Hero Signature */
#hero-signature {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* SVG Stroke Styles */
.cls-1, .cls-2 {
  fill: none;
  stroke: #000;
  stroke-miterlimit: 10;
}

.cls-1 {
  stroke-width: 21px;
}

.cls-2 {
  stroke-width: 25px;
}

.cls-3 {
  fill: #000;
}

.cls-thin {
  fill: none;
  stroke: #000;
  stroke-width: 8px;
  stroke-miterlimit: 10;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* Intro Section */
.intro, section {
  opacity: 0;
}

.intro {
  margin-top: 6rem;
  margin-bottom: 6rem;
  font-size: 2rem;
  line-height: 1.3;
}

.intro strong {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 300;
}

/* Sections */
section {
  margin-bottom: 6rem;
}

/* Headings */
h2 {
  font-size: 10rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Animated heading letters inherit size from parent, adjust scale */
.animated-text-section .word-list {
  font-size: 10rem;
  font-weight: 500;
}

h2 + p {
  margin-bottom: 4rem;
}

@media (max-width: 440px) {
  h2 {
    font-size: 4rem;
  }
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
}

/* CV Work (Experience) */
.cv-work {
  display: block;
  padding: 2rem 0;
  font-size: 1.6rem;
  border-bottom: 1px solid #000;
}

.cv-work:last-child {
  border-bottom: none;
}

.cv-work .years {
  font-size: 1.4rem;
  margin-bottom: 3px;
}

.cv-work h3 {
  font-size: 1.8rem;
}

.cv-work a {
  border-bottom: 1px dashed #000;
}

.cv-work p {
  margin-top: 0.5rem;
  line-height: 1.4;
  font-weight: 300;
}

/* Works Grid */
.works .work {
  font-size: 3rem;
  font-weight: 500;
}

@media (max-width: 440px) {
  .works .work {
    font-size: 2rem;
  }
}

.works .work a {
  background: #fff;
  padding: 1rem 0;
  display: block;
  position: relative;
  z-index: 1;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  margin-top: -1px;
  display: flex;
  align-items: center;
}

.works .work img {
  width: auto;
  height: 80px;
  margin-right: 10px;
}

.works .work em {
  font-weight: 300;
  font-size: 2rem;
  font-style: normal;
}

.works .work span,
.link {
  display: inline-block;
  pointer-events: none;
}

/* Overlay Animation */
.overlay {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  mix-blend-mode: difference;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s ease;
  pointer-events: none;
}

a:hover .overlay {
  transform: scaleY(1);
  transform-origin: top;
}

/* Contact List */
ul {
  margin: 0;
  padding: 0;
}

ul li {
  list-style-type: none;
  font-size: 1.6rem;
}

ul li,
ul li a {
  padding: 1rem 0;
  border-bottom: 1px solid #000;
}

ul li a {
  background: #fff;
  display: block;
  position: relative;
  z-index: 1;
  border-top: 1px solid #000;
  margin-top: -1px;
}

.no-border li {
  border-bottom: none;
  padding: 0;
}

.no-border li a {
  border: none;
  padding: 1rem 0;
}

/* Goodbye */
.goodbye {
  font-size: 2rem;
  font-weight: 300;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 3s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

br {
  user-select: none;
}

/* Link hover effect */
.link {
  transition: transform 0.3s ease;
}

a:hover .link {
  transform: translateX(10px);
}

@media (max-width: 440px) {
  .link {
    transform: translateX(4px) !important;
  }
}

/* Project page specific styles */
.project-link {
  display: inline-block;
  padding: 1rem 1.5rem;
  border: 1px solid #000;
  position: relative;
  z-index: 1;
  background: #fff;
  text-decoration: none;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.project-link .link {
  font-size: 1.4rem;
  font-weight: 400;
}

.project-link:hover .link {
  transform: translateX(5px);
}

/* ========================================
   MAMBOLEOO-STYLE ARTICLE LAYOUT
   ======================================== */

/* Article Container */
.c-article {
  max-width: 900px;
  margin: 0 auto;
}

/* Article Header */
.c-article__header {
  display: grid;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .c-article__header {
    grid-template-columns: 1fr 1.5fr;
    align-items: start;
  }
}

.c-article__thumbnail {
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid #000;
  max-width: 300px;
  margin: 0 auto;
}

.c-article__thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: contain;
}

.c-article__header-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.c-article__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  margin: 0;
  line-height: 1.1;
  color: #000;
  font-family: Matter, Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
}

.c-article__teaser {
  font-size: 1.6rem;
  color: #000;
  line-height: 1.3;
  font-weight: 300;
}

.c-article__teaser p {
  margin: 0;
}

/* Tags */
.c-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.c-tags__item {
  display: inline-block;
}

.o-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-size: 1.2rem;
  font-weight: 400;
  border: 1px solid #000;
  font-family: Matter, Helvetica, Arial, sans-serif;
}

.o-tag--invert {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Article Container */
.c-article__container {
  display: grid;
  gap: 3rem;
}

@media (min-width: 768px) {
  .c-article__container {
    grid-template-columns: 180px 1fr;
  }
}

/* Article Sidebar */
.c-article__side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.c-article__date {
  font-size: 1.4rem;
  color: #000;
  font-family: Matter, Helvetica, Arial, sans-serif;
  line-height: 1.3;
  font-weight: 300;
}

.c-article__date time {
  color: #000;
}

.c-article__extra-info {
  font-size: 1.4rem;
  color: #000;
  line-height: 1.4;
  border-top: 1px solid #000;
  padding-top: 1rem;
  font-weight: 300;
}

.c-article__extra-info a {
  color: #000;
  text-decoration: underline;
}

.c-article__extra-info a:hover {
  color: #555;
}

/* Article Content */
.c-article__content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.g-flexible-content__block {
  display: block;
}

.g-flexible-content__block--heading h2,
.g-flexible-content__block--heading h3 {
  font-weight: 500;
  margin-bottom: 1rem;
  font-family: Matter, Helvetica, Arial, sans-serif;
}

.g-flexible-content__block--heading h2 {
  font-size: 2.5rem;
  margin-top: 3rem;
  letter-spacing: -0.02em;
}

.g-flexible-content__block--heading h3 {
  font-size: 1.8rem;
  margin-top: 2rem;
}

.g-flexible-content__block--redactor {
  font-size: 1.6rem;
  line-height: 1.4;
  color: #000;
  font-weight: 300;
}

.g-flexible-content__block--redactor h2 {
  font-size: 2.5rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-family: Matter, Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
}

.g-flexible-content__block--redactor p {
  margin: 0 0 1rem;
}

.g-flexible-content__block--redactor p:last-child {
  margin-bottom: 0;
}

.g-flexible-content__block--redactor strong {
  font-weight: 500;
  color: #000;
}

.g-flexible-content__block--redactor em {
  font-style: italic;
}

.g-flexible-content__block--redactor a {
  color: #000;
  text-decoration: underline;
}

.g-flexible-content__block--redactor ul,
.g-flexible-content__block--redactor ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.g-flexible-content__block--redactor li {
  margin-bottom: 0.5rem;
}

.g-flexible-content__block--redactor code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.g-flexible-content__block--redactor pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.g-flexible-content__block--redactor pre code {
  background: none;
  padding: 0;
}

/* Integration blocks (code embeds, etc.) */
.g-flexible-content__block--integration {
  margin: 2rem 0;
}

.g-flexible-content__block--integration iframe {
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  color: #000;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: opacity 0.2s ease;
  font-family: Matter, Helvetica, Arial, sans-serif;
  font-weight: 300;
}

.back-link:hover {
  opacity: 0.6;
}

/* Image in content */
.o-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 767px) {
  .c-article__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .c-article__side {
    order: -1;
    border-bottom: 1px solid #000;
    padding-bottom: 1.5rem;
  }

  .c-article__title {
    font-size: 2rem;
  }

  .g-flexible-content__block--heading h2 {
    font-size: 2rem;
  }

  .g-flexible-content__block--heading h3 {
    font-size: 1.5rem;
  }

  .g-flexible-content__block--redactor {
    font-size: 1.4rem;
  }

  .c-article__date,
  .c-article__extra-info {
    font-size: 1.2rem;
  }

  .back-link {
    font-size: 1.4rem;
  }

  .o-tag {
    font-size: 1rem;
  }
}
