/*
Theme Name: Code Trick and Tips
Theme URI: https://codetrickandtips.com
Author: Code Trick and Tips
Author URI: https://codetrickandtips.com
Description: A modern, single-page WordPress theme for Code Trick and Tips — a coding tips, tricks, and tutorials brand. Includes Home, About, Services, Blog, and Contact sections with smooth scrolling navigation, a dark developer-inspired design, and a WordPress-ready blog loop.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: code-trick-and-tips
Tags: one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================= */
/*  RESET / BASE                 */
/* ============================= */
html {
  scroll-behavior: smooth;
}

/* ============================= */
/*  DESIGN TOKENS                */
/* ============================= */
#ctt-root {
  --bg: #0b0e14;
  --bg-elevated: #11151f;
  --bg-card: #141924;
  --border: #232a3a;
  --text: #e7ecf5;
  --text-muted: #8b93a7;
  --teal: #5eead4;
  --amber: #ffb454;
  --purple: #c894ff;
  --danger: #ff8080;
  --radius: 10px;
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --maxw: 1180px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

#ctt-root, #ctt-root * , #ctt-root *::before, #ctt-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#ctt-root img { max-width: 100%; display: block; }
#ctt-root a { color: inherit; text-decoration: none; }
#ctt-root ul { list-style: none; }
#ctt-root button { font-family: inherit; cursor: pointer; }

#ctt-root .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

#ctt-root .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--teal);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
#ctt-root .eyebrow::before { content: '//'; color: var(--text-muted); }

#ctt-root h1, #ctt-root h2, #ctt-root h3, #ctt-root h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

#ctt-root section { padding: 96px 0; border-bottom: 1px solid var(--border); }
#ctt-root section:last-of-type { border-bottom: none; }

#ctt-root .section-head { max-width: 640px; margin-bottom: 48px; }
#ctt-root .section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 12px; }
#ctt-root .section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* reveal-on-scroll */
#ctt-root .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
#ctt-root .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================= */
/*  HEADER / NAVBAR              */
/* ============================= */
#ctt-root .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
#ctt-root .site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
#ctt-root .logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 2px;
}
#ctt-root .logo .bracket { color: var(--teal); }
#ctt-root .logo .dot { color: var(--amber); }

#ctt-root .nav-links {
  display: flex;
  gap: 36px;
}
#ctt-root .nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}
#ctt-root .nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--teal);
  transition: width .25s ease;
}
#ctt-root .nav-links a:hover,
#ctt-root .nav-links a.is-active { color: var(--text); }
#ctt-root .nav-links a:hover::after,
#ctt-root .nav-links a.is-active::after { width: 100%; }

#ctt-root .nav-cta {
  display: none;
}
@media (min-width: 900px) {
  #ctt-root .nav-cta { display: inline-flex; }
}

#ctt-root .menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
#ctt-root .menu-toggle span {
  width: 22px; height: 2px; background: var(--text);
  transition: transform .25s ease, opacity .25s ease;
}
#ctt-root .menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#ctt-root .menu-toggle.is-open span:nth-child(2) { opacity: 0; }
#ctt-root .menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 900px) {
  #ctt-root .menu-toggle { display: none; }
}
@media (max-width: 899px) {
  #ctt-root .nav-links {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  #ctt-root .nav-links.is-open { max-height: 320px; }
  #ctt-root .nav-links a { padding: 16px 24px; width: 100%; border-bottom: 1px solid var(--border); }
  #ctt-root .nav-links a::after { display: none; }
}

/* ============================= */
/*  BUTTONS                      */
/* ============================= */
#ctt-root .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
#ctt-root .btn-primary {
  background: var(--teal);
  color: #08221d;
}
#ctt-root .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(94, 234, 212, 0.45);
}
#ctt-root .btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
#ctt-root .btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ============================= */
/*  HERO                         */
/* ============================= */
#ctt-root .hero { padding: 88px 0 100px; border-bottom: 1px solid var(--border); position: relative; }
#ctt-root .hero__grid {
  display: grid;
  gap: 56px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) {
  #ctt-root .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
}
#ctt-root .hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin-bottom: 18px;
}
#ctt-root .hero h1 .accent { color: var(--teal); }
#ctt-root .hero p.lead {
  color: var(--text-muted);
  font-size: 1.12rem;
  max-width: 520px;
  margin-bottom: 32px;
}
#ctt-root .hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }
#ctt-root .hero__stats { display: flex; gap: 32px; flex-wrap: wrap; }
#ctt-root .hero__stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
}
#ctt-root .hero__stats div span { font-size: 0.85rem; color: var(--text-muted); }

/* mock code editor */
#ctt-root .editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
#ctt-root .editor__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
#ctt-root .editor__dot { width: 11px; height: 11px; border-radius: 50%; }
#ctt-root .editor__dot.r { background: #ff6159; }
#ctt-root .editor__dot.y { background: #ffbd2e; }
#ctt-root .editor__dot.g { background: #28c840; }
#ctt-root .editor__filename {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
#ctt-root .editor__body {
  display: grid;
  grid-template-columns: 34px 1fr;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  padding: 20px 0;
  min-height: 260px;
}
#ctt-root .editor__lines {
  color: #3a4258;
  text-align: right;
  padding-right: 12px;
  user-select: none;
  line-height: 1.75;
}
#ctt-root .editor__code {
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  padding-right: 20px;
}
#ctt-root .editor__code .kw { color: var(--purple); }
#ctt-root .editor__code .str { color: var(--teal); }
#ctt-root .editor__code .cmt { color: var(--text-muted); }
#ctt-root .editor__code .fn { color: var(--amber); }
#ctt-root .caret {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--teal);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================= */
/*  ABOUT                        */
/* ============================= */
#ctt-root .about__grid {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  #ctt-root .about__grid { grid-template-columns: 1.4fr 1fr; }
}
#ctt-root .about__copy h3 {
  font-size: 1.25rem;
  margin: 28px 0 10px;
  color: var(--text);
}
#ctt-root .about__copy p { color: var(--text-muted); margin-bottom: 14px; }
#ctt-root .about__copy strong { color: var(--text); }

#ctt-root .about__panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  height: fit-content;
}
#ctt-root .about__panel h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber);
  margin-bottom: 18px;
}
#ctt-root .about__panel ul li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
#ctt-root .about__panel ul li:last-child { border-bottom: none; }
#ctt-root .about__panel ul li .ico { color: var(--teal); flex-shrink: 0; }

/* ============================= */
/*  SERVICES                     */
/* ============================= */
#ctt-root .services__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
#ctt-root .service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .25s ease, border-color .25s ease;
}
#ctt-root .service-card:hover {
  transform: translateY(-6px);
  border-color: var(--teal);
}
#ctt-root .service-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(94, 234, 212, 0.1);
  color: var(--teal);
  margin-bottom: 18px;
}
#ctt-root .service-card:nth-child(2) .service-card__icon { background: rgba(255, 180, 84, 0.1); color: var(--amber); }
#ctt-root .service-card:nth-child(3) .service-card__icon { background: rgba(255, 128, 128, 0.1); color: var(--danger); }
#ctt-root .service-card:nth-child(4) .service-card__icon { background: rgba(200, 148, 255, 0.1); color: var(--purple); }
#ctt-root .service-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
#ctt-root .service-card p { color: var(--text-muted); font-size: 0.92rem; }

/* ============================= */
/*  BLOG                         */
/* ============================= */
#ctt-root .blog__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
#ctt-root .blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, border-color .25s ease;
}
#ctt-root .blog-card:hover { transform: translateY(-6px); border-color: var(--purple); }
#ctt-root .blog-card__thumb {
  height: 168px;
  position: relative;
  overflow: hidden;
}
#ctt-root .blog-card__thumb svg,
#ctt-root .blog-card__thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
#ctt-root .blog-card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
#ctt-root .blog-card__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#ctt-root .blog-card__body h3 { font-size: 1.08rem; }
#ctt-root .blog-card__body p { color: var(--text-muted); font-size: 0.92rem; flex: 1; }
#ctt-root .blog-card__meta { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
#ctt-root .read-more {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  transition: gap .2s ease;
}
#ctt-root .read-more:hover { gap: 10px; }

/* ============================= */
/*  CONTACT                      */
/* ============================= */
#ctt-root .contact__grid {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  #ctt-root .contact__grid { grid-template-columns: 0.9fr 1.1fr; }
}
#ctt-root .contact__info p { color: var(--text-muted); margin-bottom: 24px; }
#ctt-root .contact__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
#ctt-root .contact__row .ico {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}
#ctt-root .contact__row a, #ctt-root .contact__row span { font-size: 0.95rem; }

#ctt-root .form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: grid;
  gap: 18px;
}
#ctt-root .field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
#ctt-root .field input,
#ctt-root .field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color .2s ease;
}
#ctt-root .field input:focus,
#ctt-root .field textarea:focus {
  outline: none;
  border-color: var(--teal);
}
#ctt-root .field textarea { resize: vertical; min-height: 120px; }
#ctt-root .form__msg {
  font-size: 0.88rem;
  color: var(--teal);
  display: none;
}
#ctt-root .form__msg.is-visible { display: block; }

/* ============================= */
/*  FOOTER                       */
/* ============================= */
#ctt-root .site-footer { padding: 56px 0 28px; }
#ctt-root .footer__grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
@media (min-width: 700px) {
  #ctt-root .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
#ctt-root .footer__brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 12px; max-width: 320px; }
#ctt-root .footer__col h4 { font-size: 0.9rem; margin-bottom: 14px; color: var(--text); }
#ctt-root .footer__col ul li { margin-bottom: 10px; }
#ctt-root .footer__col ul li a { color: var(--text-muted); font-size: 0.9rem; transition: color .2s ease; }
#ctt-root .footer__col ul li a:hover { color: var(--teal); }
#ctt-root .footer__social { display: flex; gap: 12px; }
#ctt-root .footer__social a {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: color .2s ease, border-color .2s ease;
}
#ctt-root .footer__social a:hover { color: var(--teal); border-color: var(--teal); }
#ctt-root .footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  #ctt-root * { animation: none !important; transition: none !important; }
}
