/* ==========================================================================
   Design System & Modern Redesign for davidlozanolucas.com
   ========================================================================== */

/* --- Typography: Local Inter & Source Serif 4 --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/source-serif-4-latin-600-normal.woff2') format('woff2');
}

/* --- Design Tokens --- */
:root {
  --bg-page: #F8F8F5;
  --text-main: #18242E;
  --text-muted: #66717D;
  --text-subtle: #8A94A0;
  --accent-blue: #2463C5;
  --accent-hover: #1A51A4;
  --accent-focus: rgba(36, 99, 197, 0.25);
  --border-color: #D9DEE3;
  --border-subtle: #E6EAEF;
  --card-bg: #FFFFFF;
  --card-radius: 12px;
  --btn-radius: 9px;
  --max-width: 1140px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

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

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  background: var(--accent-blue);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--btn-radius);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* --- Layout Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- Header --- */
.site-header {
  width: 100%;
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 82px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--text-main);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

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

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--accent-blue);
}

.external-arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.9em;
}

/* --- Hero / Presentation Section --- */
.hero-section {
  padding: 64px 0 64px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: center;
}

.hero-overline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(48px, 6.2vw, 86px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--text-main);
  margin-bottom: 24px;
}

.hero-title .accent-dot {
  color: var(--accent-blue);
}

.hero-roles {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}

.hero-roles .accent-text {
  color: var(--accent-blue);
}

.hero-bio {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 530px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  background-color: var(--accent-blue);
  color: #FFFFFF;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-primary svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.btn-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.btn-secondary-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.btn-secondary-link .arrow {
  transition: transform 0.15s ease;
}

.btn-secondary-link:hover .arrow {
  transform: translateX(3px);
}

.hero-microcopy {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Portrait Card */
.hero-media {
  display: flex;
  justify-content: flex-end;
}

.portrait-card {
  width: 100%;
  max-width: 330px;
  aspect-ratio: 4 / 5;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  background-color: #F7F7F5;
  overflow: hidden;
  position: relative;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Portrait monogram fallback */
.portrait-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8EDF2;
  color: #18242E;
  font-family: var(--font-serif);
  font-size: 110px;
  font-weight: 400;
  letter-spacing: -2px;
}

/* --- Section: Wealth Reader (Proyectos) --- */
.section-work {
  border-top: 1px solid var(--border-color);
  padding: 56px 0 56px 0;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Single Full-Width Card */
.wr-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 26px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.wr-zone-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.wr-wordmark {
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--text-main);
  display: inline-flex;
  align-items: baseline;
  user-select: none;
  line-height: 1;
}

.wr-wordmark .wr-light {
  font-weight: 400;
}

.wr-wordmark .wr-bold {
  font-weight: 800;
}

.wr-divider {
  width: 1px;
  height: 44px;
  background-color: var(--border-color);
  flex-shrink: 0;
}

.wr-zone-desc {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: #55606D;
  max-width: 440px;
}

.wr-zone-link {
  flex: 0 0 auto;
}

.wr-action-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.wr-action-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* --- Section: También escribo --- */
.section-writing {
  border-top: 1px solid var(--border-color);
  padding: 56px 0 56px 0;
}

.section-writing .section-title {
  margin-bottom: 36px;
}

.writing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.writing-col {
  display: flex;
  flex-direction: column;
}

.writing-blog {
  padding-right: 48px;
}

.writing-books {
  padding-left: 48px;
  border-left: 1px solid var(--border-color);
}

.writing-heading {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  margin-top: 8px;
  margin-bottom: 10px;
}

.writing-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 420px;
}

.blog-url-link {
  font-size: 15px;
  color: var(--accent-blue);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 14px;
}

.blog-url-link:hover {
  text-decoration: underline;
}

.writing-action-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  transition: color 0.15s ease;
}

.writing-action-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.writing-action-link .arrow {
  transition: transform 0.15s ease;
}

.writing-action-link:hover .arrow {
  transform: translateX(3px);
}

/* --- Section: Trayectoria técnica --- */
.section-tech {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
}

.tech-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.tech-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.tech-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tech-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tech-badge {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 44px 0 40px 0;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.footer-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent-blue);
}

.footer-link-subtle {
  color: var(--text-muted);
}

.footer-link-subtle:hover {
  color: var(--text-main);
}

.footer-bottom {
  margin-top: 28px;
}

.footer-domain {
  font-size: 13px;
  color: #9AA3AC;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablet (max-width: 900px) */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-media {
    justify-content: center;
  }

  .portrait-card {
    max-width: 280px;
  }

  .wr-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
  }

  .wr-divider {
    width: 100%;
    height: 1px;
    background-color: var(--border-subtle);
  }

  .wr-zone-desc {
    max-width: 100%;
  }

  .wr-zone-link {
    padding-top: 4px;
  }

  .writing-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .writing-blog {
    padding-right: 0;
  }

  .writing-books {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-top: 36px;
  }

  .tech-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

/* Mobile (max-width: 600px) */
@media (max-width: 600px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-inner {
    height: auto;
    padding: 16px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .site-nav {
    width: 100%;
    gap: 18px;
    flex-wrap: wrap;
  }

  .hero-section {
    padding: 40px 0 44px 0;
  }

  .hero-title {
    font-size: clamp(38px, 11vw, 54px);
    line-height: 1.02;
    margin-bottom: 18px;
  }

  .hero-roles {
    font-size: 22px;
    margin-bottom: 18px;
  }

  .hero-bio {
    font-size: 16px;
    margin-bottom: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .btn-primary {
    width: 100%;
    min-height: 48px;
  }

  .btn-secondary-link {
    justify-content: center;
    padding: 8px 0;
  }

  .hero-media {
    margin-top: 8px;
  }

  .portrait-card {
    max-width: 250px;
  }

  .section-work,
  .section-writing {
    padding: 44px 0;
  }

  .wr-wordmark {
    font-size: 28px;
  }

  .tech-badges {
    width: 100%;
    gap: 10px;
  }

  .tech-badge {
    width: 100%;
    text-align: center;
  }

  .footer-top {
    flex-direction: column;
    gap: 20px;
  }

  .footer-links {
    gap: 18px;
  }
}
