/*
Theme Name: Code Trading
Description: Custom theme for codeco.com.jo, based on the Code Trading static site design.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: codeco
*/

:root {
  --orange: #f45a1c;
  --orange-deep: #d94810;
  --ink: #141517;
  --ink-soft: #27292c;
  --paper: #f5f5f2;
  --white: #fff;
  --line: rgba(20, 21, 23, .15);
  --shell: min(1180px, calc(100vw - 48px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.section { padding: 120px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; background: var(--white); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: fixed; inset: 0 0 auto; z-index: 50; color: var(--white); transition: background .25s, color .25s, box-shadow .25s; }
.site-header.scrolled { color: var(--ink); background: rgba(255,255,255,.96); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(14px); }
.nav-wrap { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { width: 190px; position: relative; z-index: 3; }
.brand img { width: 100%; height: auto; filter: brightness(0) invert(1); transition: filter .25s; }
.site-header.scrolled .brand img { filter: none; }
.site-nav { display: flex; align-items: center; gap: 34px; font-size: .9rem; font-weight: 700; letter-spacing: .02em; }
.site-nav a { text-decoration: none; }
.site-nav a:not(.nav-cta):hover { color: var(--orange); }
.nav-cta { padding: 11px 18px; border: 1px solid currentColor; }
.nav-cta:hover { background: var(--orange); border-color: var(--orange); color: var(--white); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 9px; color: inherit; }
.nav-toggle span:not(.sr-only) { display: block; height: 2px; margin: 7px 0; background: currentColor; transition: transform .2s; }

.hero { min-height: 820px; height: 100svh; position: relative; display: flex; align-items: center; color: var(--white); overflow: hidden; background: var(--ink); }
.hero-media { position: absolute; inset: 0; background: url('assets/operations-center.jpg') center / cover no-repeat; transform: scale(1.02); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,12,.92) 0%, rgba(10,11,12,.7) 48%, rgba(10,11,12,.24) 80%), linear-gradient(0deg, rgba(10,11,12,.45), transparent 48%); }
.hero-content { position: relative; z-index: 1; padding-top: 70px; }
.eyebrow { margin: 0 0 20px; text-transform: uppercase; letter-spacing: .17em; font-size: .74rem; font-weight: 800; color: var(--orange); }
.eyebrow.dark { color: var(--orange-deep); }
.hero h1 { max-width: 910px; margin: 0; font-size: clamp(4rem, 7.7vw, 7rem); line-height: .94; letter-spacing: -.055em; font-weight: 700; }
.hero h1 span { color: var(--orange); }
.hero-copy { max-width: 660px; margin: 30px 0 0; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.55; color: rgba(255,255,255,.84); }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 40px; }
.button { display: inline-flex; min-height: 54px; align-items: center; justify-content: center; padding: 12px 24px; text-decoration: none; font-size: .9rem; font-weight: 800; letter-spacing: .02em; }
.button-primary { background: var(--orange); color: var(--white); }
.button-primary:hover { background: var(--orange-deep); }
.text-link { text-underline-offset: 6px; font-size: .9rem; font-weight: 700; }
.hero-foot { position: absolute; z-index: 1; bottom: 28px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 18px; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .15em; font-size: .69rem; font-weight: 800; }
.hero-foot p { margin: 0; }
.hero-foot span { height: 1px; background: rgba(255,255,255,.25); }

.intro { background: var(--white); }
.intro-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 8vw; align-items: start; }
h2 { margin: 0; font-size: clamp(2.7rem, 5vw, 5rem); line-height: 1.02; letter-spacing: -.045em; }
.intro-copy { padding-top: 40px; border-top: 1px solid var(--line); }
.intro-copy p { margin: 0 0 24px; font-size: 1.14rem; color: #515357; }

.solutions { background: var(--paper); }
.section-heading { display: grid; grid-template-columns: 1.25fr .75fr; gap: 9vw; align-items: end; margin-bottom: 60px; }
.section-heading > p { max-width: 470px; margin: 0 0 5px; color: #5b5d60; font-size: 1.05rem; }
.solution-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.solution-card { min-height: 330px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; background: var(--white); border-top: 4px solid var(--orange); grid-column: span 4; }
.solution-card.feature { min-height: 500px; grid-column: span 7; background: var(--orange); color: var(--white); border: 0; }
.solution-card.dark-card { color: var(--white); background: var(--ink); border-top-color: var(--white); }
.solution-card.image-card { position: relative; overflow: hidden; grid-column: span 5; padding: 0; color: var(--white); border: 0; }
.image-card img { width: 100%; height: 100%; object-fit: cover; }
.image-card::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.88)); }
.image-card-copy { position: absolute; z-index: 1; inset: auto 30px 28px; }
.card-index { font-size: .72rem; letter-spacing: .15em; font-weight: 800; opacity: .64; }
.solution-card h3 { margin: 18px 0 14px; font-size: clamp(1.6rem, 3vw, 2.8rem); line-height: 1.05; letter-spacing: -.035em; }
.solution-card:not(.feature) h3 { font-size: 1.8rem; }
.solution-card p { max-width: 480px; margin: 0; color: inherit; opacity: .78; }
.solution-card ul { margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.3); }
.solution-card li { padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.3); }

.project-band { color: var(--white); background: var(--ink); overflow: hidden; }
.project-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 7vw; align-items: center; }
.project-image { position: relative; }
.project-image::before { content: ''; position: absolute; width: 190px; height: 190px; left: -54px; top: -54px; border: 42px solid var(--orange); border-radius: 50%; opacity: .9; }
.project-image img { position: relative; width: 100%; min-height: 560px; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.project-copy > p:not(.eyebrow) { color: rgba(255,255,255,.68); font-size: 1.06rem; }
.project-copy h2 { max-width: 600px; }
.project-points { margin-top: 46px; border-top: 1px solid rgba(255,255,255,.2); }
.project-points p { display: grid; grid-template-columns: 120px 1fr; gap: 20px; margin: 0; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.2); }
.project-points strong { color: var(--orange); }
.project-points span { color: rgba(255,255,255,.7); }

.approach { background: var(--white); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.steps li { min-height: 280px; padding: 28px 28px 10px 0; border-right: 1px solid var(--line); }
.steps li + li { padding-left: 28px; }
.steps li:last-child { border-right: 0; }
.steps span { color: var(--orange-deep); font-size: .76rem; font-weight: 800; letter-spacing: .12em; }
.steps h3 { margin: 62px 0 14px; font-size: 1.7rem; letter-spacing: -.03em; }
.steps p { margin: 0; color: #65676b; }

.ecosystem { background: var(--paper); text-align: center; }
.ecosystem h2 { max-width: 800px; margin: 0 auto; }
.logo-strip { margin-top: 60px; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--white); border: 1px solid var(--line); }
.logo-strip img { width: 100%; aspect-ratio: 2 / 1.05; object-fit: contain; padding: 18px; border-right: 1px solid var(--line); filter: grayscale(1); transition: filter .2s, opacity .2s; }
.logo-strip img:last-child { border-right: 0; }
.logo-strip img:hover { filter: none; }

.contact { position: relative; color: var(--white); background: var(--orange); overflow: hidden; }
.contact-pattern { position: absolute; inset: 0 0 0 55%; opacity: .17; background: url('assets/brand-pattern.png') center / cover no-repeat; mix-blend-mode: multiply; }
.contact-grid { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 9vw; align-items: end; }
.contact .eyebrow { color: var(--ink); }
.contact h2 { max-width: 760px; }
.contact-action { border-top: 1px solid rgba(255,255,255,.45); padding-top: 30px; }
.contact-action > p { margin: 0 0 28px; font-size: 1.08rem; }
.button-light { color: var(--ink); background: var(--white); }
.button-light:hover { background: var(--ink); color: var(--white); }
.contact-action .location { margin-top: 28px; font-size: .86rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }

.site-footer { color: rgba(255,255,255,.58); background: #0e0f10; padding: 54px 0; font-size: .82rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 30px; }
.footer-brand { width: 150px; }
.footer-brand img { width: 100%; }
.footer-grid p { margin: 0; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 900px) {
  :root { --shell: min(100% - 32px, 720px); }
  .section { padding: 84px 0; }
  .nav-wrap { min-height: 72px; }
  .brand { width: 154px; }
  .nav-toggle { display: block; position: relative; z-index: 3; }
  .site-nav { position: fixed; inset: 0; padding: 120px 30px 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; font-size: 1.4rem; background: var(--ink); color: var(--white); transform: translateX(100%); transition: transform .25s; }
  .site-nav.open { transform: none; }
  .site-header.menu-open { color: var(--white); }
  .site-header.menu-open .brand img { filter: brightness(0) invert(1); }
  .site-header.menu-open .nav-toggle span:nth-child(2) { transform: translateY(4.5px) rotate(45deg); }
  .site-header.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }
  .hero { min-height: 720px; }
  .hero h1 { font-size: clamp(3.2rem, 13vw, 5.8rem); }
  .hero-content { padding-top: 54px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .hero-foot { bottom: 20px; gap: 10px; }
  .intro-grid, .section-heading, .project-grid, .contact-grid { grid-template-columns: 1fr; }
  .intro-grid, .section-heading { gap: 44px; }
  .intro-copy { padding-top: 28px; }
  .solution-card, .solution-card.feature, .solution-card.image-card { grid-column: span 12; min-height: 330px; }
  .solution-card.feature { min-height: 480px; }
  .project-grid { gap: 64px; }
  .project-image img { min-height: 420px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2) { border-right: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps li:nth-child(3) { padding-left: 0; }
  .logo-strip { grid-template-columns: repeat(3, 1fr); }
  .logo-strip img:nth-child(3) { border-right: 0; }
  .logo-strip img:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .contact-grid { gap: 50px; }
  .footer-grid { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 560px) {
  .section { padding: 70px 0; }
  .hero { min-height: 680px; }
  .hero-copy { font-size: 1.05rem; }
  .hero-foot { display: none; }
  h2 { font-size: 2.55rem; }
  .solution-card { padding: 24px; }
  .project-image img { min-height: 320px; }
  .project-points p { grid-template-columns: 1fr; gap: 2px; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li, .steps li:nth-child(3) { min-height: auto; padding: 24px 0 30px; border-right: 0; border-top: 1px solid var(--line); }
  .steps h3 { margin-top: 24px; }
  .logo-strip { grid-template-columns: 1fr 1fr; }
  .logo-strip img, .logo-strip img:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .logo-strip img:nth-child(even) { border-right: 0; }
  .logo-strip img:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---- WordPress additions ---- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.page-hero { padding: 190px 0 80px; background: var(--ink); color: var(--white); }
.page-hero h1 { margin: 0; font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -.04em; }
.page-body { padding: 80px 0 120px; }
.page-body .entry-content > * { max-width: 100%; }
.page-body .entry-content p { font-size: 1.05rem; }
.page-body .alignfull { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
