/*
Theme Name: Anish KS
Theme URI: https://www.anishks.com/
Author: Anish KS
Description: A lightweight personal publisher theme for AnishKS.com with dynamic blogging years, Projects management, and Latest Notes from WordPress posts.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: anishks
*/

:root {
  --aks-bg: #f7f8fb;
  --aks-surface: #ffffff;
  --aks-text: #101827;
  --aks-muted: #667085;
  --aks-line: #e8ecf2;
  --aks-accent: #ef4b4c;
  --aks-accent-dark: #d93f40;
  --aks-radius: 18px;
  --aks-shadow: 0 12px 30px rgba(16,24,39,.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--aks-bg);
  color: var(--aks-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.aks-container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.aks-header { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--aks-line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.aks-header-inner { display:flex; align-items:center; justify-content:space-between; min-height:76px; gap:28px; }
.aks-brand { font-weight:800; letter-spacing:.02em; font-size:1.35rem; }
.aks-brand small { display:block; font-size:.65rem; letter-spacing:.16em; color:var(--aks-muted); font-weight:600; margin-top:2px; }
.aks-nav ul { display:flex; gap:24px; list-style:none; margin:0; padding:0; flex-wrap:wrap; }
.aks-nav a { color:#344054; font-weight:600; font-size:.95rem; }
.aks-nav a:hover { color:var(--aks-accent); }

.aks-hero { padding:72px 0 44px; }
.aks-hero-grid { display:grid; grid-template-columns: 1.1fr .9fr; gap:56px; align-items:center; }
.aks-kicker { text-transform:uppercase; letter-spacing:.22em; font-size:.73rem; font-weight:800; color:var(--aks-muted); }
.aks-hero h1 { font-size:clamp(3.2rem, 8vw, 6.5rem); line-height:.95; margin:10px 0 18px; letter-spacing:-.05em; }
.aks-hero h1 span { color:var(--aks-accent); }
.aks-subtitle { font-size:clamp(1.25rem,2vw,1.8rem); margin:0 0 12px; }
.aks-lead { font-size:1.08rem; color:var(--aks-muted); max-width:640px; }
.aks-tags { display:flex; flex-wrap:wrap; gap:12px; margin:26px 0; }
.aks-tags span { font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:#344054; }
.aks-actions { display:flex; gap:14px; flex-wrap:wrap; }
.aks-btn { display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:0 22px; border-radius:10px; border:1px solid #d0d5dd; background:#fff; font-weight:700; }
.aks-btn-primary { background:#101827; color:#fff; border-color:#101827; }
.aks-btn:hover { transform:translateY(-1px); }
.aks-hero-visual { position:relative; min-height:420px; }
.aks-portrait-card { background:linear-gradient(160deg,#edf2f7,#ffffff); border-radius:28px; overflow:hidden; box-shadow:var(--aks-shadow); min-height:420px; display:flex; align-items:flex-end; justify-content:center; }
.aks-portrait-card img { width:100%; height:100%; object-fit:cover; }
.aks-handnote { position:absolute; right:-10px; top:26px; background:#fff; padding:14px 18px; border-radius:14px; box-shadow:var(--aks-shadow); transform:rotate(-3deg); font-family:Georgia,serif; font-style:italic; }

.aks-stats { margin-top:28px; }
.aks-stats-grid { background:#fff; border:1px solid var(--aks-line); border-radius:20px; display:grid; grid-template-columns:repeat(4,1fr); box-shadow:var(--aks-shadow); overflow:hidden; }
.aks-stat { padding:26px; border-right:1px solid var(--aks-line); }
.aks-stat:last-child { border-right:0; }
.aks-stat strong { display:block; font-size:2rem; line-height:1; }
.aks-stat span { display:block; font-weight:700; margin-top:8px; }
.aks-stat small { color:var(--aks-muted); }

.aks-section { padding:72px 0; }
.aks-section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:28px; }
.aks-section-head h2 { margin:6px 0 0; font-size:clamp(2rem,4vw,3.2rem); letter-spacing:-.03em; }
.aks-link { color:#175cd3; font-weight:700; }

.aks-project-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.aks-project-card { position:relative; background:#fff; border:1px solid var(--aks-line); border-radius:18px; padding:20px; box-shadow:var(--aks-shadow); min-height:250px; display:flex; flex-direction:column; justify-content:space-between; transition:.2s ease; }
.aks-project-card:hover { transform:translateY(-4px); }
.aks-project-icon { width:64px; height:64px; border-radius:16px; overflow:hidden; background:#f2f4f7; display:grid; place-items:center; margin-bottom:24px; }
.aks-project-icon img { width:100%; height:100%; object-fit:cover; }
.aks-project-card h3 { font-size:1.3rem; margin:0 0 8px; }
.aks-project-card p { color:var(--aks-muted); margin:0 0 18px; }
.aks-project-url { font-size:.9rem; color:#344054; font-weight:700; }

.aks-timeline { display:grid; grid-template-columns:repeat(6,1fr); gap:18px; position:relative; }
.aks-timeline:before { content:""; position:absolute; left:0; right:0; top:13px; height:2px; background:#d9e1ea; }
.aks-step { position:relative; padding-top:34px; }
.aks-step:before { content:""; width:12px; height:12px; border-radius:50%; background:var(--aks-accent); position:absolute; top:8px; left:0; box-shadow:0 0 0 5px var(--aks-bg); }
.aks-step strong { font-size:1.2rem; display:block; }
.aks-step span { font-weight:700; display:block; margin-top:4px; }
.aks-step small { color:var(--aks-muted); display:block; margin-top:6px; }

.aks-notes-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.aks-note-card { background:#fff; border:1px solid var(--aks-line); border-radius:18px; overflow:hidden; box-shadow:var(--aks-shadow); }
.aks-note-thumb { aspect-ratio:16/9; background:#eef2f6; overflow:hidden; }
.aks-note-thumb img { width:100%; height:100%; object-fit:cover; }
.aks-note-body { padding:20px; }
.aks-note-meta { color:var(--aks-muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }
.aks-note-card h3 { margin:8px 0 10px; font-size:1.28rem; line-height:1.3; }
.aks-note-card p { color:var(--aks-muted); margin:0 0 12px; }

.aks-cta { background:#152033; color:#fff; border-radius:22px; padding:30px; display:flex; justify-content:space-between; gap:24px; align-items:center; }
.aks-cta h3 { margin:0 0 6px; font-size:1.65rem; }
.aks-cta p { margin:0; color:#cfd8e6; }
.aks-cta form { display:flex; gap:10px; min-width:min(100%,440px); }
.aks-cta input { flex:1; min-width:0; border:0; border-radius:10px; padding:14px 16px; }
.aks-cta button { border:0; border-radius:10px; background:var(--aks-accent); color:#fff; padding:0 20px; font-weight:700; }

.aks-footer { background:#fff; border-top:1px solid var(--aks-line); margin-top:72px; }
.aks-footer-top { display:flex; justify-content:space-between; gap:30px; padding:30px 0; align-items:center; }
.aks-footer-bottom { border-top:1px solid var(--aks-line); padding:18px 0; color:var(--aks-muted); font-size:.9rem; display:flex; justify-content:space-between; gap:20px; }

.aks-page { padding:56px 0; }
.aks-content { background:#fff; border:1px solid var(--aks-line); border-radius:18px; padding:34px; box-shadow:var(--aks-shadow); }
.aks-content h1 { margin-top:0; }

@media (max-width: 980px) {
  .aks-hero-grid { grid-template-columns:1fr; }
  .aks-project-grid { grid-template-columns:repeat(2,1fr); }
  .aks-stats-grid { grid-template-columns:repeat(2,1fr); }
  .aks-stat:nth-child(2) { border-right:0; }
  .aks-stat:nth-child(-n+2) { border-bottom:1px solid var(--aks-line); }
  .aks-timeline { grid-template-columns:repeat(3,1fr); }
  .aks-timeline:before { display:none; }
  .aks-step:before { top:10px; }
  .aks-notes-grid { grid-template-columns:1fr; }
  .aks-cta { flex-direction:column; align-items:flex-start; }
}

@media (max-width: 720px) {
  .aks-container { width:min(100% - 28px,1180px); }
  .aks-header-inner { align-items:flex-start; padding:16px 0; flex-direction:column; }
  .aks-nav ul { gap:14px; }
  .aks-hero { padding-top:42px; }
  .aks-hero-visual { min-height:320px; }
  .aks-portrait-card { min-height:320px; }
  .aks-stats-grid { grid-template-columns:1fr; }
  .aks-stat { border-right:0; border-bottom:1px solid var(--aks-line); }
  .aks-stat:last-child { border-bottom:0; }
  .aks-project-grid { grid-template-columns:1fr; }
  .aks-timeline { grid-template-columns:1fr 1fr; }
  .aks-section { padding:54px 0; }
  .aks-section-head { align-items:flex-start; flex-direction:column; }
  .aks-cta form { width:100%; flex-direction:column; }
  .aks-cta button { min-height:44px; }
  .aks-footer-top,.aks-footer-bottom { flex-direction:column; align-items:flex-start; }
}

/* Native Site Identity logo: preserve its aspect ratio at every viewport size. */
.aks-header .aks-brand { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.aks-brand .custom-logo-link { display:inline-block; max-width:100%; vertical-align:middle; }
.aks-brand .custom-logo { width:auto; height:auto; max-width:min(320px, 100%); max-height:80px; object-fit:contain; }
.aks-back-to-top { position:fixed; right:24px; bottom:calc(24px + env(safe-area-inset-bottom, 0px)); width:48px; height:48px; border:2px solid #fff; border-radius:50%; background:#101827; color:#fff; font-size:26px; line-height:1; cursor:pointer; box-shadow:0 4px 16px rgba(16,24,39,.2); z-index:99; }
.aks-back-to-top[hidden] { display:none; }
.aks-back-to-top:hover { background:#344054; }
.aks-back-to-top:focus-visible, .aks-brand a:focus-visible { outline:3px solid #175cd3; outline-offset:4px; }
@media (max-width:720px) {
  .aks-brand .custom-logo { max-width:min(240px, 100%); max-height:60px; }
  .aks-back-to-top { right:16px; bottom:calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

/* 1.2: retain the original palette, cards and type scale. */
.aks-header .custom-logo { width:var(--aks-logo-desktop,180px); max-width:100%; max-height:var(--aks-logo-height,80px); }
.aks-header .aks-brand { flex-shrink:0; }
.aks-logo-center .aks-header-inner { flex-wrap:wrap; justify-content:center; padding:12px 0; }
.aks-logo-center .aks-brand { width:100%; text-align:center; }
.aks-logo-right .aks-brand { order:2; text-align:right; }
.aks-menu-toggle { display:none; }
.aks-handnote { top:auto; bottom:20px; left:20px; right:20px; max-height:75%; overflow:auto; transform:none; }
.aks-lead { white-space:pre-line; overflow-wrap:anywhere; }
.aks-tags span { display:inline-flex; align-items:center; gap:7px; text-transform:none; letter-spacing:0; }
.aks-icon { width:20px; height:20px; flex:none; vertical-align:middle; }
.aks-project-type { color:#175cd3; font-size:.72rem; letter-spacing:.08em; }
.aks-project-card { min-width:0; overflow-wrap:anywhere; }
.aks-carousel { position:relative; }
.aks-carousel.is-carousel .aks-project-grid { display:grid; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:calc((100% - (var(--aks-desktop-cards,4) - 1)*18px)/var(--aks-desktop-cards,4)); overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding:6px 0 12px; }
.aks-carousel.is-carousel .aks-project-grid::-webkit-scrollbar { display:none; }
.is-carousel .aks-project-card { scroll-snap-align:start; }
.aks-carousel.no-swipe .aks-project-grid { overflow-x:hidden; touch-action:pan-y; }
.aks-carousel-controls { display:flex; justify-content:center; align-items:center; gap:10px; margin-top:16px; flex-wrap:wrap; }
.aks-carousel-controls button { cursor:pointer; border:1px solid #d0d5dd; background:white; color:#101827; min-width:44px; min-height:44px; border-radius:50%; font-size:26px; }
.aks-carousel-controls button:disabled { opacity:.35; cursor:default; }
.aks-carousel-controls [hidden] { display:none; }
.aks-carousel-dots { display:flex; justify-content:center; flex-wrap:wrap; }
.aks-carousel-dots button { min-width:28px; min-height:28px; padding:8px; border:0; background:transparent; }
.aks-carousel-dots button:before { content:""; display:block; width:8px; height:8px; border-radius:50%; background:#ccd2dc; }
.aks-carousel-dots button[aria-current="true"]:before { background:#175cd3; }
.aks-carousel-controls .aks-pause { font-size:.85rem; border-radius:8px; padding:8px 12px; }
.aks-timeline { display:flex; overflow-x:auto; gap:18px; padding-bottom:12px; }
.aks-step { flex:1 0 160px; overflow-wrap:anywhere; border-top:2px solid #d9e1ea; margin-top:13px; padding-top:22px; }
.aks-timeline:before { display:none; }
.aks-step:before { top:-7px; }
.aks-milestone-image { width:56px; height:56px; object-fit:contain; border-radius:8px; margin-bottom:10px; }
.aks-achievement { background:#eef1f6; border-radius:0 0 12px 12px; padding:22px 12px 12px; }
.aks-achievement:before { background:#667085; }
.aks-social { display:flex; gap:14px; flex-wrap:wrap; }
.aks-social a { display:flex; align-items:center; gap:5px; font-size:.85rem; }
.aks-footer-bottom a { text-decoration:underline; }
:focus-visible { outline:3px solid #175cd3; outline-offset:3px; }
.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.admin-bar .aks-header { top:32px; }
@media(max-width:980px) { .aks-carousel.is-carousel .aks-project-grid { grid-auto-columns:calc((100% - 18px)/2); } }
@media(max-width:782px) { .admin-bar .aks-header { top:46px; } }
@media(max-width:720px) {
  .aks-header .aks-header-inner { position:relative; display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; justify-content:flex-start; min-height:64px; padding:8px 50px 8px 0; gap:0; }
  .aks-header .aks-brand { order:0; width:auto; max-width:100%; text-align:left; flex-shrink:1; }
  .aks-header .aks-brand small { display:none; }
  .aks-header .custom-logo { width:var(--aks-logo-mobile,155px); max-height:var(--aks-logo-height,80px); }
  .aks-logo-center .aks-header-inner { padding-left:50px; justify-content:center; }
  .aks-logo-center .aks-brand { text-align:center; }
  .aks-logo-right .aks-header-inner { justify-content:flex-end; }
  .aks-logo-right .aks-brand { text-align:right; }
  .aks-menu-toggle { position:absolute; right:0; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:8px; background:transparent; font-size:30px; color:#101827; cursor:pointer; }
  .aks-header .aks-nav { display:none; position:absolute; right:0; top:100%; width:min(340px,100%); max-height:70vh; overflow:auto; padding:20px; border:1px solid var(--aks-line); border-radius:0 0 14px 14px; background:white; box-shadow:var(--aks-shadow); }
  .aks-header .aks-nav.is-open { display:block; }
  .aks-header .aks-nav ul { display:flex; flex-direction:column; gap:0; }
  .aks-header .aks-nav a { display:block; padding:10px 8px; }
  .aks-header .aks-nav ul ul { padding-left:16px; }
  .aks-hero h1 { font-size:clamp(2.5rem,12vw,3.15rem); }
  .aks-tags { gap:12px 16px; }
  .aks-handnote { left:14px; right:14px; bottom:14px; font-size:.9rem; padding:10px 14px; }
  .aks-carousel.is-carousel { padding:0 26px; }
  .aks-carousel.is-carousel .aks-project-grid { grid-auto-columns:100%; }
  .aks-carousel .aks-prev,.aks-carousel .aks-next { position:absolute; top:40%; z-index:1; width:40px; min-width:40px; }
  .aks-carousel .aks-prev { left:-10px; } .aks-carousel .aks-next { right:-10px; }
  .aks-timeline { display:block; overflow:visible; padding-left:8px; }
  .aks-step { border-top:0; border-left:2px solid #d9e1ea; margin:0; padding:0 0 28px 26px; }
  .aks-step:before { left:-7px; top:8px; }
  .aks-achievement { padding-top:10px; margin-bottom:20px; }
}
@media(max-width:600px) { .admin-bar .aks-header { top:0; } }
@media(prefers-reduced-motion:reduce) { *, *:before, *:after { scroll-behavior:auto !important; transition:none !important; } }
