/* =========================================
   RESET + VARIABLES + BASE
========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font-sans: "Poppins", system-ui, -apple-system, sans-serif;
  --font-serif: "Roboto Slab", serif;

  --bg: #faf9f6;
  --surface: #f8f7f5;
  --surface-2: #f2f1ed;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e6e3dd;
  --accent: #a33643;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

body.menu-open { overflow: hidden; }

/* =========================================
   BACK TO TOP
========================================= */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;

  box-shadow: 0 8px 18px rgba(0,0,0,0.12);

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 1002;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================
   HEADER + NAV
========================================= */
.header,
.hero {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  color: inherit;
}

.logo img { width: 40px; }

.logo span {
  font-family: var(--font-serif);
  font-weight: 600;
}

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

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-sans);
}

/* Hamburger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.6rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop dropdown */
.has-submenu { position: relative; }

.nav-link.submenu-toggle {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 0;
}

.submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;

  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;

  display: none;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
  z-index: 1200;
}

.submenu a {
  display: block;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

.submenu a:hover,
.submenu a:focus-visible { background: var(--surface-2); }

.has-submenu.is-open .submenu { display: block; }

/* =========================================
   HERO
========================================= */
.hero {
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.hero-text p {
  margin-bottom: 24px;
  font-size: 1.1rem;
}

.hero-text strong { font-weight: 700; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Hero image */
.hero-image {
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

.image-bg {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border-radius: 16px;
}

.hero-image img {
  width: 100%;
  max-width: 380px;
  border-radius: 12px;
  background: transparent;
}

.photo-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  max-width: 320px;
}

/* =========================================
   WHAT I DO (all subsections)
========================================= */
.what-i-do {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  grid-column: 1 / -1;
}

.what-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.what-i-do h2 {
  font-family: var(--font-serif);
  margin-bottom: 12px;
}

.what-subsection {
  margin-top: 44px;           
}

.what-subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 14px;        
}

/* Grid of cards */
.what-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1200px) {
  .what-grid { grid-template-columns: repeat(3, 1fr); }
}

.what-card {
  display: flex;             
  flex-direction: column;
  gap: 6px;

  text-decoration: none;
  color: inherit;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.what-card:hover,
.what-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.what-card h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.what-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card-action {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  opacity: 0.75;
}

@media (min-width: 768px) {
  .card-action { opacity: 0; transition: opacity 0.15s ease; }
  .what-card:hover .card-action,
  .what-card:focus-visible .card-action { opacity: 0.75; }
}

/* Technical writing icons */
.what-card svg {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  flex: 0 0 28px;
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
}

@media (max-width: 600px) {
  .what-card svg { width: 26px; height: 26px; }
}

/* Project cards*/
.project-image {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 10px;
}

.project-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   FIGMA PREVIEW (Design section)
========================================= */
.figma-preview {
  display: block;
  text-decoration: none;
  color: inherit;

  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.figma-preview__image {
  max-height: 680px;
  overflow: hidden;
  position: relative;
}

.figma-preview__image img {
  width: 100%;
  height: auto;
  display: block;
}

.figma-preview__image::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(248,247,245,0), rgba(248,247,245,1));
}

.figma-preview__cta {
  display: block;
  padding: 14px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--surface);
}

@media (hover: hover) {
  .figma-preview:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
}

/* =========================================
   GALLERY + LIGHTBOX
========================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

#gallery { margin-bottom: 24px; }

.gallery-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: min(1100px, 95vw);
  max-height: 85vh;
  border-radius: 16px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 34px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
}

/* =========================================
   FOOTER / CONTACT
========================================= */
.footer {
  background: var(--surface-2);
  margin-top: 36px;          
  padding: 80px 24px;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.footer h2 {
  font-family: var(--font-serif);
  margin-bottom: 12px;
}

.footer-intro {
  margin-bottom: 32px;
  color: var(--muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto 40px;
  max-width: 420px;
  width: 100%;
}

.contact-form input,
.contact-form textarea,
.contact-form button {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea { border: 1px solid #ddd; }

.contact-form textarea { resize: vertical; }

.contact-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* Social links */
.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  line-height: 1;
}

.socials a:visited { color: var(--text); }

.socials svg {
  width: 22px;
  height: 22px;
  fill: var(--text);
  transition: opacity 0.2s ease;
  display: block;
}

.socials a:hover svg { opacity: 0.6; }

.socials .github-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.socials a span {
  font-size: 0.9rem;
  color: inherit;
}

.footer-copy {
  font-size: 0.8rem;
  color: #888;
}

/* =========================================
   ACCESSIBILITY
========================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 1199px) {
  .hero { gap: 48px; }
  .hero-image img { max-width: 360px; }
}

@media (max-width: 991px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 60px 24px;
    gap: 32px;
  }

  .hero-image {
    justify-content: center;
    text-align: center;
  }

  .image-bg {
    width: 100%;
    max-width: 520px;
  }

  .photo-caption { max-width: 420px; }

  .what-i-do { padding: 20px 24px 22px; }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: block;
    font-size: 2rem;
    z-index: 1001;
  }

  .nav {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    z-index: 1000;

    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;

    padding: 90px 18px 24px;
    overflow-y: auto;
  }

  .nav.is-open { display: flex; }

  .nav > a,
  .nav .submenu-toggle {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;

    padding: 14px 16px;
    border-radius: 14px;

    background: var(--surface);
    border: 1px solid var(--border);

    text-align: left;
    font-size: 1.1rem;
    line-height: 1.2;
  }

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

  .nav-link.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
  }

  .nav-link.submenu-toggle::after {
    content: "▾";
    font-size: 1.1rem;
    opacity: 0.7;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
  }

  .has-submenu.is-open .nav-link.submenu-toggle::after { transform: rotate(180deg); }

  .submenu {
    position: static;
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;

    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
    text-align: left;
  }

  .has-submenu.is-open .submenu { max-height: 320px; }

  .submenu a {
    display: block;
    margin-top: 8px;

    padding: 12px 16px 12px 34px;
    border-radius: 14px;

    background: #fff;
    border: 1px solid var(--border);

    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
  }

  .submenu a:hover,
  .submenu a:focus-visible { background: var(--surface-2); }
}

@media (max-width: 767px) {
  .header { padding: 18px; }
  .hero { padding: 44px 18px; }
  .hero-text p { font-size: 1rem; }
  .btn { width: 100%; text-align: center; }
  .image-bg { padding: 16px; border-radius: 14px; }
  .footer { padding: 60px 18px; }
}

@media (max-width: 575px) {
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .logo span { font-size: 1rem; }
  .hero { padding: 36px 16px; }
  .photo-caption { font-size: 0.8rem; }
}
