/* ==========================================================================
   Diamond Edge Pools — stylesheet
   All colours, fonts and spacing are custom properties. Never hardcode a
   hex value outside :root.
   ========================================================================== */

:root {
  /* Colour tokens */
  --navy:  #2B294D;
  --blush: #ECDAD9;
  --aqua:  #4FB3BF;
  --teal:  #2E7D87;
  --white: #FFFFFF;
  --ink:   #1C1B33;

  /* Fonts */
  --font-heading: 'Julius Sans One', sans-serif;
  --font-accent:  'Glass Antiqua', cursive;
  --font-body:    'Jost', sans-serif;

  /* Layout */
  --container-width: 1280px;
  --container-padding: 1.5rem;

  /* Hero background photo. Swap the url() to layer in a different photo,
     e.g. --hero-image: url('/assets/hero-photo.jpg');
     The navy-to-teal gradient stays layered on top as a translucent overlay. */
  --hero-image: url('/assets/hero-pool-deck.jpg');

  /* Depth, derived from the brand tokens rather than a new hex value */
  --shadow-sm: 0 4px 14px color-mix(in srgb, var(--navy) 16%, transparent);
  --shadow-md: 0 14px 34px color-mix(in srgb, var(--navy) 22%, transparent);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body, h1, h2, h3, p, figure, blockquote, ul, ol {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

ul { list-style: none; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.25;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--aqua);
  color: var(--navy);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

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

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
}

.section-heading--light h2 { color: var(--white); }

.rule {
  display: block;
  width: 64px;
  height: 2px;
  background: var(--aqua);
  margin: 1rem auto 0;
}

/* ==========================================================================
   Signature motif: the corner cut
   ========================================================================== */

.cut     { clip-path: polygon(0 0, 100% 0, 100% 80%, 86% 100%, 0 100%); }
.cut-btn { clip-path: polygon(0 0, 100% 0, 100% 62%, 88% 100%, 0 100%); }
.cut-lg  { clip-path: polygon(0 0, 100% 0, 100% 90%, 94% 100%, 0 100%); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 1.75rem;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--aqua);
  color: var(--navy);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--teal);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--white);
  color: var(--navy);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 88px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-family: var(--font-heading);
  color: var(--white);
  letter-spacing: 0.12em;
  font-size: 1rem;
  white-space: nowrap;
}

.wordmark-mono { color: var(--aqua); }
.wordmark-sep { color: var(--aqua); }

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blush);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--aqua);
}

.header-cta { flex-shrink: 0; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
}

.mobile-nav {
  display: none;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav ul {
  padding: 1rem var(--container-padding) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blush);
}

.mobile-cta {
  display: inline-flex;
  margin-top: 0.5rem;
}

.site-header.is-open .mobile-nav { display: block; }

@media (max-width: 900px) {
  .site-nav, .header-cta { display: none; }
  .menu-toggle { display: flex; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background-image:
    linear-gradient(120deg, rgba(43, 41, 77, 0.94) 0%, rgba(46, 125, 135, 0.88) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding-block: clamp(4rem, 10vw, 7rem);
}

.hero-content {
  max-width: 640px;
  /* Guarantees legibility over --hero-image regardless of how bright any
     given photo is where the lighter right-hand side of the overlay sits. */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--blush);
  max-width: 34em;
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.hero-phone {
  /* Forces its own line within the wrapping flex row, so it always sits
     under the heavier, left-hand side of the overlay rather than trailing
     off to the right of the buttons into the lighter, photo-revealing zone. */
  flex-basis: 100%;
  margin-top: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--aqua);
  border-bottom: 1px solid transparent;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease;
}

.hero-phone:hover,
.hero-phone:focus-visible {
  border-color: var(--aqua);
}

/* ==========================================================================
   Services
   ========================================================================== */

.services {
  background:
    radial-gradient(color-mix(in srgb, var(--navy) 8%, transparent) 1px, transparent 1px)
    0 0 / 24px 24px,
    var(--white);
  padding-block: clamp(4rem, 8vw, 6rem);
}

.services-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 3rem;
  align-items: stretch;
}

.services-image {
  box-shadow: var(--shadow-md);
}

.services-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.service-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid rgba(43, 41, 77, 0.12);
}

.service-row:first-child { padding-top: 0; }
.service-row:last-child { border-bottom: none; padding-bottom: 0; }

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--aqua);
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--aqua) 40%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--aqua) 8%, transparent);
}

.service-icon svg { width: 26px; height: 26px; }

.service-row h3 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.service-row p {
  color: var(--ink);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .services-layout { grid-template-columns: 1fr; }
  .services-image { max-height: 320px; }
}

/* ==========================================================================
   Process
   ========================================================================== */

.process {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding-block: clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}

.process-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--aqua);
  stroke-width: 1.5;
  opacity: 0.08;
  pointer-events: none;
}

.process .container {
  position: relative;
}

.process-list {
  max-width: 620px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.process-step {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding-block: 2rem;
  border-bottom: 1px solid rgba(236, 218, 217, 0.15);
}

.process-step:first-child { padding-top: 0; }
.process-step:last-child { border-bottom: none; padding-bottom: 0; }

.step-number {
  flex-shrink: 0;
  width: 2.4ch;
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--aqua);
}

.process-step h3 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.process-step p {
  color: var(--blush);
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .process-step { gap: 1.25rem; }
}

/* ==========================================================================
   About / trust points
   ========================================================================== */

.about {
  background: var(--blush);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.trust-point {
  background: var(--white);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.trust-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 1px solid color-mix(in srgb, var(--navy) 30%, transparent);
  border-radius: 50%;
  color: var(--navy);
}

.trust-icon svg { width: 28px; height: 28px; }

.trust-icon--stat {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.trust-point h3 {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery {
  background:
    radial-gradient(color-mix(in srgb, var(--navy) 8%, transparent) 1px, transparent 1px)
    0 0 / 24px 24px,
    var(--white);
  padding-block: clamp(4rem, 8vw, 6rem);
}

.gallery-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-grid-small {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  background: var(--white);
  border: 1px solid rgba(43, 41, 77, 0.12);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.gallery-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.gallery-photo--small {
  aspect-ratio: 4 / 3;
}

.gallery-item figcaption {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--navy);
}

@media (max-width: 560px) {
  .gallery-grid-small { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  background: var(--navy);
  color: var(--white);
  padding-block: clamp(4rem, 8vw, 6rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3rem;
  align-items: start;
}

.contact-prompt {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-width: 16ch;
  margin-bottom: 2rem;
}

.contact-details li {
  padding-block: 0.5rem;
  font-size: 1.05rem;
  color: var(--blush);
}

.contact-details a {
  transition: color 0.2s ease;
}

.contact-details a:hover,
.contact-details a:focus-visible {
  color: var(--aqua);
}

.contact-form-panel {
  background: var(--navy);
  border: 1px solid rgba(236, 218, 217, 0.3);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field--full { width: 100%; }

.form-field label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blush);
  margin-bottom: 0.5rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(236, 218, 217, 0.3);
  color: var(--white);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-field select {
  color: var(--white);
}

.form-field select option {
  color: var(--ink);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  display: block;
  color: var(--aqua);
  font-size: 0.85rem;
  margin-top: 0.4rem;
  min-height: 1.2em;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--aqua);
}

.form-submit {
  width: 100%;
  border: none;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--blush);
}

.form-status.is-success { color: var(--aqua); }
.form-status.is-error { color: var(--blush); }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--white);
  border-top: 2px solid var(--aqua);
  padding-block: 3rem 1.5rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.footer-brand p {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a,
.footer-social a {
  color: var(--blush);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-social a:hover,
.footer-social a:focus-visible {
  color: var(--aqua);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--blush);
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-copyright {
  text-align: center;
  font-size: 0.8rem;
  color: var(--blush);
  border-top: 1px solid rgba(236, 218, 217, 0.15);
  padding-top: 1.5rem;
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}
