/*
 * Peepal Tech Solutions — front end and editor styles.
 * Ported from the approved Next.js site; selectors keep the same specificity so rules resolve identically.
 */

:root {
  --paper: var(--wp--preset--color--paper, #f7f4ef);
  --paper-2: var(--wp--preset--color--paper-2, #efeae3);
  --white: var(--wp--preset--color--white, #fffcf8);
  --navy: var(--wp--preset--color--navy, #173a60);
  --navy-deep: var(--wp--preset--color--navy-deep, #102844);
  --charcoal: var(--wp--preset--color--charcoal, #303840);
  --ink: var(--wp--preset--color--ink, #353635);
  --orange: var(--wp--preset--color--orange, #f26522);
  --atess: var(--wp--preset--color--atess, #d52229);
  --muted: var(--wp--preset--color--muted, #5c656c);
  --on-orange: var(--wp--preset--color--on-orange, #1a120c);
  --line: rgba(48, 56, 64, 0.16);
  --line-strong: rgba(48, 56, 64, 0.28);
  --header: 96px;
  --max: 1280px;
  --admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; border: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
.screen-reader-text:not(:focus) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}
section, .site-main [id] { scroll-margin-top: calc(var(--header) + var(--admin-bar)); }
.eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--navy);
}
h1, h2, h3, h4 { margin: 0; }
h1, h2, h3 { font-weight: 560; letter-spacing: -0.03em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 4.2vw, 3.7rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 3.4vw, 3.15rem); line-height: 1.12; }
h3 { font-size: 1.35rem; line-height: 1.25; }

/* Buttons */
.wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; }
body .wp-block-button__link,
body .wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--orange);
  color: var(--on-orange);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
}
body .wp-block-button__link:hover { filter: brightness(0.96); color: var(--on-orange); }
body .is-style-ghost .wp-block-button__link {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}
body .is-style-header .wp-block-button__link,
body .is-style-header .wp-block-button__link:hover { background: var(--orange); color: #fff; }
body .is-style-atess .wp-block-button__link { background: #fff; color: var(--atess); }
body .is-style-atess .wp-block-button__link:hover { filter: none; background: #fff6f5; color: var(--atess); }
body .is-style-text-link .wp-block-button__link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font-size: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}
body .is-style-text-link .wp-block-button__link:hover { filter: none; color: var(--orange); }

/* Header */
.site-header-part {
  position: sticky;
  top: var(--admin-bar);
  z-index: 40;
}
.site-header {
  position: relative;
  height: var(--header);
  display: flex;
  align-items: center;
  background: rgba(247, 244, 239, 0.88);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
}
.site-header.is-stuck {
  background: var(--paper);
  box-shadow: inset 0 -1px 0 var(--line);
}
.header-inner {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
body .logo { display: flex; line-height: 0; margin: 0; }
body .logo a { display: block; }
body .logo img { height: 68px; width: auto; max-width: 100%; }
.header-menu { display: flex; align-items: center; gap: 22px; margin-left: auto; }
body .primary-nav,
body .primary-nav .wp-block-navigation__container { gap: 22px; flex-wrap: nowrap; }
body .primary-nav .wp-block-navigation-item__content {
  padding: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--charcoal);
}
body .primary-nav .wp-block-navigation-item__content:hover { color: var(--navy); }
.menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line-strong);
  min-height: 42px;
  padding: 0 14px;
  font-size: 13.333px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
body .hero-bg {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}
body .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 22, 38, 0.55) 0%, rgba(12, 22, 38, 0.22) 42%, rgba(12, 22, 38, 0) 68%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  align-self: stretch;
  margin-inline: auto;
  padding: 88px 0;
  text-align: left;
}
.hero-copy .eyebrow, .hero-copy h1 { color: #fff; max-width: 740px; }
.hero-copy p { margin: 22px 0 0; max-width: 38rem; color: rgba(255, 255, 255, 0.92); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
body .hero .is-style-ghost .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, 0.75); background: transparent; }
.credibility {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14.5px;
  letter-spacing: 0.01em;
}
.credibility a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* About */
.about, .expertise, .approach, .portfolio, .contact {
  padding: 96px 0;
}
.about { border-top: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
body .about-photo {
  margin: 0;
  min-height: 420px;
  height: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
body .about-photo img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.about-copy p { margin: 18px 0 0; max-width: 40rem; }
body .callouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: callout;
}
.callouts li {
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.callouts li::before {
  counter-increment: callout;
  content: counter(callout, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--orange);
  font-weight: 700;
}

/* Icons (set by the icon-* class on a card; files in assets/icons) */
.service::before, .step::before, .why-card::before {
  content: "";
  display: block;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.icon-engineering { --icon: url("../icons/engineering.svg"); }
.icon-industrial { --icon: url("../icons/industrial.svg"); }
.icon-equipment { --icon: url("../icons/equipment.svg"); }
.icon-storage { --icon: url("../icons/storage.svg"); }
.icon-solar { --icon: url("../icons/solar.svg"); }
.icon-ev { --icon: url("../icons/ev.svg"); }
.icon-understand { --icon: url("../icons/understand.svg"); }
.icon-consult { --icon: url("../icons/consult.svg"); }
.icon-develop { --icon: url("../icons/develop.svg"); }
.icon-select { --icon: url("../icons/select.svg"); }
.icon-evaluate { --icon: url("../icons/evaluate.svg"); }
.icon-support { --icon: url("../icons/support.svg"); }
.icon-product { --icon: url("../icons/product.svg"); }
.icon-arrow { --icon: url("../icons/arrow.svg"); }
.icon-future { --icon: url("../icons/future.svg"); }
.icon-ethics { --icon: url("../icons/ethics.svg"); }
.icon-relationship { --icon: url("../icons/relationship.svg"); }

/* Expertise */
.expertise { background: var(--white); border-top: 1px solid var(--line); }
.section-intro { max-width: 40rem; margin-top: 16px; }
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 48px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  min-height: 220px;
}
.service:hover { background: var(--paper); }
.service::before { width: 40px; height: 40px; margin-bottom: 22px; color: var(--orange); }
.service h3 { font-size: 1.15rem; margin-bottom: 10px; }
.service p { margin: 0; color: var(--charcoal); font-size: 15.5px; }

/* ATESS */
.atess-intro {
  background: var(--atess);
  color: #fff;
  padding: 96px 0;
}
body .atess-mark {
  width: min(320px, 100%);
  margin: 0;
}
body .atess-mark img {
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}
.atess-intro h2, .atess-intro .eyebrow { color: #f7f4ef; }
.atess-intro .eyebrow { color: rgba(255, 255, 255, 0.82); }
.atess-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.atess-intro p { margin: 18px 0 0; max-width: 38rem; color: rgba(247, 244, 239, 0.88); }
.atess-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 28px; }
body .atess-intro .is-style-text-link .wp-block-button__link { color: #fff; }

.atess-group { margin-top: 56px; }
.atess-group-head { max-width: 40rem; margin-bottom: 22px; }
.atess-group > .atess-group-head h3 { text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; font-weight: 750; }
.atess-group-head p { margin: 8px 0 0; color: var(--muted); }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  min-height: 100%;
}
.card:hover { border-color: rgba(242, 101, 34, 0.55); }
.slot {
  aspect-ratio: 1 / 1;
  height: auto;
  background: #050505;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h4 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; font-weight: 650; color: var(--ink); line-height: 1.65; }
.card-body p { margin: 0; font-size: 15px; color: var(--charcoal); }
.card-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; }
.card-actions a, .card-actions button {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.note { margin: 28px 0 0; max-width: 46rem; color: var(--muted); font-size: 15px; }

/* Approach */
.approach { border-top: 1px solid var(--line); }
.steps {
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.step {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 28px 22px 26px;
  min-height: 220px;
}
.step:hover { border-color: rgba(242, 101, 34, 0.55); }
.step::before { width: 48px; height: 48px; margin-bottom: 22px; color: var(--orange); }
.steps h3 { font-size: 1.2rem; margin-bottom: 8px; }
.steps p { margin: 0; font-size: 15px; color: var(--charcoal); }

/* Founder spotlight */
.founder { background: var(--orange); color: var(--on-orange); padding: 136px 0 144px; }
.eyebrow.founder-label { color: var(--on-orange); }
.founder h2 { color: #fff; }
.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}
.founder-feature { margin: 56px 0 0; }
body .founder-photo { margin: 0; aspect-ratio: 1 / 1; overflow: hidden; background: #c9551c; }
body .founder-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
body .founder-quote {
  margin: 0;
  padding: 0 0 0 clamp(20px, 3vw, 40px);
  border: 0;
  border-left: 3px solid #fff;
}
body .founder-quote p {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(1.55rem, 2.5vw, 2.3rem);
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: #fff;
}
body .founder-quote cite { display: none; }
.founder-foot {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(26, 18, 12, 0.28);
}
.founder-person { display: grid; gap: 6px; align-content: start; }
.founder-person p { margin: 0; }
.founder-person .founder-name { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; color: #fff; }
.founder-person .founder-role {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-orange);
}
.founder-person .founder-meta { font-size: 15px; color: var(--on-orange); }
.founder-copy p { margin: 0; max-width: 36rem; font-size: 1.15rem; line-height: 1.65; color: var(--on-orange); }
.founder-copy p + p { margin-top: 16px; }

/* Why */
.why { background: var(--white); border-top: 1px solid var(--line); padding: 120px 0 132px; }
.why h2 { margin-bottom: 28px; }
.why-viewport {
  width: 100%;
  overflow: hidden;
}
.why-track {
  display: flex;
  width: max-content;
}
.why-track.is-animated { animation: why-slide 36s linear infinite; }
.why-set { display: flex; gap: 16px; padding-right: 16px; }
.why-card {
  background: var(--orange);
  color: #fff;
  width: 320px;
  flex: 0 0 320px;
  min-height: 320px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
}
.why-card::before { width: 48px; height: 48px; color: #fff; }
.why-card h3 { margin: 0; color: #fff; font-size: 1.25rem; letter-spacing: -0.02em; font-weight: 600; }
@keyframes why-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Contact */
.contact { border-top: 1px solid var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  margin-top: 36px;
  align-items: stretch;
}
.panel {
  background: var(--navy);
  color: #f7f4ef;
  padding: 32px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.panel .panel-details { margin-top: auto; font-style: normal; }
.panel h2, .panel .eyebrow { color: #f7f4ef; }
.panel .eyebrow { color: #f3c3ad; }
.panel p { color: rgba(247, 244, 239, 0.88); }
.panel a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.panel .detail { margin: 0 0 14px; }
.panel .detail strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f3c3ad;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Footer */
.footer {
  background: var(--navy-deep);
  color: #f7f4ef;
  padding: 48px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.7fr 1fr;
  gap: 28px;
}
.footer-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
}
.footer .footer-label {
  margin: 0 0 12px;
  min-height: 1em;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(247, 244, 239, 0.62);
}
.footer-col.no-label { padding-top: 23px; }
body .footer-logo { margin: 0; }
body .footer-logo img { height: 76px; width: auto !important; }
.footer a { color: #f7f4ef; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
body .footer-nav,
body .footer-nav .wp-block-navigation__container {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
body .footer-nav .wp-block-navigation-item__content { padding: 0; line-height: 1.65; }
.footer p { margin: 8px 0; color: rgba(247, 244, 239, 0.82); font-size: 14.5px; }
.legal {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(247, 244, 239, 0.16);
  font-size: 13.5px;
  color: rgba(247, 244, 239, 0.72);
}

/* Simple pages (privacy policy etc.) */
.page-main { padding: 72px 0 96px; }
.prose > * + * { margin-top: 1em; }
.prose .wp-block-post-title { margin-bottom: 24px; }
.prose a { color: var(--navy); text-decoration: underline; }

/* Reveal on scroll (front end only; theme.js adds .js) */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Editor: show everything static and scrollable */
.editor-styles-wrapper .why-viewport { overflow-x: auto; }
.editor-styles-wrapper .site-header-part { position: relative; top: 0; }
.editor-styles-wrapper .editor-post-title {
  width: min(var(--max), calc(100% - 48px));
  margin: 32px auto 24px;
  font-size: 1.6rem;
}
.editor-styles-wrapper .block-editor-block-list__layout .hero-bg { position: absolute; inset: 0; margin: 0; }
.editor-styles-wrapper .hero-bg img { height: 100% !important; }
.editor-styles-wrapper .block-editor-block-list__layout .hero-copy { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .service, .card, .wp-block-button__link { transition: none; }
  .why-track.is-animated { animation: none; }
  .why-viewport { overflow-x: auto; }
  .why-set[aria-hidden="true"] { display: none; }
}

@media (max-width: 1024px) {
  .about-grid, .atess-layout, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .service-grid, .cards { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .founder-grid { grid-template-columns: 1fr; gap: 56px; }
  body .founder-photo { aspect-ratio: 16 / 10; }
}

@media (max-width: 800px) {
  .header-menu { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  body .logo img { height: 52px; }
  .site-header.is-open .header-menu {
    display: grid;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header);
    margin: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
    gap: 4px;
  }
  .site-header.is-open { background: var(--paper); }
  body .site-header.is-open .primary-nav,
  body .site-header.is-open .primary-nav .wp-block-navigation__container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    align-items: stretch;
    gap: 4px;
  }
  body .site-header.is-open .primary-nav .wp-block-navigation-item { display: block; width: 100%; }
  body .site-header.is-open .primary-nav .wp-block-navigation-item__content,
  body .site-header.is-open .header-cta .wp-block-button__link {
    display: block;
    width: 100%;
    min-height: 0;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.65;
    letter-spacing: normal;
    color: var(--navy);
    filter: none;
  }
  body .site-header.is-open .header-cta .wp-block-button__link { line-height: normal; }
  body .site-header.is-open .header-cta,
  body .site-header.is-open .header-cta .wp-block-button { display: block; width: 100%; }
}

@media (max-width: 700px) {
  .wrap, .header-inner { width: min(var(--max), calc(100% - 32px)); }
  .about, .expertise, .approach, .portfolio, .contact, .atess-intro { padding: 72px 0; }
  .why { padding: 88px 0 96px; }
  .founder { padding: 88px 0 96px; }
  .founder-feature { margin-top: 44px; }
  .founder-foot { grid-template-columns: 1fr; gap: 24px; margin-top: 40px; padding-top: 24px; }
  .why-card { min-height: 260px; width: 280px; flex-basis: 280px; }
  .founder-grid { gap: 40px; }
  body .founder-photo { aspect-ratio: 4 / 3; }
  .hero { padding-bottom: 64px; }
  .hero::after { background: linear-gradient(180deg, rgba(23, 58, 96, 0.72) 0%, rgba(23, 58, 96, 0.6) 55%, rgba(23, 58, 96, 0.78) 100%); }
  body .callouts, .service-grid, .cards, .steps, .footer-grid {
    grid-template-columns: 1fr;
  }
  .service-grid { border-left: 0; }
  .service { border-left: 1px solid var(--line); }
}
