/* ApproachPage — philosophy, the eight-step process, and what clients should know. */
function ApproachPage({ onNav }) {
  const [openStep, setOpenStep] = React.useState(null);
  const [hoverTier, setHoverTier] = React.useState(null);
  const { Eyebrow, Divider } = window.DomumDesignSystem_84ba75;
  const { Photo, PageHeader, InquiryBand, TextureBand, Rule, SectionFrame, ScriptMark } = window;
  /* Touch devices fire mouseenter on tap, which would open the row and let the
     click handler immediately close it again. Hover-to-open is therefore only
     wired up where hover genuinely exists. */
  const canHover = typeof window.matchMedia === 'function'
    ? window.matchMedia('(hover: hover)').matches : true;

  const steps = [
    ['01', 'Discover', 'We begin by understanding how you live, what you love, what is not working, and what you want your home to become.', 'You feel heard before anyone proposes anything.'],
    ['02', 'Define', 'We evaluate the property, clarify the scope of work, discuss priorities, and establish an appropriate investment range.', 'You learn the real number early, not after design fees.'],
    ['03', 'Explore', 'We develop thoughtful options at different levels of scope so you can understand what each approach accomplishes.', 'You see what more investment actually buys you.'],
    ['04', 'Design', 'We refine the selected direction into a cohesive plan, including layouts, materials, fixtures, finishes, and architectural details.', 'You stop guessing how it will turn out.'],
    ['05', 'Propose', 'We prepare a formal scope and project proposal so you understand what is included and what the project requires.', 'You know exactly what you are approving.'],
    ['06', 'Prepare', 'We finalize selections, coordinate trades, order materials, and prepare the project for construction.', 'You avoid rushed decisions and change orders later.'],
    ['07', 'Build', 'We manage construction, coordinate subcontractors, communicate progress, and protect the larger design vision.', 'You keep your weekends and your sanity.'],
    ['08', 'Complete', 'We walk the finished project together, address remaining details, and hand the home back ready to be lived in.', 'You get a home that feels finished, not almost.'],
  ];

  const tiers = [
    ['Essential', 'Address the most important functional or aesthetic needs.'],
    ['Considered', 'Expand the scope to improve flow, materials, or long-term functionality.'],
    ['Transformative', 'Explore the larger potential of the property.'],
  ];

  const know = [
    ['We begin with the whole house.', 'Even when renovating a single room, we consider how it relates to the rest of the property: materials, architecture, circulation, sightlines, and future plans all matter.'],
    ['Budget is part of the design conversation.', 'Design decisions have financial consequences. Knowing the investment range early helps us recommend solutions that are realistic. A clear budget does not limit creativity; it helps direct it.'],
    ['We help prioritize where money matters most.', 'Not every upgrade carries the same value. Sometimes the right answer is a premium material. Sometimes it is keeping what already works and investing elsewhere.'],
    ['We consider both enjoyment and property value.', 'A home is first a place to live, and not every decision needs to produce a return. At the same time, real estate context matters, and we help you see the relationship.'],
    ['We respect the character of the home.', 'Renovation should not automatically mean replacement. We look for opportunities to retain what gives a home character while improving what no longer functions.'],
    ['We prefer decisions before demolition.', 'We finalize major materials, fixtures, and cabinetry before work begins, which reduces delays, rushed decisions, change orders, and surprises.'],
    ['We narrow choices rather than overwhelm.', 'Instead of dozens of unrelated options, we present a thoughtful selection that fits the design direction, budget, and architecture.'],
    ['Renovation can uncover the unexpected.', 'Homes sometimes hide conditions that cannot be known until walls, floors, or ceilings are opened. When it happens, we explain the options before moving forward.'],
  ];

  return (
    <div>
      <PageHeader
        align="center"
        video="./assets/hero-home.mp4" position="center 55%"
        eyebrow="Our Approach"
        title="From first conversation to finished home."
        lede="Most of what goes wrong in a renovation is decided before anyone picks up a tool. Our process front-loads the hard questions, so you are not making expensive choices under pressure with a crew waiting." />

      {/* Philosophy */}

      {/* Process */}
      <section style={{ position: 'relative', borderBottom: '1px solid var(--border-strong)', padding: 'var(--space-9) var(--gutter)' }}>
        <div style={{ maxWidth: 'var(--page-max)', margin: '0 auto' }}>
          <div style={{ textAlign: 'center', marginBottom: 'var(--space-8)' }}>
            <Eyebrow>Our Process</Eyebrow>
          </div>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(260px, 1fr))', gap: '44px 56px' }}>
            {steps.map(([n, t, d, win]) => {
              const open = openStep === n;
              return (
                <div key={n}
                  onMouseEnter={canHover ? (() => setOpenStep(n)) : undefined}
                  onMouseLeave={canHover ? (() => setOpenStep((c) => (c === n ? null : c))) : undefined}
                  onFocus={canHover ? (() => setOpenStep(n)) : undefined}
                  onBlur={canHover ? (() => setOpenStep((c) => (c === n ? null : c))) : undefined}
                  onClick={() => setOpenStep((c) => (c === n ? null : n))}
                  tabIndex={0} aria-expanded={open}
                  style={{ borderTop: '1px solid var(--border-strong)', paddingTop: '22px', cursor: 'pointer', outline: 'none' }}>
                  <div style={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: '16px' }}>
                    <div style={{ minWidth: 0 }}>
                      <span style={{ fontFamily: 'var(--font-sans)', fontSize: '11px', fontWeight: 600, letterSpacing: '.2em', color: open ? 'var(--oxblood)' : 'var(--text-muted)', transition: 'color var(--dur-base) var(--ease-quiet)' }}>{n}</span>
                      <h3 style={{
                        fontSize: '1.6rem', margin: '10px 0 0',
                        color: open ? 'var(--oxblood)' : 'var(--text-primary)',
                        transition: 'color var(--dur-base) var(--ease-quiet)',
                      }}>{t}</h3>
                    </div>
                    {/* Expand affordance — touch only. Desktop opens on hover, so the
                       chevron is redundant there; on touch it is the only signal. */}
                    <span aria-hidden data-process-chev style={{
                      flexShrink: 0, width: '30px', height: '30px',
                      display: canHover ? 'none' : 'flex', alignItems: 'center', justifyContent: 'center',
                      border: `1px solid ${open ? 'var(--oxblood)' : 'var(--border-strong)'}`,
                      transition: 'border-color var(--dur-base) var(--ease-quiet)',
                    }}>
                      <span style={{
                        width: '7px', height: '7px', display: 'block',
                        borderRight: `1px solid ${open ? 'var(--oxblood)' : 'var(--walnut)'}`,
                        borderBottom: `1px solid ${open ? 'var(--oxblood)' : 'var(--walnut)'}`,
                        transform: open ? 'translateY(-2px) rotate(225deg)' : 'translateY(-2px) rotate(45deg)',
                        transition: 'transform 440ms var(--ease-quiet), border-color var(--dur-base) var(--ease-quiet)',
                      }}></span>
                    </span>
                  </div>
                  <div style={{
                    display: 'grid', gridTemplateRows: open ? '1fr' : '0fr',
                    transition: 'grid-template-rows 440ms var(--ease-quiet)',
                  }}>
                    <div style={{ overflow: 'hidden' }}>
                      <p style={{
                        color: 'var(--text-secondary)', fontSize: 'var(--fs-small)', margin: '12px 0 14px', lineHeight: 1.65,
                        opacity: open ? 1 : 0, transform: open ? 'none' : 'translateY(-6px)',
                        transition: 'opacity 380ms var(--ease-quiet), transform 380ms var(--ease-quiet)',
                      }}>{d}</p>
                      <p style={{
                        fontFamily: 'var(--font-display)', fontSize: '1.15rem', color: 'var(--oxblood)', margin: 0, lineHeight: 1.45,
                        opacity: open ? 1 : 0, transform: open ? 'none' : 'translateY(-6px)',
                        transition: 'opacity 380ms var(--ease-quiet) 80ms, transform 380ms var(--ease-quiet) 80ms',
                      }}>{win}</p>
                    </div>
                  </div>
                </div>
              );
            })}
          </div>
        </div>
      </section>

      {/* Scaled options */}
      <section style={{ padding: 'var(--space-10) var(--gutter)', maxWidth: 'var(--page-max)', margin: '0 auto' }}>
        <div style={{ maxWidth: '680px', marginBottom: 'var(--space-8)' }}>
          <Eyebrow>Options &amp; Direction</Eyebrow>
          <h2 style={{ fontSize: 'var(--fs-h2)', margin: '16px 0 18px' }}>There is rarely only one way to improve a home.</h2>
          <p style={{ fontSize: 'var(--fs-body)', color: 'var(--text-secondary)', margin: 0, lineHeight: 1.7 }}>
            Rather than immediately committing to a single solution, we may develop a small number of scaled
            approaches based on your priorities and budget. The objective is not to encourage a larger
            project; it is to help you make an informed decision about the right project.
          </p>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))', gap: '24px', marginInline: 'calc(var(--space-4) * -1)' }}>
          {tiers.map(([t, d], i) => (
            <div key={t}
              onMouseEnter={canHover ? (() => setHoverTier(i)) : undefined}
              onMouseLeave={() => setHoverTier(null)}
              style={{
                borderTop: `1px solid ${hoverTier === i || i === 1 ? '#4A2426' : 'rgba(43,33,27,.24)'}`,
                backgroundColor: hoverTier === i ? '#E9E0D3' : 'transparent',
                padding: 'var(--space-6) var(--space-4) var(--space-5)',
              }}>
              <p style={{ fontFamily: 'var(--font-sans)', fontSize: '11px', fontWeight: 500, letterSpacing: '.22em', textTransform: 'uppercase', color: hoverTier === i ? '#4A2426' : 'rgba(43,33,27,.55)', margin: 0 }}>{`Level ${i + 1}`}</p>
              <h3 style={{ fontSize: '1.4rem', fontWeight: 400, margin: '16px 0 10px' }}>{t}</h3>
              <p style={{ fontSize: 'var(--fs-small)', color: 'var(--text-secondary)', margin: 0, lineHeight: 1.65 }}>{d}</p>
            </div>
          ))}
        </div>
      </section>

      {/* What clients should know */}
      <section style={{ padding: '0 var(--gutter) var(--space-10)', maxWidth: 'var(--page-max)', margin: '0 auto' }}>
        <div style={{
          position: 'relative', maxWidth: 'var(--page-max)', margin: '0 auto',
          background: 'var(--oxblood)', color: 'var(--ivory)', padding: 'var(--space-8) clamp(20px, 5vw, 64px)',
          border: '1px solid var(--cream-48)',
        }}>
          <SectionFrame inset={8} />
          <div style={{ position: 'relative', textAlign: 'center', marginBottom: 'var(--space-8)' }}>
            <span style={{ display: 'block', fontFamily: 'var(--font-sans)', fontSize: 'var(--fs-eyebrow)', fontWeight: 'var(--w-semi)', letterSpacing: 'var(--tracking-eyebrow)', textTransform: 'uppercase', color: 'var(--cream-70)' }}>What Clients Should Know</span>
            <h2 style={{ fontSize: 'var(--fs-h2)', margin: '14px 0 0', color: 'var(--ivory)' }}>How we think about the work</h2>
          </div>
          <div style={{ position: 'relative', display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: 'var(--space-7) var(--space-8)' }}>
            {know.map(([t, d], i) => (
              <div key={t} style={{ borderTop: '1px solid var(--cream-22)', paddingTop: '20px' }}>
                <span style={{ display: 'block', fontFamily: 'var(--font-sans)', fontSize: '10px', fontWeight: 600, letterSpacing: '.22em', color: 'var(--white-oak)', marginBottom: '10px' }}>{String(i + 1).padStart(2, '0')}</span>
                <h3 style={{ fontSize: '1.2rem', margin: '0 0 14px', color: 'var(--ivory)', lineHeight: 1.35 }}>{t}</h3>
                <p style={{ fontSize: 'var(--fs-small)', color: 'var(--cream-88)', margin: 0, lineHeight: 1.8 }}>{d}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* Collaboration + difference */}
      <section style={{ padding: 'var(--space-9) var(--gutter)', maxWidth: 'var(--page-max)', margin: '0 auto' }}>
        <div style={{ display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)', gap: 'var(--space-8)', alignItems: 'stretch' }}>

          <div style={{ display: 'flex', flexDirection: 'column', position: 'relative', padding: 'var(--space-7)' }}>
            <SectionFrame inset={0} gap={5} tone="light" />
            <Eyebrow>What We Ask From Our Clients</Eyebrow>
            <h2 style={{ fontSize: 'clamp(1.6rem, 2.4vw, 2rem)', fontWeight: 400, margin: '16px 0 var(--space-6)', lineHeight: 1.22 }}>
              The best projects are collaborative.
            </h2>
            <ol style={{ listStyle: 'none', margin: 0, padding: 0 }}>
              {[
                'Communicate openly about priorities and budget.',
                'Provide timely feedback.',
                'Make decisions within agreed timelines.',
                'Ask questions when something is unclear.',
                'Trust the process once a direction has been established.',
              ].map((x, i) => (
                <li key={x} style={{
                  display: 'grid', gridTemplateColumns: '34px 1fr', gap: '16px', alignItems: 'baseline',
                  borderTop: '1px solid var(--line-soft)', padding: '18px 0',
                }}>
                  <span style={{ fontFamily: 'var(--font-sans)', fontSize: '11px', fontWeight: 600, letterSpacing: '.18em', color: 'var(--oxblood)' }}>{`0${i + 1}`}</span>
                  <span style={{ fontSize: 'var(--fs-body)', color: 'var(--text-secondary)', lineHeight: 1.6 }}>{x}</span>
                </li>
              ))}
            </ol>
            <p style={{
              fontFamily: 'var(--font-display)', fontSize: 'clamp(1.05rem, 1.5vw, 1.25rem)',
              color: 'var(--oxblood)', margin: 'auto 0 0', paddingTop: 'var(--space-6)', lineHeight: 1.6,
            }}>
              In return: guidance, transparency, thoughtful recommendations, and stewardship of the larger vision.
            </p>
          </div>

          <div style={{ position: 'relative', padding: 'var(--space-7)' }}>
            <SectionFrame inset={0} gap={5} tone="light" />
            <Eyebrow>The Spring Street Difference</Eyebrow>
            <p style={{ color: 'var(--text-secondary)', fontSize: 'var(--fs-small)', margin: '16px 0 var(--space-6)', lineHeight: 1.7, maxWidth: '46ch' }}>
              Most renovation decisions sit at the intersection of several questions.
            </p>
            <div>
              {[
                'Is it beautiful?',
                'Does it function well?',
                'Can it be built properly?',
                'Is it worth the cost?',
                'Does it make sense for this particular home?',
              ].map((q) => (
                <p key={q} style={{
                  fontFamily: 'var(--font-display)', fontSize: 'clamp(1.15rem, 1.8vw, 1.45rem)',
                  color: 'var(--oxblood)', margin: 0, lineHeight: 1.35,
                  borderTop: '1px solid var(--border-strong)', padding: '18px 0',
                }}>{q}</p>
              ))}
            </div>
            <p style={{
              color: 'var(--text-secondary)', fontSize: 'var(--fs-small)', lineHeight: 1.75,
              borderTop: '1px solid var(--border-strong)', margin: 0, paddingTop: 'var(--space-6)',
            }}>
              Our process is designed to consider all five. That is where design, construction, and real
              estate come together, and that is the perspective we bring to every project.
            </p>
          </div>

        </div>
      </section>

      <InquiryBand eyebrow="Step One" title="Every project begins with a conversation." />
    </div>
  );
}
window.ApproachPage = ApproachPage;
