/* === GarethAPI.com Design Language - Consolidated CSS === */

/* === Design Tokens === */
:root {
  --gapi-brown:  #46350A; /* Hero/headers, brand background */
  --gapi-purple: #DDBBFF; /* GarethAPI.com brand highlight */
  --gapi-orange: #FF9100; /* Accents, notices */
  --gapi-red:    #C61C00; /* Errors/warnings */
  --gapi-green:  #0B4000; /* Success/confirmation, footers */
  --gapi-violet: #6400FF; /* Tool titles (e.g. API Designer) */
  --gapi-white:  #FFFFFF; /* Background */
  --gapi-black:  #000000; /* Text */

  --gapi-font-heading: 'Madimi One', sans-serif;
  --gapi-font-body: 'Hanken Grotesk', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  --gapi-font-accent: 'Neuton', Georgia, 'Times New Roman', serif;

  /* Layout variables */
  --shadow: 0 5px 18px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1);
  --radius: 16px;
  --line: #e6e1db;
}

/* === Local Font Faces === */
@font-face {
  font-family: 'Madimi One';
  src: url('fonts/MadimiOne-Regular.ttf?v=2') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neuton';
  src: url('fonts/Neuton-Regular.ttf?v=2') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* === Core Elements === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth !important;
}

html, body {
  height: 100%;
  background: var(--gapi-white) !important;
  color: var(--gapi-black) !important;
  font-family: var(--gapi-font-body) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  font-size: 16px;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6, .gapi-heading {
  font-family: var(--gapi-font-heading) !important;
  color: #0100A5 !important; /* Blue text on light backgrounds */
  letter-spacing: 0.2px !important;
  margin: 0 0 0.5em 0 !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

h1 { font-size: clamp(28px,3.2vw,60px); }
h2 { font-size: clamp(24px,3.0vw,36px); margin-bottom: 10px; }
h3 { font-size: clamp(20px,2.4vw,26px); margin-bottom: 6px; }

/* === Layout Helpers === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 56px 0;
  scroll-margin-top: 88px; /* sticky header offset */
}

.narrow { max-width: 820px; }
.center { text-align: center; }

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gapi-purple) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  .header {
    position: relative;
  }
}

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

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.brand strong {
  color: #0100A5 !important; /* Blue for brand on light background */
}

.brand span {
  font-size: 12px;
  color: var(--gapi-black);
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  text-decoration: none;
  color: var(--gapi-black) !important; /* Black text on light background */
  transition: color .2s;
}

.nav a:hover {
  color: #0100A5 !important; /* Blue hover on light background */
}

/* === Hero Section === */
.hero {
  background: var(--gapi-brown) url('garethapi-design-bkg2.jpg') center/cover no-repeat !important;
  color: var(--gapi-white) !important;
  padding-top: 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 36px;
  align-items: center;
}

.hero-text h1.gapi-heading {
  color: var(--gapi-white) !important; /* White text on brown background */
  font-size: clamp(28px,3.2vw,60px) !important;
  white-space: nowrap; /* Prevent wrapping */
}

.hero-sub {
  color: var(--gapi-white) !important; /* White text on dark background */
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  font-size: 1.1rem;
  margin: 6px 0 8px;
}

.hero-desc {
  color: var(--gapi-white) !important; /* White text on dark background */
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.hero-card,
.hero-card.gapi-card {
  background: rgba(255, 255, 255, 0.6) !important; /* Semi-transparent white background */
  backdrop-filter: blur(10px) !important; /* Add blur effect for modern look */
  border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Semi-transparent border */
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  text-align: center;
}

.hero-card i {
  color: var(--gapi-white) !important; /* White for hero icons */
  font-size: 32px;
  margin-bottom: 6px;
}

/* === Buttons === */
.gapi-btn {
  font: inherit !important;
  padding: 0.65rem 1rem !important;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: transform .02s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
}

.gapi-btn:active { transform: translateY(1px) !important; }

.gapi-btn-primary {
  background: var(--gapi-violet) !important;
  color: var(--gapi-white) !important;
}

.gapi-btn-primary:hover {
  background: #5a00e6 !important;
  color: var(--gapi-white) !important;
}

.gapi-btn-secondary {
  background: var(--gapi-purple) !important;
  color: #12006b !important;
}

.gapi-btn-secondary:hover {
  background: #c9a3ff !important;
  color: #12006b !important;
}

/* === Cards === */
.gapi-card {
  background: var(--gapi-white) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 16px !important;
  padding: 1rem 1.25rem !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.06) !important;
}

/* === Section Headers === */
.section-head {
  margin-bottom: 16px;
}

.section-sub {
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  color: var(--gapi-black) !important; /* Black text on light background */
}

/* === Tools Section === */
.tools {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 18px;
  margin-top: 10px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--gapi-violet) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.badge {
  font-size: .75rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.badge.live {
  background: var(--gapi-green) !important; /* Green for success/live status */
  color: var(--gapi-white) !important;
}

.badge.soon {
  background: var(--gapi-orange) !important;
  color: var(--gapi-white) !important;
}

.tool-body p {
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  color: var(--gapi-black) !important; /* Black text on light background */
}

.tool-features {
  margin: 10px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-features li {
  list-style: none;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .6rem;
  color: #555;
}

.tool-features code {
  font-family: var(--gapi-font-body) !important; /* Use body font for code elements */
  font-size: inherit !important; /* Inherit the same size as parent */
  background: rgba(0, 0, 0, 0.05) !important; /* Light background for code */
  padding: 2px 4px !important; /* Small padding around code */
  border-radius: 3px !important; /* Slight rounding */
}

.tool-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* === About Section === */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.about-text p {
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  color: var(--gapi-black) !important; /* Black text on light background */
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  background: var(--gapi-orange) !important; /* Orange for accent elements */
  color: #fff;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .85rem;
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.stack-link:hover {
  background: var(--gapi-orange) !important;
  color: #fff;
}

/* === Speaking Timeline === */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0 18px;
}

.timeline h3 {
  font-size: 1.3rem;
  margin: 20px 0 8px 0;
  color: var(--gapi-violet) !important;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}

.timeline h3:first-child {
  margin-top: 0;
}

.t-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: transform .15s ease;
}

.t-item:hover {
  transform: translateY(-2px);
}

.t-item.upcoming {
  border-left: 4px solid var(--gapi-green) !important; /* Green for upcoming events */
}

.t-item.past {
  border-left: 4px solid var(--gapi-orange) !important; /* Orange for past events */
  opacity: 0.92 !important;
}

.t-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.t-date .m {
  font-size: .85rem;
  color: var(--gapi-violet) !important;
  font-weight: 600;
}

.t-date .y {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gapi-black);
}

.t-body h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.t-loc {
  font-size: .9rem;
  color: var(--gapi-violet) !important;
  margin-bottom: 4px;
}

.timeline p {
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  color: var(--gapi-black) !important; /* Black text on light background */
}

.t-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.t-links a {
  font-size: .85rem;
  color: var(--gapi-violet) !important;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--gapi-violet) !important;
  border-radius: 6px;
  transition: all .2s ease;
}

.t-links a:hover {
  background: var(--gapi-orange) !important;
  color: var(--gapi-white) !important;
}

.speaking-cta {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

/* === Contact Section === */
.contact {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact p {
  font-family: var(--gapi-font-accent) !important; /* Neuton for supporting text */
  color: var(--gapi-black) !important; /* Black text on light background */
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 14px;
  margin-top: 12px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  color: inherit;
  text-decoration: none;
  min-height: 80px;
}

.contact-card:hover {
  background: var(--gapi-orange) !important;
  color: #fff;
}

.contact-card i {
  font-size: 22px;
  width: 24px;
  text-align: center;
  margin-top: 2px;
  flex-shrink: 0;
}

.contact-card div {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-card h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
}

.contact-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* === Footer === */
.site-footer {
  background: linear-gradient(rgba(11,64,0,0.55), rgba(11,64,0,0.55)), url('pine1.jpg') center/cover no-repeat !important;
  color: var(--gapi-white) !important;
  padding: 24px 0 14px;
  margin-top: 24px;
}

.foot-flex {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.foot-flex .left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.foot-links {
  display: flex;
  gap: 18px;
}

.foot-links a {
  color: var(--gapi-white) !important;
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--gapi-orange) !important; /* Orange hover on green footer */
}

.foot-social {
  display: flex;
  gap: 10px;
}

.foot-social a {
  color: var(--gapi-white) !important;
}

.foot-social a:hover {
  color: var(--gapi-orange) !important; /* Orange hover on green footer */
}

.foot-bottom {
  border-top: 1px solid rgba(255,255,255,0.2) !important;
  margin-top: 12px;
  padding-top: 12px;
  text-align: center;
  color: rgba(255,255,255,0.8) !important;
  font-size: .9rem;
}

/* === Contact Modal === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--gapi-violet) !important;
}

.modal-close {
  background: var(--gapi-white) !important;
  border: 2px solid var(--gapi-violet) !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  color: var(--gapi-violet) !important;
  transition: all 0.2s ease !important;
}

.modal-close:hover {
  background: var(--gapi-violet) !important;
  color: var(--gapi-white) !important;
  transform: scale(1.1) !important;
}

.modal-body {
  padding: 24px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--gapi-black);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gapi-violet) !important;
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 24px;
  align-items: center;
  flex-wrap: nowrap;
}

.form-actions .gapi-btn {
  white-space: nowrap;
  flex-shrink: 1;
  padding: 8px 16px;
  font-size: 14px;
}

.contact-success {
  text-align: center;
  padding: 20px;
}

.contact-success i {
  font-size: 48px;
  color: var(--gapi-green) !important;
  margin-bottom: 16px;
}

.contact-success h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--gapi-black);
}

.contact-success p {
  color: var(--gapi-black);
  margin-bottom: 20px;
}

/* === Mobile Menu === */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: var(--gapi-black);
  transition: all 0.3s ease;
  transform-origin: 1px;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg);
}

/* === Responsive Design === */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-cards {
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
  }
  .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .section {
    padding: 40px 0;
    scroll-margin-top: 70px; /* mobile header offset */
  }
  
  .header-content {
    height: 56px;
  }
  
  .brand h4 {
    font-size: 1.1rem;
  }
  
  .brand span {
    font-size: 11px;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gapi-purple);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
  }
  
  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 1.1rem;
  }
  
  .nav a:last-child {
    border-bottom: none;
  }
  
  .hero {
    padding-top: 60px;
  }
  
  .hero-text h1.gapi-heading {
    font-size: clamp(24px, 4vw, 36px) !important;
    white-space: normal;
    line-height: 1.2;
  }
  
  .hero-sub {
    font-size: 1rem;
  }
  
  .hero-desc {
    font-size: 0.95rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .hero-actions .gapi-btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }
  
  .hero-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .hero-card {
    padding: 16px;
  }
  
  .hero-card i {
    font-size: 28px;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .tool-card {
    min-height: auto;
    padding: 16px;
  }
  
  .tool-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .tool-actions .gapi-btn {
    width: 100%;
    text-align: center;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .pill-row {
    gap: 6px;
  }
  
  .pill {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  .link-stack {
    gap: 8px;
  }
  
  .stack-link {
    padding: 16px;
  }
  
  .timeline {
    gap: 12px;
  }
  
  .t-item {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .t-date {
    flex-direction: row;
    justify-content: space-between;
    min-width: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  
  .t-date .m {
    font-size: 0.9rem;
  }
  
  .t-date .y {
    font-size: 1rem;
  }
  
  .t-links {
    flex-direction: column;
    gap: 8px;
  }
  
  .t-links a {
    text-align: center;
    padding: 8px 12px;
  }
  
  .speaking-cta {
    padding: 16px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: none;
  }
  
  .contact-card {
    padding: 16px;
    min-height: 70px;
  }
  
  .foot-flex {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .foot-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .foot-social {
    justify-content: center;
  }
  
  .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .form-actions .gapi-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .section {
    padding: 32px 0;
  }
  
  .hero-text h1.gapi-heading {
    font-size: clamp(20px, 5vw, 28px) !important;
  }
  
  .hero-sub {
    font-size: 0.95rem;
  }
  
  .hero-desc {
    font-size: 0.9rem;
  }
  
  .tool-features {
    flex-direction: column;
    gap: 4px;
  }
  
  .tool-features li {
    text-align: center;
  }
  
  .t-item {
    padding: 12px;
  }
  
  .contact-card {
    padding: 12px;
    min-height: 60px;
  }
  
  .contact-card i {
    font-size: 20px;
  }
  
  .contact-card h4 {
    font-size: 0.95rem;
  }
  
  .contact-card p {
    font-size: 0.85rem;
  }
}