/*
Theme Name: Himas Rafeek
Theme URI: https://himasrafeek.com
Author: Himas Rafeek
Author URI: https://himasrafeek.com
Description: A clean, simple, and fast personal theme for Himas Rafeek — software engineer, graphic designer, and creator helping people grow online with AI, prompts, and digital products.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: himasrafeek
Tags: personal, portfolio, blog, clean, minimal, one-column, custom-menu, featured-images, threaded-comments
*/

/* ---------------------------------------------------------------------------
   Design tokens
--------------------------------------------------------------------------- */
:root {
  --hr-bg: #ffffff;
  --hr-bg-soft: #f6f7f9;
  --hr-text: #16181d;
  --hr-muted: #5b6470;
  --hr-border: #e7e9ee;
  --hr-accent: #2f6bff;
  --hr-accent-dark: #1f4fd6;
  --hr-radius: 14px;
  --hr-radius-sm: 10px;
  --hr-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --hr-max: 1080px;
  --hr-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --hr-space: clamp(3.5rem, 8vw, 6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --hr-bg: #0e1116;
    --hr-bg-soft: #161a21;
    --hr-text: #eef1f6;
    --hr-muted: #9aa4b2;
    --hr-border: #242a33;
    --hr-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--hr-font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--hr-text);
  background: var(--hr-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--hr-accent); text-decoration: none; }
a:hover { color: var(--hr-accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

.hr-container { width: 100%; max-width: var(--hr-max); margin: 0 auto; padding: 0 1.25rem; }

.hr-muted { color: var(--hr-muted); }

/* Buttons */
.hr-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.35rem;
  font-weight: 600; font-size: .98rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.hr-btn:hover { text-decoration: none; transform: translateY(-1px); }
.hr-btn-primary { background: var(--hr-accent); color: #fff; }
.hr-btn-primary:hover { background: var(--hr-accent-dark); color: #fff; }
.hr-btn-ghost { background: transparent; color: var(--hr-text); border-color: var(--hr-border); }
.hr-btn-ghost:hover { border-color: var(--hr-muted); color: var(--hr-text); }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.hr-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--hr-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hr-border);
}
.hr-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 68px;
}
.hr-brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; color: var(--hr-text); }
.hr-brand:hover { text-decoration: none; }
.hr-brand span { color: var(--hr-accent); }

.hr-nav { display: flex; align-items: center; gap: 1.6rem; }
.hr-menu { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.hr-menu a { color: var(--hr-muted); font-weight: 500; font-size: .96rem; }
.hr-menu a:hover, .hr-menu .current-menu-item > a { color: var(--hr-text); text-decoration: none; }

.hr-nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: .4rem;
  color: var(--hr-text);
}
.hr-nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 720px) {
  .hr-nav-toggle { display: inline-flex; }
  .hr-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--hr-bg); border-bottom: 1px solid var(--hr-border);
    padding: .5rem 1.25rem 1.25rem;
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .hr-nav.is-open { max-height: 80vh; }
  .hr-menu { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .hr-menu a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--hr-border); }
  .hr-nav .hr-btn { margin-top: .9rem; justify-content: center; }
}

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */
.hr-hero { padding: var(--hr-space) 0 calc(var(--hr-space) * .7); }
.hr-hero-eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--hr-accent);
  background: color-mix(in srgb, var(--hr-accent) 12%, transparent);
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.3rem;
}
.hr-hero h1 { max-width: 24ch; }
@media (min-width: 560px) { .hr-hero h1 { white-space: nowrap; } }
.hr-hero-lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--hr-muted); max-width: 54ch; margin-bottom: 2rem; }
.hr-hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------------------------------------------------------------------------
   Sections
--------------------------------------------------------------------------- */
.hr-section { padding: var(--hr-space) 0; }
.hr-section-alt { background: var(--hr-bg-soft); }
.hr-section-head { max-width: 60ch; margin-bottom: 2.6rem; }
.hr-section-head .hr-kicker {
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--hr-accent); margin-bottom: .6rem; display: block;
}

/* Card grid */
.hr-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.hr-card {
  background: var(--hr-bg); border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius); padding: 1.6rem;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.hr-card:hover { transform: translateY(-3px); box-shadow: var(--hr-shadow); border-color: transparent; }
.hr-card-icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--hr-radius-sm); margin-bottom: 1rem;
  background: color-mix(in srgb, var(--hr-accent) 12%, transparent);
  color: var(--hr-accent); font-size: 1.3rem;
}
.hr-card h3 { margin-bottom: .4rem; }
.hr-card p { color: var(--hr-muted); font-size: .96rem; margin: 0; }

/* About */
.hr-about { display: grid; grid-template-columns: 1fr; gap: 2.4rem; align-items: center; }
@media (min-width: 820px) { .hr-about { grid-template-columns: 1.3fr .9fr; } }
.hr-about-photo {
  border-radius: var(--hr-radius); box-shadow: var(--hr-shadow); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--hr-bg-soft);
}
.hr-about-photo img { width: 100%; height: 100%; object-fit: cover; }
.hr-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.6rem; }
.hr-stat strong { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.hr-stat span { color: var(--hr-muted); font-size: .9rem; }

/* CTA band */
.hr-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--hr-accent), var(--hr-accent-dark));
  color: #fff; border-radius: var(--hr-radius); padding: clamp(2.5rem, 6vw, 4rem);
}
.hr-cta h2 { color: #fff; }
.hr-cta p { color: rgba(255, 255, 255, .85); max-width: 48ch; margin: 0 auto 1.8rem; }
.hr-cta .hr-btn-primary { background: #fff; color: var(--hr-accent-dark); }
.hr-cta .hr-btn-primary:hover { background: #f0f3ff; }

/* ---------------------------------------------------------------------------
   Blog / posts
--------------------------------------------------------------------------- */
.hr-posts { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.hr-post-card {
  border: 1px solid var(--hr-border); border-radius: var(--hr-radius); overflow: hidden;
  background: var(--hr-bg); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .2s ease;
}
.hr-post-card:hover { transform: translateY(-3px); box-shadow: var(--hr-shadow); }
.hr-post-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--hr-bg-soft); }
.hr-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hr-post-body { padding: 1.35rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.hr-post-meta { font-size: .82rem; color: var(--hr-muted); margin-bottom: .5rem; }
.hr-post-body h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.hr-post-body h3 a { color: var(--hr-text); }
.hr-post-body h3 a:hover { color: var(--hr-accent); text-decoration: none; }
.hr-post-excerpt { color: var(--hr-muted); font-size: .95rem; flex: 1; }
.hr-read-more { font-weight: 600; font-size: .92rem; margin-top: .9rem; }

/* Single / page article */
.hr-article { max-width: 720px; margin: 0 auto; padding: var(--hr-space) 0; }
.hr-article-header { margin-bottom: 2rem; }
.hr-article-header h1 { margin-bottom: .6rem; }
.hr-article-feature { border-radius: var(--hr-radius); overflow: hidden; margin: 1.6rem 0 2.4rem; }
.hr-content { font-size: 1.08rem; }
.hr-content h2 { margin-top: 2rem; }
.hr-content h3 { margin-top: 1.6rem; }
.hr-content img { border-radius: var(--hr-radius-sm); margin: 1.6rem 0; }
.hr-content blockquote {
  margin: 1.6rem 0; padding: .4rem 0 .4rem 1.4rem;
  border-left: 3px solid var(--hr-accent); color: var(--hr-muted); font-style: italic;
}
.hr-content pre {
  background: var(--hr-bg-soft); padding: 1.1rem 1.25rem; border-radius: var(--hr-radius-sm);
  overflow-x: auto; border: 1px solid var(--hr-border);
}
.hr-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.hr-content :not(pre) > code { background: var(--hr-bg-soft); padding: .12em .4em; border-radius: 6px; }

.hr-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.hr-tags a {
  font-size: .85rem; color: var(--hr-muted); background: var(--hr-bg-soft);
  border: 1px solid var(--hr-border); padding: .3rem .75rem; border-radius: 999px;
}
.hr-tags a:hover { text-decoration: none; color: var(--hr-text); border-color: var(--hr-muted); }

/* Pagination */
.hr-pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 3rem; }
.hr-pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .6rem;
  border: 1px solid var(--hr-border); border-radius: var(--hr-radius-sm);
  color: var(--hr-text); font-weight: 500;
}
.hr-pagination .page-numbers:hover { border-color: var(--hr-muted); text-decoration: none; }
.hr-pagination .page-numbers.current { background: var(--hr-accent); color: #fff; border-color: var(--hr-accent); }

/* Page title (archive/blog banner) */
.hr-page-banner { padding: var(--hr-space) 0 calc(var(--hr-space) * .4); }
.hr-page-banner h1 { margin-bottom: .4rem; }

/* Comments */
.hr-comments { max-width: 720px; margin: 0 auto; padding-bottom: var(--hr-space); }
.hr-comments ol { list-style: none; padding: 0; }
.hr-comments .comment-body { border: 1px solid var(--hr-border); border-radius: var(--hr-radius-sm); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.hr-comments .comment-author { font-weight: 600; }
.hr-comments .comment-metadata { font-size: .82rem; color: var(--hr-muted); }
.hr-comments input[type="text"], .hr-comments input[type="email"], .hr-comments input[type="url"], .hr-comments textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius-sm); background: var(--hr-bg); color: var(--hr-text); font: inherit;
  margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.hr-footer { border-top: 1px solid var(--hr-border); padding: 3rem 0; margin-top: var(--hr-space); }
.hr-footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.hr-footer-brand { font-weight: 700; letter-spacing: -.02em; }
.hr-social { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.hr-social a { color: var(--hr-muted); }
.hr-social a:hover { color: var(--hr-accent); }
.hr-social svg { width: 22px; height: 22px; }
.hr-footer-copy { color: var(--hr-muted); font-size: .88rem; width: 100%; margin-top: 1rem; }

/* ---------------------------------------------------------------------------
   Contact form
--------------------------------------------------------------------------- */
.hr-contact-form { max-width: 720px; margin: 2.5rem auto 0; }
.hr-contact-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.hr-contact-form input[type="text"],
.hr-contact-form input[type="email"],
.hr-contact-form input[type="number"],
.hr-contact-form textarea {
  width: 100%; padding: .75rem .9rem; font: inherit;
  color: var(--hr-text); background: var(--hr-bg);
  border: 1px solid var(--hr-border); border-radius: var(--hr-radius-sm);
  margin-bottom: 1.1rem; transition: border-color .15s ease, box-shadow .15s ease;
}
.hr-contact-form input:focus, .hr-contact-form textarea:focus {
  outline: none; border-color: var(--hr-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hr-accent) 20%, transparent);
}
.hr-contact-form textarea { resize: vertical; min-height: 150px; }
.hr-field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .hr-field-row { grid-template-columns: 1fr 1fr; } }

/* Honeypot — visually hidden but present for bots. */
.hr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Form notices */
.hr-notice { padding: .9rem 1.1rem; border-radius: var(--hr-radius-sm); margin-bottom: 1.5rem; font-size: .96rem; }
.hr-notice-ok { color: #15803d; background: color-mix(in srgb, #16a34a 14%, transparent); border: 1px solid color-mix(in srgb, #16a34a 40%, transparent); }
.hr-notice-err { color: #b91c1c; background: color-mix(in srgb, #dc2626 12%, transparent); border: 1px solid color-mix(in srgb, #dc2626 40%, transparent); }

/* Utilities */
.hr-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: absolute; left: -999px; top: 0; background: var(--hr-accent); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; border-radius: 8px; }
