/* ========================================
   ChatSupply! — Mobile-first stylesheet
   ======================================== */

/* 1. Colors and shared variables */
:root {
  /* Original color variables — values preserved */
  --color-bg: #F1DA92;
  --color-text: #222222;
  --color-text-muted: #555555;
  --color-accent: #005bac;
  --color-hero-bg: #0f172a;
  --color-hero-text: #f8fafc;
  --color-hero-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-card-bg: #F1DA92;

  /* Additional variables */
  --color-main-bg: #ffffff;
  --color-card-hover: #F1DA92;
  --color-focus: #005bac;
  --color-hero-kicker: #38bdf8;

  /* Layout */
  --max-width-site: 1000px;
  --max-width-text: 40em;
  --container-padding: 1.25rem;
  --card-gap: 1rem;

  /* Shape and spacing */
  --radius-card: 0.75rem;
  --radius-button: 0.4rem;
}


/* ========================================
   2. Global reset and document defaults
   ======================================== */

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

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;

  background-color: var(--color-main-bg);
  color: var(--color-text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    Meiryo,
    "Yu Gothic",
    sans-serif;

  font-size: 1.125rem;
  line-height: 1.8;

  word-break: normal;
  line-break: strict;
  overflow-wrap: anywhere;

  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--color-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

p {
  max-width: var(--max-width-text);
  margin-bottom: 1.25rem;
}

::selection {
  background-color: var(--color-accent);
  color: #ffffff;
}


/* ========================================
   3. Hero section
   ======================================== */

.hero {
  width: 100%;
  background-color: var(--color-hero-bg);
  color: var(--color-hero-text);
}

.hero-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;

  width: 100%;
  max-width: var(--max-width-site);
  margin-inline: auto;
  padding: 2rem var(--container-padding) 2.5rem;
}

.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  min-width: 0;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 24em;
  height: auto;
  object-fit: contain;
}

.hero-content {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.hero-kicker {
  margin-bottom: 0.75rem;

  color: var(--color-hero-kicker);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 20em;
  margin: 0 auto 1rem;

  color: var(--color-hero-text);
  font-size: clamp(1.75rem, 5.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.hero-description {
  max-width: var(--max-width-text);
  margin: 0 auto;

  color: var(--color-hero-muted);
  font-size: 1.0625rem;
  line-height: 1.9;
}


/* ========================================
   4. Main content
   ======================================== */

.main-content {
  flex: 1;

  width: 100%;
  max-width: var(--max-width-site);
  margin-inline: auto;
  padding: 2.5rem var(--container-padding) 3rem;

  background-color: var(--color-main-bg);
}

.services-section {
  width: 100%;
}

.services-heading {
  margin-bottom: 1.5rem;

  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}


/* ========================================
   5. Service directory grid
   ======================================== */

.service-grid {
  display: grid;

  /*
   * One column when space is limited.
   * Additional columns appear automatically
   * when the available width allows them.
   */
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 16em), 1fr)
  );

  gap: var(--card-gap);
  align-items: stretch;
}


/* ========================================
   6. Service cards
   ======================================== */

.service-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  min-width: 0;
  height: 100%;
  overflow: hidden;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);

  background-color: var(--color-card-bg);
  color: var(--color-text);

  text-decoration: none;

  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.service-card:hover {
  background-color: var(--color-card-hover);
  border-color: #cc7006;
  outline: 3px solid var(--color-focus);
}

.service-card:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

.service-image {
  display: block;

  width: 100%;
  height: auto;
  max-height: 18rem;

  object-fit: contain;
  object-position: center;

  /*
   * Keep each image's natural aspect ratio.
   * Use a fixed aspect ratio only if you want
   * every service image to have equal height.
   */
}

.service-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;

  padding: 1.25rem;
}

.service-card h3 {
  margin-bottom: 1rem;

  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
}

.service-card-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.25rem;

  color: var(--color-accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}


/* ========================================
   7. Footer
   ======================================== */

.site-footer {
  width: 100%;
  padding: 1.5rem var(--container-padding);

  background-color: var(--color-main-bg);
  border-top: 1px solid var(--color-border);

  color: var(--color-text-muted);
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.7;
}

.site-footer p {
  max-width: none;
  margin: 0;
}


/* ========================================
   8. Wider mobile screens and tablets
   ======================================== */

/*
 * Increase spacing on larger phone screens
 * and tablets. The layout remains mobile-first.
 */
@media (min-width: 40em) {
  :root {
    --container-padding: 2rem;
    --card-gap: 1.25rem;
  }

  .hero-layout {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }

  .main-content {
    padding-top: 3rem;
    padding-bottom: 3.5rem;
  }

  .services-heading {
    margin-bottom: 2rem;
    font-size: 1.75rem;
  }

  .service-card-content {
    padding: 1.5rem;
  }
}


/* ========================================
   9. Landscape phones and tablets
   ======================================== */

/*
 * In landscape, place the logo and hero text
 * side by side when there is enough space.
 *
 * The service grid already adapts automatically
 * to the available width.
 */
@media (orientation: landscape) and (min-width: 35em) {
  .hero-layout {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .hero-image-wrapper {
    flex: 0 1 44%;
    width: 44%;
  }

  .hero-logo {
    max-width: 100%;
  }

  .hero-content {
    flex: 1 1 56%;
    width: 56%;
    text-align: left;
  }

  .hero h1 {
    margin-inline: 0;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  }

  .hero-description {
    margin-inline: 0;
  }
}


/* ========================================
   10. Short landscape screens
   ======================================== */

/*
 * Reduce vertical spacing on short landscape
 * screens so the hero does not dominate the view.
 */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-layout {
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
  }

  .hero-logo {
    max-height: 10rem;
  }

  .hero-kicker {
    margin-bottom: 0.4rem;
  }

  .hero h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
  }

  .hero-description {
    font-size: 1rem;
    line-height: 1.7;
  }

  .main-content {
    padding-top: 1.75rem;
    padding-bottom: 2rem;
  }

  .services-heading {
    margin-bottom: 1rem;
  }
}


/* ========================================
   11. Reduced motion accessibility
   ======================================== */

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}