/* =========================================
   ALEXIS AMBRAY — PORTFOLIO REDESIGN
   Editorial / Modern / Soft Lilac
========================================= */

:root {
  color-scheme: light;

  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-soft: #f0eaf8;
  --surface-pink: #f6e5eb;

  --ink: #251c2b;
  --muted: #766d79;
  --accent: #7954a1;
  --accent-dark: #583778;
  --accent-soft: #e6d9f2;
  --line: #e8e0e8;

  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 32px;

  --shadow: 0 12px 36px rgba(45, 27, 54, 0.07);

  --content-width: 1160px;
}

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

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

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* =========================================
   NAVIGATION + HERO
========================================= */

.hero {
  position: relative;
  isolation: isolate;
  min-height: auto;
  min-height: min(820px, 92svh);
  display: flex;
  flex-direction: column;
  padding: 28px 7% 100px;
  overflow: hidden;

  background:
    radial-gradient(
      ellipse at 85% 20%,
      rgba(181, 147, 207, 0.26),
      transparent 40%
    ),
    radial-gradient(
      ellipse at 75% 90%,
      rgba(236, 194, 211, 0.18),
      transparent 38%
    ),
    #28212d;

  color: #fff;
}

.navbar {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #e3c9f7;
}

.logo:hover {
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: #e3c9f7;
}

.hero-content {
  width: 100%;
  max-width: var(--content-width);
  margin: auto auto 0;
  padding-top: 100px;
}

.hero-content h1 {
  max-width: 1050px;
  margin-bottom: 28px;
  font-size: clamp(3.4rem, 8vw, 7.4rem);
  line-height: 0.99;
  letter-spacing: -0.075em;
  font-weight: 750;
}

.hero-line {
  display: block;
}

#typing-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5em;
  min-width: 4.8em;
  padding: 0.02em 0.16em 0.08em;
  border-radius: 999px;

  background: #e3c9f7;
  color: #30213c;

  font-family: inherit;
  font-size: 0.72em;
  font-weight: inherit;
  line-height: 1.15;
  letter-spacing: -0.075em;
  text-align: center;
  vertical-align: 0.02em;
  white-space: nowrap;

  transition: opacity 300ms ease;
}

.hero-content p {
  max-width: 580px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.85;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 23px;
  border: 1px solid #e3c9f7;
  border-radius: 999px;
  background: #e3c9f7;
  color: #30213c;
  font-weight: 700;
}

.hero-button:hover {
  background: #fff;
  color: #30213c;
  transform: translateY(-2px);
}

/* =========================================
   SERVICES STRIP
========================================= */

.service-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 30px;
  padding: 19px 6%;

  background: #e3c9f7;
  color: #30213c;
  font-size: 0.83rem;
  font-weight: 700;
}

.service-strip p {
  margin: 0;
}

.service-strip span {
  color: var(--accent);
}

/* =========================================
   MAIN LAYOUT
========================================= */

main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 7% 100px;
}

section {
  margin-bottom: 120px;
  scroll-margin-top: 40px;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.2px;
}

h2 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.065em;
  font-weight: 750;
}

/* =========================================
   ABOUT
========================================= */

.about-section {
  max-width: 900px;
  padding: 0;
}

.about-section h2 {
  max-width: 850px;
}

.about-section p:last-child {
  max-width: 730px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

/* =========================================
   PROJECT SECTIONS
========================================= */

.projects-section,
.design-section {
  margin-bottom: 130px;
}

.project-case {
  margin-top: 32px;
  padding: clamp(24px, 4vw, 48px);

  background: var(--surface);
  border: 1px solid rgba(100, 73, 116, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

.project-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;
  border-radius: 50%;

  background: var(--ink);
  color: #e3c9f7;
  font-size: 0.83rem;
  font-weight: 800;
}

.project-header h3 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3.5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.project-header p {
  color: var(--muted);
  font-size: 0.98rem;
}

.project-description {
  max-width: 100%;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.project-case > p {
  max-width: 100%;
  margin-bottom: 20px;
  color: #514852;
  line-height: 1.85;
}

.project-meta {
  display: grid;
  gap: 9px;
  margin-top: 24px;
  padding-left: 20px;
  color: #514852;
  font-size: 0.94rem;
}

.project-meta strong {
  color: var(--ink);
}

.project-meta a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.project-meta a:hover {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

/* =========================================
   IMAGE GRIDS
========================================= */

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.image-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 8px 22px rgba(45, 27, 54, 0.06);
}

.project-showcase {
  margin: 32px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.project-showcase img {
  width: 100%;
  height: auto;
}

/* =========================================
   STUDIOTRACK — MOBILE APP CASE STUDY
========================================= */

.phone-mockup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 2vw, 24px);
  margin: 36px 0;
}

.phone-frame {
  min-width: 0;
  padding: 7px;
  overflow: hidden;
  box-sizing: border-box;

  border: 1px solid #29252d;
  border-radius: 30px;
  background: #29252d;
  box-shadow: 0 15px 35px rgba(45, 27, 54, 0.12);

  display: flex;
  align-items: flex-start;
}

.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 22px;
}

/* Responsive layout */
@media (max-width: 768px) {
  .phone-mockup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .phone-frame img {
    height: 360px;
  }
}

@media (max-width: 420px) {
  .phone-frame img {
    height: 300px;
  }
}

/* =========================================
   CONTACT
========================================= */

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);

  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;

  border: 1px solid rgba(100, 73, 116, 0.1);
  border-radius: var(--radius-lg);

  background:
    radial-gradient(
      ellipse at 0% 100%,
      rgba(245, 198, 214, 0.75),
      transparent 55%
    ),
    linear-gradient(135deg, #f1e8f8, #e4d4f4);
}

.contact-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-illustration img {
  width: 100%;
  max-width: 380px;
  height: auto;
  animation: float 4s ease-in-out infinite;
}

.contact-content {
  min-width: 0;
}

.contact-content h2 {
  margin-bottom: 24px;
  font-size: clamp(2.6rem, 5vw, 4.7rem);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  padding: 15px 17px;

  border: 1px solid rgba(83, 57, 99, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);

  font: inherit;
  font-size: 0.95rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #827786;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  padding: 13px 28px;

  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;

  font: inherit;
  font-weight: 700;
  cursor: pointer;

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.contact-form button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.contact-note {
  margin-top: 20px;
  color: #514852;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.contact-section a {
  font-weight: 700;
}

.contact-note a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================
   FOOTER
========================================= */

footer {
  padding: 30px 7%;
  background: #28212d;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  font-size: 0.88rem;
}

footer p {
  margin: 0;
}

/* =========================================
   ANIMATIONS
========================================= */

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* =========================================
   TABLETS
========================================= */

@media (max-width: 900px) {
  .hero {
    min-height: 680px;
    padding-right: 5%;
    padding-left: 5%;
  }

  main {
    padding-right: 5%;
    padding-left: 5%;
  }

  .phone-mockup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .contact-section {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 28px;
  }

  .contact-illustration img {
    max-width: 280px;
  }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {
  html {
    scroll-padding-top: 20px;
  }

  .hero {
    min-height: 0;
    padding: 22px 6% 36px;
  }

  .navbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 22px;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .hero-content {
    margin: 35px 0 0;
    padding-top: 0;
  }

  .hero-content h1 {
    font-size: clamp(2.9rem, 11vw, 4.5rem);
    letter-spacing: -0.07em;
    line-height: 1.1;
  }

  #typing-text {
    font-size: 0.88em;
    max-width: 100%;
    min-width: 0;
  }

  .hero-content p {
    font-size: 0.98rem;
  }

  .service-strip {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0 14px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 17px 6%;
    font-size: 0.72rem;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .service-strip::-webkit-scrollbar {
    display: none;
  }

  .service-strip p,
  .service-strip span {
    flex-shrink: 0;
  }

  main {
    padding: 32px 7% 100px;
  }

  section {
    margin-bottom: 82px;
  }

  .projects-section,
  .design-section {
    margin-bottom: 88px;
  }

  h2 {
    font-size: clamp(2.25rem, 9vw, 3.2rem);
  }

  .about-section p:last-child {
    font-size: 1rem;
  }

  .project-case {
    margin-top: 24px;
    padding: 22px 18px;
    border-radius: 24px;
  }

  .project-header {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 24px;
  }

  .project-number {
    width: 42px;
    height: 42px;
  }

  .project-header h3 {
    font-size: clamp(1.7rem, 7vw, 2.4rem);
    line-height: 1.12;
  }

  .image-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .image-grid img {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .project-showcase {
    margin: 24px 0;
  }

  .project-case > p {
    font-size: 0.94rem;
  }

  .project-meta {
    font-size: 0.88rem;
  }

  .phone-mockup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
  }

  .phone-frame {
    padding: 4px;
    border-radius: 22px;
  }

  .phone-frame img {
    border-radius: 17px;
  }

  .contact-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 28px 20px;
    border-radius: 24px;
  }

  .contact-illustration img {
    max-width: 220px;
  }

  .contact-content h2 {
    font-size: clamp(2.6rem, 10vw, 3.5rem);
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  footer {
    padding: 26px 5%;
  }
}

/* =========================================
   ACCESSIBILITY: REDUCED MOTION
========================================= */

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