/* MelanieHarari.com — "Colorful" palette
   Fonts: DM Serif Display (headings) + Inter (body), loaded from Google Fonts in index.html */

:root {
  /* Palette */
  --paper: #fcfbf8;        /* page background */
  --white: #ffffff;        /* projects section background */
  --ink: #1d2b2a;          /* body text, dark buttons, footer */
  --muted: #5a6660;        /* secondary text (dates, roles) */
  --line: #ebe8e2;         /* hairline dividers */
  --coral: #f25757;
  --turquoise: #61e8e1;
  --yellow: #f2e863;
  --yellow-soft: #faf6c6;  /* "The result" boxes */
  --teal-text: #0b6e69;    /* links (darker turquoise, readable on paper) */

  /* Type */
  --font-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1200px;
  --gutter: 32px;
  --section-space: 72px;
  --radius: 8px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: var(--teal-text); }
a:hover { color: var(--ink); }

a:focus-visible {
  outline: 3px solid var(--teal-text);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Teal is too dark to see on the ink footer, so use yellow there */
.site-footer a:focus-visible { outline-color: var(--yellow); }

/* "Skip to content" link: hidden until a keyboard user presses Tab */
.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--white); }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0;
}

h2 { font-size: clamp(32px, 4vw, 44px); line-height: 1.14; }

p { margin: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Buttons */
.btn {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  color: var(--ink);
}
.btn:hover { filter: brightness(0.95); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--white); padding: 12px 20px; }
.btn-dark:hover { color: var(--white); filter: none; opacity: 0.9; }
.btn-turquoise { background: var(--turquoise); }
.btn-yellow { background: var(--yellow); }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 15px;
  font-weight: 600;
}
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--teal-text); }

/* Hero */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.hero-text {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero h1 {
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 0; /* lets the highlight sit behind the heading's other lines (see below) */
}

.hero mark {
  background: var(--yellow);
  color: inherit;
  padding: 0 8px;
  margin: 0 -8px; /* keeps the words lined up with the text edge; only the highlight extends */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  /* Draw the highlight behind the rest of the heading, so it never covers the line above */
  position: relative;
  z-index: -1;
}

.lead { max-width: 600px; font-size: 18px; line-height: 1.67; }
.lead a { font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.hero-photo {
  flex: 1 1 300px;
  max-width: 400px;
  position: relative;
  padding: 0 16px 16px 0;
}
.hero-photo::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  right: 0;
  bottom: 0;
  border: 2px solid var(--coral);
  border-radius: 12px;
}
.hero-photo img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
}

/* Logo strip */
.products { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.products-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.products h2 { font-size: 28px; line-height: 1.2; text-align: center; }

.logo-row {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px 80px;
}
/* All three logos in dark ink (#1d2b2a). The filter turns any dark logo black, then tints it to ink */
.logo-row img {
  width: auto;
  filter: brightness(0) invert(8%) sepia(98%) saturate(177%) hue-rotate(127deg) brightness(108%) contrast(88%);
}
.logo-wordpress { height: 40px; }
.logo-woo { height: 32px; }
.logo-tumblr { height: 30px; }

/* How I help */
.help {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.help-card {
  min-height: 220px;
  padding: 104px 32px 32px; /* top padding keeps the heading clear of the big corner number */
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  position: relative;
  isolation: isolate; /* keeps the big number behind the heading */
}
.help-card h3 { font-size: 30px; line-height: 1.2; }

/* Big soft numbers in the corner, matching the Past projects numbers.
   The "/ ''" part tells screen readers to skip them; older browsers use the first line */
.help-card::before {
  position: absolute;
  top: 12px;
  right: 24px;
  z-index: -1;
  font-family: var(--font-serif);
  font-size: 96px;
  line-height: 1;
  color: rgba(29, 43, 42, 0.14);
}
.help-card:nth-child(1)::before { content: "01"; content: "01" / ""; }
.help-card:nth-child(2)::before { content: "02"; content: "02" / ""; }
.help-card:nth-child(3)::before { content: "03"; content: "03" / ""; }
.card-coral { background: var(--coral); }
.card-turquoise { background: var(--turquoise); }
.card-yellow { background: var(--yellow); }

/* Past projects */
.projects {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}
.projects h2 { margin-bottom: 24px; }

.project {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.project:last-child { padding-bottom: 0; }

.project-meta {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-number {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1;
  color: var(--coral);
}

.project h3 { font-size: 32px; line-height: 1.19; }

.project-role { font-size: 14px; line-height: 1.57; color: var(--muted); }

.project-body {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result {
  background: var(--yellow-soft);
  border-radius: var(--radius);
  padding: 20px 24px;
}

/* Education */
/* Same two-column layout as Books: title on the left, list on the right.
   On narrow screens the list wraps below the title */
.about {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}
.about h2 { flex: 1 1 300px; min-width: 0; font-size: 40px; line-height: 1.15; }

.credentials {
  flex: 999 1 560px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.credentials li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.credentials li:first-child { padding-top: 0; }
.credentials li:last-child { border-bottom: 0; padding-bottom: 0; }
/* Same font and size as the book titles below (upright, since these aren't titles of works) */
.credentials strong {
  display: block;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.36;
}
.credentials span { font-size: 14px; color: var(--muted); }

/* Books */
.books { background: var(--turquoise); }

.books-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 64px;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}
.books h2 { flex: 1 1 300px; min-width: 0; font-size: 40px; line-height: 1.15; }

.book-list {
  flex: 999 1 560px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.book-list li { padding: 16px 0; border-bottom: 1px solid rgba(29, 43, 42, 0.2); }
.book-list cite {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.36;
}
.book-list span { font-size: 15px; }

/* Footer */
.site-footer { background: var(--ink); color: var(--white); }
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-top: 64px;
  padding-bottom: 40px;
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.footer-cta > div { display: flex; flex-direction: column; gap: 12px; }
.footer-cta h2 { font-size: clamp(36px, 4.5vw, 48px); line-height: 1.12; }
.footer-cta p { font-size: 18px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 14px;
}
.footer-bottom .wordmark { color: var(--white); font-size: 22px; }

/* Tablets and small laptops: stack the hero and center the photo */
@media (max-width: 1023px) {
  .hero-text,
  .hero-photo { flex-basis: 100%; }
  .hero-photo { margin: 0 auto; }
}

/* Below 900px the three cards get too narrow side by side, so stack them */
@media (max-width: 899px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-card { min-height: 160px; }
}

/* Small screens */
@media (max-width: 640px) {
  :root { --gutter: 20px; --section-space: 48px; }

  /* Header: LinkedIn button sits beside the name, links on the row below */
  .site-header { position: relative; }
  .site-header .wordmark { font-size: 24px; }
  .site-nav { gap: 8px 24px; }
  .site-nav .btn-dark {
    position: absolute;
    top: 18px;
    right: var(--gutter);
    padding: 10px 16px;
  }

  .hero { gap: 40px; padding-top: 24px; }
  .hero-photo { max-width: 320px; }

  /* Smaller card numbers so they stay above the headings */
  /* Extra top padding keeps headings clear of the corner number, even when they wrap to three lines */
  .help-card { min-height: 180px; padding-top: 72px; }
  .help-card::before { top: 12px; right: 20px; font-size: 52px; }

  /* Footer heading wraps to two even lines; shrinks a little on the narrowest phones so it never needs three */
  .footer-cta h2 { font-size: min(36px, calc((100vw - 40px) / 8.9)); text-wrap: balance; }

  /* Logos fit on one row */
  .logo-row { gap: 24px 16px; }
  .logo-wordpress { height: 24px; }
  .logo-woo { height: 21px; }
  .logo-tumblr { height: 20px; }
}

/* Very small phones (under 375px): shrink the logos so all three still fit on one row */
@media (max-width: 374px) {
  .logo-row { gap: 24px 12px; }
  .logo-wordpress { height: 20px; }
  .logo-woo { height: 17px; }
  .logo-tumblr { height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
