/* ===========================================================
   Portfolio stylesheet
   Editorial / writing-marketing portfolio theme
   =========================================================== */

:root {
  --color-bg: #fafafa;
  --color-bg-alt: #f0f0f2;
  --color-surface: #ffffff;
  --color-ink: #18181b;
  --color-ink-soft: #52525b;
  --color-muted: #8f8f96;
  --color-accent: #8b6fc9;
  --color-accent-dark: #6b4fb0;
  --color-border: #e2e2e6;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1080px;
  --radius: 10px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--color-ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-2); color: var(--color-ink-soft); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.lede {
  font-size: 1.15rem;
  color: var(--color-ink-soft);
  max-width: 640px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--color-ink);
  color: var(--color-bg);
}
.btn-primary:hover { background: var(--color-accent-dark); transform: translateY(-1px); }

.btn-outline {
  border-color: var(--color-ink);
  color: var(--color-ink);
}
.btn-outline:hover { background: var(--color-ink); color: var(--color-bg); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a {
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--color-accent);
  color: var(--color-ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-ink);
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--color-border); }
  .nav-links a { display: block; padding: 1rem 1.5rem; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-5);
  align-items: center;
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--color-bg-alt), var(--color-border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: var(--space-3);
  border: 1px dashed var(--color-muted);
  overflow: hidden;
}

.hero-photo.filled {
  background: none;
  border: none;
  padding: 0;
}

.hero-photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: block;
  border-radius: 6px;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-5) 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* ---------- Work cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -14px rgba(24, 24, 27, 0.35);
}

.card-media {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
}

.card-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: block;
  border-radius: 6px;
}

.card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-bg-alt);
  color: var(--color-ink-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.card-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--color-accent-dark);
  font-size: 0.9rem;
}

.card.placeholder {
  border-style: dashed;
  color: var(--color-muted);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
  min-height: 260px;
}

.card.placeholder .card-body { align-items: center; }

/* ---------- Case study ---------- */
.case-hero-img {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  margin: var(--space-3) 0 var(--space-4);
}

.case-hero-img img {
  width: 100%;
  display: block;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}

.case-meta dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.case-meta dd { margin: 0; font-weight: 500; }

.copy-sample {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 6px;
  padding: var(--space-3);
  margin: var(--space-3) 0;
}

.copy-sample .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.copy-sample p:last-child { margin-bottom: 0; }

.prose p { max-width: 720px; }
.prose h3 { margin-top: var(--space-4); }

.back-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  margin-bottom: var(--space-3);
  width: fit-content;
}
.back-link:hover { color: var(--color-ink); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-5);
}
@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; }
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.skill-list li {
  padding: 0.7rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.92rem;
}

/* ---------- Visual work gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
}

.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: block;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.gallery-item:hover img { transform: scale(1.03); }

.gallery-item .gallery-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 24, 27, 0);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  border-radius: var(--radius);
}

.gallery-item:hover .gallery-view {
  opacity: 1;
  background: rgba(24, 24, 27, 0.4);
}

.gallery-item.placeholder {
  border-style: dashed;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.82rem;
  cursor: default;
}

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 18, 20, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.contact-list {
  display: grid;
  gap: 0.6rem;
  margin-top: var(--space-3);
}

.contact-list .contact-card {
  padding: 0.7rem 0.9rem;
}

.contact-list .contact-card .eyebrow {
  margin-bottom: 0.15rem;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.contact-card .eyebrow { margin-bottom: 0.4rem; }

/* ---------- Placeholder note ---------- */
.placeholder-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  border: 1px dashed var(--color-muted);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: var(--space-2);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  margin-top: var(--space-5);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.88rem;
  color: var(--color-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
