/* =====================================================================
   FERNANDO MARTINS — PROFESSIONAL PROFILE
   Custom stylesheet — no framework dependencies
   ===================================================================== */

/* ─── 1. Design tokens ────────────────────────────────────────────── */
:root {
  /* Colours */
  --c-bg-dark:    #15191a;   /* hero, what-i-do, contact sections */
  --c-bg-light:   #2b3233;   /* nav, competencies, insights sections */
  --c-text:       #dae4e5;
  --c-text-muted: #dae4e599; /* 60% opacity */
  --c-accent:     #2c5a61;
  --c-accent-hov: #3f818b;
  --c-icon:       #a6ced2;
  --c-border:     #dae4e533; /* 20% opacity */

  /* Fonts */
  --f-head: Lexend, sans-serif;
  --f-body: "Instrument Sans", sans-serif;

  /* Heading sizes — desktop */
  --sz-h1: 4.21rem;   --sz-h1-tab: 3.37rem;  --sz-h1-ml: 2.69rem;  --sz-h1-mp: 2.15rem;
  --sz-h2: 2.37rem;   --sz-h2-tab: 1.89rem;  --sz-h2-ml: 1.52rem;  --sz-h2-mp: 1.21rem;
  --sz-h3: 1.78rem;   --sz-h3-tab: 1.42rem;  --sz-h3-ml: 1.14rem;  --sz-h3-mp: 0.91rem;
  --sz-h4: 1.33rem;   --sz-h4-tab: 1.20rem;  --sz-h4-ml: 1.08rem;  --sz-h4-mp: 0.97rem;
  --sz-h5: 1rem;
  --sz-h6: 0.75rem;
  --sz-lg: 1.13rem;   --sz-lg-mob: 1.1rem;

  /* Section padding */
  --sec-pad:     8rem;
  --sec-pad-tab: 7rem;
  --sec-pad-ml:  6rem;
  --sec-pad-mp:  5rem;

  /* Container */
  --con-pad: 4rem;
  --con-max: 1280px;

  /* Border radii */
  --r-sm: 0.25rem;
  --r-md: 0.5rem;
}


/* ─── 2. Reset / base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
  background-color: var(--c-bg-dark);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }


/* ─── 3. Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
}
h5, h6 {
  font-family: var(--f-head);
  font-weight: 500;
  line-height: 1.3;
}

h1 { font-size: var(--sz-h1); margin-bottom: 0.3em; }
h2 { font-size: var(--sz-h2); margin-bottom: 0.35em; }
h3 { font-size: var(--sz-h3); margin-bottom: 0.5em; }
h4 { font-size: var(--sz-h4); margin-bottom: 0.5em; }
h5 { font-size: var(--sz-h5); letter-spacing: 0; margin-bottom: 0.7em; }
h6 { font-size: var(--sz-h6); letter-spacing: 0.1em; margin-bottom: 0.7em; }

p { margin-bottom: 0.7em; }
p:last-child { margin-bottom: 0; }


/* ─── 4. Layout utilities ─────────────────────────────────────────── */
.section {
  background-color: var(--c-bg-light);
  padding-top: var(--sec-pad);
  padding-bottom: var(--sec-pad);
}
.section--dark { background-color: var(--c-bg-dark); }

.container {
  max-width: var(--con-max);
  margin-inline: auto;
  padding-inline: var(--con-pad);
}

/* Eyebrow label */
.eyebrow {
  display: inline-block;
  font-family: var(--f-body);
  font-size: var(--sz-h6);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 1.25rem;
}

/* Section header block */
.section-header { margin-bottom: 4rem; }
.section-header--center { text-align: center; }

/* Subheading (below h2 in a section header) */
.subheading {
  font-size: var(--sz-lg);
  line-height: 1.6;
  color: var(--c-text-muted);
  max-width: 52ch;
  margin-bottom: 0;
}
.section-header--center .subheading { margin-inline: auto; }

/* Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.gap-sm { gap: 1rem; }
.gap-md { gap: 3rem; }

/* Inline text link */
.text-link {
  color: var(--c-icon);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c-icon) 30%, transparent);
  transition: text-decoration-color 0.2s;
}
.text-link:hover {
  text-decoration-color: var(--c-icon);
}


/* ─── 5. Navigation ───────────────────────────────────────────────── */
.nav {
  background-color: var(--c-bg-light);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--c-border);
}

.nav-inner {
  max-width: var(--con-max);
  margin-inline: auto;
  padding-inline: var(--con-pad);
  height: 4.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: var(--sz-lg);
  font-family: var(--f-body);
}
.nav-logo-icon {
  width: 1.875rem;
  height: 1.875rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}
.nav-link {
  font-size: 1rem;
  color: var(--c-text);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-link:hover { opacity: 1; }

.nav-actions { justify-self: end; }

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
  color: var(--c-text);
  line-height: 0;
}

/* Mobile dropdown menu */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background-color: var(--c-bg-light);
  border-top: 1px solid var(--c-border);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
}
.nav-mobile-menu.is-open { display: flex; }

.nav-mobile-link {
  padding: 0.75rem var(--con-pad);
  font-size: 1rem;
  color: var(--c-text);
  text-align: right;
  opacity: 0.8;
  border-bottom: 1px solid var(--c-border);
  transition: opacity 0.2s;
}
.nav-mobile-link:hover { opacity: 1; }


/* ─── 6. Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 400;
  padding: 1em 1.5em;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s;
  border: none;
}
.btn--primary {
  background-color: var(--c-accent);
  color: #fff;
}
.btn--primary:hover { background-color: var(--c-accent-hov); }

.btn--outline {
  background-color: transparent;
  color: var(--c-text);
  box-shadow: inset 0 0 0 1px var(--c-text);
}
.btn--outline:hover { box-shadow: inset 0 0 0 2px var(--c-text); }


/* ─── 7. Hero section ─────────────────────────────────────────────── */
.hero {
  background-color: var(--c-bg-dark);
  padding-top: 8rem;
  padding-bottom: var(--sec-pad);
}

.hero-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: end;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.hero-signature {
  width: 55%;
  max-width: 260px;
}

.hero-headline {
  font-family: var(--f-head);
  font-size: var(--sz-h1);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 0;
  text-wrap: wrap;
}

.hero-subtitle {
  font-size: var(--sz-lg);
  line-height: 1.6;
  color: var(--c-text-muted);
  margin-bottom: 0;
}

.hero-cta { width: 50%; }

.hero-photo {
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: 640px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--r-md);
}


/* ─── 8. Competency cards ─────────────────────────────────────────── */
.card {
  background-color: var(--c-bg-dark);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-icon {
  width: 3rem;
  height: 3rem;
  color: var(--c-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.card h3 { font-size: var(--sz-h4); line-height: 1.3; }
.card p   { color: var(--c-text-muted); margin-bottom: 0; font-size: 1rem; }


/* ─── 9. Content cards (What I do) ───────────────────────────────── */
.content-card {
  display: flex;
  flex-direction: column;
  color: var(--c-text);
  text-decoration: none;
  transition: opacity 0.3s;
}
.content-card:hover { opacity: 0.85; }

.ratio-2x3 {
  aspect-ratio: 2/3;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
}
.ratio-2x3 img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card h3 { font-size: var(--sz-h3); }
.content-card p  { color: var(--c-text-muted); margin-bottom: 0; }


/* ─── 10. Insights — Q&A rows ─────────────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.qa-list { display: flex; flex-direction: column; }

.qa-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--c-text) 15%, transparent);
}
.qa-row:first-child {
  border-top: 1px solid color-mix(in srgb, var(--c-text) 15%, transparent);
}

.qa-question {
  font-family: var(--f-head);
  font-size: var(--sz-h4);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.qa-answer {
  font-size: var(--sz-lg);
  line-height: 1.6;
  color: var(--c-text-muted);
  margin-bottom: 0;
}


/* ─── 11. Contact section ─────────────────────────────────────────── */
.contact-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.contact-item { text-align: center; min-width: 180px; }

.contact-icon {
  width: 3rem;
  height: 3rem;
  color: var(--c-icon);
  background-color: color-mix(in srgb, var(--c-icon) 10%, transparent);
  border-radius: var(--r-sm);
  padding: 0.5rem;
  box-sizing: content-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.contact-item h3 {
  font-size: var(--sz-h5);
  letter-spacing: 0;
  margin-bottom: 0.25em;
}
.contact-item p  { color: var(--c-text-muted); margin-bottom: 0.5em; }


/* ─── 12. Responsive ──────────────────────────────────────────────── */

/* Tablet — ≤991px */
@media screen and (max-width: 991px) {
  /* Nav: show hamburger, hide desktop items */
  .nav-links, .nav-actions { display: none; }
  .nav-hamburger { display: block; }

  /* Heading sizes */
  h1 { font-size: var(--sz-h1-tab); }
  h2 { font-size: var(--sz-h2-tab); }
  h3 { font-size: var(--sz-h3-tab); }
  h4 { font-size: var(--sz-h4-tab); }
  .hero-headline { font-size: var(--sz-h1-tab); }

  /* Section padding */
  .section        { padding-top: var(--sec-pad-tab); padding-bottom: var(--sec-pad-tab); }
  .hero           { padding-top: 6rem; padding-bottom: var(--sec-pad-tab); }

  /* Hero */
  .hero-grid { gap: 2.5rem; }

  /* Cards */
  .card { padding: 1.5rem; }

  /* Insights layout stacks at tablet */
  .insights-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* Large mobile — ≤767px */
@media screen and (max-width: 767px) {
  :root { --con-pad: 2.67rem; }

  h1 { font-size: var(--sz-h1-ml); }
  h2 { font-size: var(--sz-h2-ml); }
  h3 { font-size: var(--sz-h3-ml); }
  h4 { font-size: var(--sz-h4-ml); }
  .hero-headline { font-size: var(--sz-h1-ml); }

  .section { padding-top: var(--sec-pad-ml); padding-bottom: var(--sec-pad-ml); }
  .hero    { padding-top: 3rem; padding-bottom: var(--sec-pad-ml); }

  /* Hero stacks vertically */
  .hero-grid           { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-content        { padding-bottom: 0; gap: 1.25rem; }
  .hero-signature      { width: 60%; max-width: 240px; }
  .hero-cta            { width: 100%; }
  .hero-photo          { min-height: unset; max-height: none; aspect-ratio: 4/5; }

  /* Grids collapse to single column */
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Q&A rows collapse */
  .qa-row { grid-template-columns: 1fr; gap: 0.5rem; }

  /* Image ratios */
  .ratio-2x3 { aspect-ratio: 1; }

  /* Reduced top padding on content sections (−30% vs desktop) */
  #competencies,
  #what-i-do,
  #insights { padding-top: 4.2rem; }
}

/* Small mobile — ≤479px */
@media screen and (max-width: 479px) {
  h1 { font-size: var(--sz-h1-mp); }
  h2 { font-size: var(--sz-h2-mp); }
  h3 { font-size: var(--sz-h3-mp); }
  h4 { font-size: var(--sz-h4-mp); }
  .hero-headline  { font-size: var(--sz-h1-mp); }
  .hero-subtitle,
  .subheading,
  .qa-answer      { font-size: var(--sz-lg-mob); }

  .section { padding-top: var(--sec-pad-mp); padding-bottom: var(--sec-pad-mp); }
  .hero    { padding-top: 2.5rem; padding-bottom: var(--sec-pad-mp); }

  #competencies,
  #what-i-do,
  #insights { padding-top: 3.5rem; }
}

