:root {
  --max-width: 840px;
  --spacing-section: 36px;
  --radius-card: 16px;
  --color-bg: #fafafa;
  --color-text-main: #404040;
  --color-text: #555;
  --color-link: #F21783;
  --color-link-bg: #f8cde2;
  --color-grey-light: #ebebeb;
  --color-muted: #444;
  --color-border: #d8d8d8;
  --color-card: #fff;
  --color-card-shadow: rgba(15,20,55,0.07);
  --color-card-shadow-hover: rgba(15,20,55,0.13);
}

html[data-theme="dark"] {
  --color-bg: #111;
  --color-text-main: #d4d4d4;
  --color-text: #9c9c9c;
  --color-link: #951254;
  --color-link-bg: #310e23;
  --color-grey-light: #232627;
  --color-muted: #999;
  --color-border: #232627;
  --color-card: #1e1e1e;
  --color-card-shadow: rgba(0,0,0,0.25);
  --color-card-shadow-hover: rgba(0,0,0,0.4);
}

/* ============================================
   BASE
   ============================================ */

html {
  min-height: 100%;
  width: 100%;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  box-sizing: border-box;
  margin: 0;
  font-family: 'Albert Sans', Arial, sans-serif;
  color: var(--color-text);
  font-size: 0.875rem;
  letter-spacing: .01em;
  scroll-behavior: smooth;
  line-height: 1.3rem;
  overflow: visible;
  padding-left: clamp(20px, 5vw, 32px);
  padding-right: clamp(20px, 5vw, 32px);
}

@media (min-width: 600px) {
  body {
    padding-left: clamp(32px, 8vw, 64px);
    padding-right: clamp(32px, 8vw, 64px);
  }
}

@media (min-width: 1200px) {
  body {
    padding-left: clamp(80px, 12vw, 200px);
    padding-right: clamp(80px, 12vw, 200px);
  }
}

@media (max-width: 500px) {
  body {
    font-size: 1rem;
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
}

h1 {
  display: inline;
  font-size: 2em;
  margin-block-start: 0.67em;
  margin-block-end: 0.67em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
  unicode-bidi: isolate;
}

img {
  border-radius: 12px;
}

button {
  display: block;
  padding: 0.7em 1.5em;
  font-size: 1em;
  font-family: inherit;
  color: #fff;
  background-color: #e60087;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: background 0.18s, box-shadow 0.18s;
  margin-left: auto;
  margin-right: auto;
}

button:hover,
button:focus {
  background-color: #c4006e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  outline: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.brand,
#desktop-brand {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-main);
  display: block;
  transition: font-size 0.2s;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--color-text);
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.3px;
  font-size: 0.95em;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link.active,
.nav-link:hover {
  color: var(--color-link);
  border-bottom-color: var(--color-link);
  background: none;
  padding-left: 0;
}

.nav-menu-toggle {
  display: none;
  background: none !important;
  background-color: transparent !important;
  border: none;
  border-radius: 0;
  padding: 6px 8px;
  margin: 0;
  cursor: pointer;
  color: var(--color-text-main);
  font-size: 2rem;
  box-shadow: none;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.nav-menu-toggle:hover,
.nav-menu-toggle:focus {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none;
  color: var(--color-link);
  outline: none;
}

@media (max-width: 768px) {
  .brand,
  #desktop-brand {
    line-height: 0.82;
  }

  .nav-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 20px var(--color-card-shadow);
    padding: 4px clamp(20px, 5vw, 32px) 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .top-nav-links.open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    padding: 16px 0;
    width: 100%;
  }
}

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

.main-content,
.gallery-content {
  max-width: var(--max-width);
  margin: 0 auto;
  box-sizing: border-box;
  padding-top: 20px;
  padding-bottom: 60px;
}

.section {
  margin-bottom: var(--spacing-section);
  overflow: visible;
}

.section > p:first-child {
  margin-top: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 1.03rem;
  color: var(--color-text-main);
  font-weight: 700;
  margin-bottom: 10px;
  justify-content: space-between;
}

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

.about-h {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0;
  line-height: 1.5;
}

p {
  margin: 0 0 8px;
}

.about-h + p {
  margin-top: 0;
}

/* ============================================
   EXPERIENCE
   ============================================ */

.experience-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.experience-item {
  margin-bottom: 20px;
  line-height: 1.4;
}

.exp-role {
  color: var(--color-text);
  font-weight: bold;
}

.exp-company {
  color: var(--color-link);
  font-weight: normal;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  transition: transform 0.2s cubic-bezier(.37,1.13,.62,.96);
}

.exp-company:hover,
.exp-company:focus {
  transform: translateY(-2px);
}

.exp-desc {
  color: var(--color-text);
  line-height: 1.2rem;
  display: block;
  text-decoration: none;
}

/* ============================================
   LINKS & ICONS
   ============================================ */

.icon-link {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--color-link);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.37,1.13,.62,.96);
}

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

.icon-link i {
  text-decoration: none !important;
  font-size: 1.05em;
}

.back-nav-link {
  color: var(--color-link);
  background: none;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  letter-spacing: 0.5px;
  padding: 6px 0 6px 3px;
  border: none;
  transition: transform 0.2s cubic-bezier(.37, 1.13, .62, .96);
  display: inline-block;
}

.back-nav-link:hover {
  transform: translateY(-2px);
}

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

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1.4rem;
  max-width: 480px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.form-row input,
.form-row textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text-main);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.6em 0.85em;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

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

.contact-form button {
  align-self: flex-start;
  margin: 0;
}

.form-success {
  color: var(--color-text-main);
  margin-top: 1rem;
}

/* ============================================
   GALLERY
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.6rem;
  padding: 2rem 0;
}

.home-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 1rem 0;
}

.home-grid .gallery-tile:nth-child(4) {
  display: none;
}

.gallery-tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-card, #fff);
  transition: box-shadow 0.23s cubic-bezier(.5,.2,.23,1), transform 0.17s cubic-bezier(.4,1,.4,1);
  box-shadow: 0 1.5px 9px var(--color-card-shadow);
  text-decoration: none;
}

.gallery-tile:hover,
.gallery-tile:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-card-shadow-hover);
}

.gallery-tile img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: filter 0.2s;
}

.gallery-tile:hover img,
.gallery-tile:focus img {
  filter: contrast(105%) saturate(1.06);
}

.tile-overlay {
  padding: 1em 1.2em 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.tile-label {
  font-size: 1em;
  font-family: inherit;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.28;
}

.tile-label strong {
  font-weight: 700;
  color: var(--color-text);
}

.tile-desc {
  font-size: 0.88em;
  color: var(--color-text);
  opacity: 0.65;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-grid .gallery-tile:nth-child(4) {
    display: flex;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }
  .gallery-tile img {
    height: 130px;
  }
  .tile-overlay {
    padding: 0.6em 0.8em 0.8em;
  }
  .tile-label {
    font-size: 0.82em;
  }
  .tile-label strong {
    display: block;
  }
  .tile-desc {
    display: none;
  }
}

/* ============================================
   PROJECT PAGES
   ============================================ */

.project-gallery {
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

.project-gallery img {
  width: 100%;
  border: #1111110b 1px solid;
  box-shadow: none;
}

#project-title {
  display: block;
  font-weight: 400;
  margin-bottom: 0.3em;
}

#project-title strong {
  font-weight: bold;
}

@media (max-width: 500px) {
  #project-title {
    line-height: 1.3em;
    margin-bottom: 0.7em;
  }
}

.project-body {
  margin-top: 60px;
  text-align: left;
}

.project-body p {
  margin: 0 0 0.8em 0;
  line-height: 1.5;
  color: var(--color-text-main);
}

.project-body strong {
  font-weight: 600;
  color: var(--color-text-main);
}

.project-body ul,
.project-body ol {
  margin: 0.2em 0 0.8em 0;
  padding-left: 1.1rem;
}

.project-body li {
  margin-bottom: 0.25em;
  line-height: 1.45;
}

.project-body span.numbered-line {
  display: flex !important;
  align-items: flex-start;
  margin-bottom: -1em;
  line-height: 1.45;
  padding-left: 0 !important;
  text-indent: 0 !important;
  margin-left: 0 !important;
}

.project-body span.numbered-line .num {
  flex: 0 0 1.15em;
  margin-right: 0;
}

.project-body .section-label {
  display: inline-block;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-link);
}
