/* =====================================================================
   WORLD CLOCK  -  /world-clock/world-clock.css
   Warm paper and serif type like the rest of the site; the clocks are
   little glowing 1980s digital displays (VFD), like the one on my
   home page. Daytime clocks glow amber, night-time clocks glow green.
   ===================================================================== */

:root {
    --wc-ink: #1b1a17;
    --wc-muted: #6b665c;
    --wc-faint: #9a948a;
    --wc-rule: #e4dfd5;
    --wc-paper: #ffffff;
    --wc-wash: #f7f4ee;
    --wc-accent: #8a2b1d;
    --wc-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", Times, serif;
    --wc-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --night: #8ff7df;
    --day: #ffc96b;
}

.site-title, .site-title:visited { color: inherit; text-decoration: none; }

main.wc-main {
    display: block;
    grid-template-columns: none;
    width: 100%;
    max-width: 1240px;
    margin: 6px auto 0;
    font-family: var(--wc-serif);
    color: var(--wc-ink);
}
main.wc-main p { margin: 0; font-size: 1rem; line-height: 1.5; color: inherit; }

/* ---------------------------------------------------------------------
   Heading, with New York in the corner
   --------------------------------------------------------------------- */

.wc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px 36px;
    padding: 10px 0 22px;
    border-bottom: 1px solid var(--wc-rule);
}
.wc-hero-text > * { animation: wc-in 0.7s cubic-bezier(.2, .7, .2, 1) both; }
.wc-hero-text > :nth-child(2) { animation-delay: 0.06s; }
.wc-hero-text > :nth-child(3) { animation-delay: 0.12s; }
@keyframes wc-in { from { opacity: 0; transform: translateX(-8px); } }

main.wc-main .wc-kicker {
    margin: 0 0 2px;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--wc-accent);
}
main.wc-main .wc-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-style: italic; line-height: 1.15; }
main.wc-main .wc-intro { max-width: 34em; margin-top: 8px; font-size: 0.95rem; color: var(--wc-muted); }

.wc-home { animation: wc-drop 0.8s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes wc-drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------- */

.wc-section { margin-top: 28px; }
.wc-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
main.wc-main .wc-label {
    margin: 0;
    font: normal 0.78rem var(--wc-serif);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--wc-muted);
}
main.wc-main .wc-note { font-size: 0.85rem; font-style: italic; color: var(--wc-faint); }

.wc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
#wc-mine:empty { display: none; }
main.wc-main .wc-empty { margin-top: 12px; font-size: 0.92rem; font-style: italic; color: var(--wc-faint); }

/* ---------------------------------------------------------------------
   One clock (the city cards)
   --------------------------------------------------------------------- */

.wc-clock {
    --glow: var(--night);
    --glow-rgb: 143, 247, 223;
    position: relative;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
.wc-clock.is-day { --glow: var(--day); --glow-rgb: 255, 201, 107; }

/* the paper card around a small clock */
.wc-grid .wc-clock {
    padding: 10px 10px 12px;
    border: 1px solid var(--wc-rule);
    border-radius: 14px;
    background: var(--wc-paper);
    box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04), 0 6px 18px rgba(40, 30, 10, 0.05);
    transition: transform 0.4s cubic-bezier(.2, .7, .2, 1), box-shadow 0.4s ease, border-color 0.3s ease;
    animation: wc-card-in 0.6s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}
@keyframes wc-card-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.wc-grid .wc-clock:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(40, 30, 10, 0.05), 0 16px 30px -10px rgba(40, 30, 10, 0.22); }
.wc-clock:focus-visible { outline: 2px solid var(--wc-accent); outline-offset: 3px; }

/* the plastic case */
.wc-case {
    padding: 6px;
    border-radius: 11px;
    background: linear-gradient(160deg, #403c36, #1d1b18 55%, #2b2824);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.45), 0 6px 14px -8px rgba(27, 26, 23, 0.45);
}

/* the dark glass */
.wc-glass {
    position: relative;
    overflow: hidden;
    padding: 8px 12px 8px 11px;
    border-radius: 7px;
    background: radial-gradient(ellipse at 45% 35%, #10201d, #050a09 78%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 0 1px #000, 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: filter 0.4s ease;
}
.wc-clock.is-day .wc-glass { background: radial-gradient(ellipse at 45% 35%, #221a0e, #0a0704 78%); }
.wc-glass::before {                      /* the fine wire mesh in front of a real VFD */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(rgba(0, 0, 0, 0.55) 0.55px, transparent 0.9px) 0 0 / 3px 3px;
    opacity: 0.6;
}
/* the little labels on top */
.wc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font: 0.56rem/1 var(--wc-mono);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--glow);
    text-shadow: 0 0 4px rgba(var(--glow-rgb), 0.6);
    opacity: 0;
    transition: opacity 0.6s ease 0.2s, color 1.2s ease;
}
.wc-clock.is-on .wc-top { opacity: 0.75; }
.wc-city { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-abbr { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.wc-abbr b { font-weight: normal; }
.wc-rec { width: 5px; height: 5px; border-radius: 50%; background: #ff6b4a; box-shadow: 0 0 5px #ff6b4a; animation: wc-rec 2s ease-in-out infinite; }
@keyframes wc-rec { 50% { opacity: 0.25; } }

/* the digits */
.wc-time { display: flex; align-items: flex-end; gap: 7px; }
.wc-digits {
    display: flex;
    align-items: center;
    gap: 3px;
    transform: skewX(-6deg);
    filter: drop-shadow(0 0 2px rgba(var(--glow-rgb), 0.85)) drop-shadow(0 0 6px rgba(var(--glow-rgb), 0.3));
}
.wc-d { display: block; width: 21px; height: 36px; overflow: visible; }
.wc-d .seg { fill: var(--glow); opacity: 0.07; transition: opacity 0.5s ease-out, fill 1.2s ease; }
.wc-d .seg.on { opacity: 1; transition: opacity 0.07s ease-in, fill 1.2s ease; }
.wc-d .seg.new { fill: #fffdf6; transition: fill 0.05s; }
.wc-colon { display: flex; flex-direction: column; gap: 10px; margin: 0 1px; }
.wc-colon i { display: block; width: 4px; height: 4px; border-radius: 1px; background: var(--glow); opacity: 0.07; transition: background 1.2s ease; }
.is-on .wc-colon i { opacity: 1; }
.wc-colon.tick i { animation: wc-colon 1s ease-in-out; }
@keyframes wc-colon { 0% { opacity: 1; } 50% { opacity: 0.18; } 100% { opacity: 1; } }

.wc-side { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; align-self: stretch; padding-bottom: 1px; }
.wc-ap { display: flex; gap: 4px; font: 0.52rem/1 var(--wc-mono); letter-spacing: 0.08em; }
.wc-ap b { font-weight: normal; color: var(--glow); opacity: 0.1; transition: opacity 0.45s ease-out, color 1.2s ease; }
.wc-ap b.on { opacity: 1; text-shadow: 0 0 4px rgba(var(--glow-rgb), 0.9); transition-duration: 0.07s, 1.2s; }
.wc-clock.is-24 .wc-ap { visibility: hidden; }

/* the tiny sky: a sun by day, a moon by night */
.wc-sky {
    position: relative;
    width: 34px;
    height: 16px;
    border-bottom: 1px solid rgba(var(--glow-rgb), 0.35);
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}
.is-on .wc-sky { opacity: 1; }
.wc-orb {
    position: absolute;
    left: var(--x, 50%);
    bottom: var(--y, 0%);
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 6px rgba(var(--glow-rgb), 0.9);
    transition: left 1.2s cubic-bezier(.2, .7, .2, 1), bottom 1.2s cubic-bezier(.2, .7, .2, 1), background 1.2s ease;
}
.wc-clock:not(.is-day) .wc-orb { background: transparent; box-shadow: inset -2px 0 0 0 var(--glow), 0 0 5px rgba(var(--glow-rgb), 0.5); }   /* a crescent */

/* the date, typed out like a terminal */
.wc-date {
    display: flex;
    align-items: center;
    margin-top: 6px;
    min-height: 0.7rem;
    font: 0.6rem/1 var(--wc-mono);
    letter-spacing: 0.2em;
    color: var(--glow);
    text-shadow: 0 0 4px rgba(var(--glow-rgb), 0.7);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s ease 0.4s, color 1.2s ease;
}
.is-on .wc-date { opacity: 0.85; }
.wc-cursor { width: 5px; height: 8px; margin-left: 2px; background: var(--glow); box-shadow: 0 0 4px var(--glow); opacity: 0; }
.is-typing .wc-cursor { animation: wc-cursor 0.5s steps(1) infinite; }
@keyframes wc-cursor { 0% { opacity: 1; } 50% { opacity: 0; } }

/* the caption under a card's clock */
.wc-caption { position: relative; padding: 10px 4px 0; }
main.wc-main .wc-name { font-size: 1.12rem; line-height: 1.25; }
.wc-name::after {
    content: " \00b7  " attr(data-part);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--wc-faint);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.wc-clock:hover .wc-name::after, .wc-clock:focus-visible .wc-name::after { opacity: 1; }
main.wc-main .wc-meta { display: flex; flex-direction: column; font-size: 0.82rem; line-height: 1.4; color: var(--wc-faint); }
.wc-diff { color: var(--wc-muted); transition: color 0.3s ease; }
.wc-clock:hover .wc-diff { color: var(--wc-accent); }
.wc-x {
    position: absolute;
    top: 8px;
    right: 0;
    width: 26px;
    height: 26px;
    border: 1px solid var(--wc-rule);
    border-radius: 50%;
    background: var(--wc-paper);
    color: var(--wc-faint);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}
.wc-clock:hover .wc-x, .wc-x:focus-visible { opacity: 1; }
.wc-x:hover { color: var(--wc-accent); border-color: var(--wc-accent); }
@media (hover: none) { .wc-x { opacity: 0.8; } }

/* ---------------------------------------------------------------------
   New York, the big one in the corner
   --------------------------------------------------------------------- */

.wc-big .wc-case { padding: 7px; border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.45), 0 14px 30px -10px rgba(27, 26, 23, 0.45); }
.wc-big .wc-glass { padding: 9px 14px 10px 13px; border-radius: 9px; }
.wc-big .wc-top { font-size: 0.62rem; margin-bottom: 7px; }
.wc-big .wc-d { width: 30px; height: 52px; }
.wc-big .wc-d.is-small { width: 13px; height: 23px; }
.wc-big .wc-colon { gap: 15px; }
.wc-big .wc-colon i { width: 6px; height: 6px; }
.wc-big .wc-ap { font-size: 0.6rem; }
.wc-secs { display: flex; gap: 2px; transform: skewX(-6deg); filter: drop-shadow(0 0 2px rgba(var(--glow-rgb), 0.8)); }
.wc-big .wc-date { font-size: 0.66rem; margin-top: 8px; }
.wc-big { transition: transform 0.35s cubic-bezier(.2, .7, .2, 1); }
.wc-big:hover { transform: translateY(-2px); }

/* ---------------------------------------------------------------------
   Switching on, adding, removing, 12/24 hour
   --------------------------------------------------------------------- */

.wc-clock.is-booting .wc-glass { animation: wc-warm 0.9s steps(1) 0.15s both; }
@keyframes wc-warm {
    0% { filter: brightness(0.3); }
    12% { filter: brightness(1.15); }
    18% { filter: brightness(0.5); }
    26% { filter: brightness(1.2); }
    34% { filter: brightness(0.8); }
    44%, 100% { filter: none; }
}
.wc-clock.is-blip .wc-glass { animation: wc-blip 0.35s ease-out; }
@keyframes wc-blip { 0% { filter: brightness(1.8); } 100% { filter: none; } }

.wc-clock.is-new { animation: wc-new 0.7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes wc-new { from { opacity: 0; transform: translateY(14px) scale(0.94); } }

/* removing: switches off like an old TV */
.wc-clock.is-off { pointer-events: none; animation: wc-off 0.5s ease-in forwards; }
.wc-clock.is-off .wc-glass { animation: wc-tv 0.35s ease-in forwards; }
@keyframes wc-tv { 0% { filter: brightness(1.6); } 60% { transform: scaleY(0.04); filter: brightness(2.5); } 100% { transform: scale(0, 0.02); filter: brightness(3); } }
@keyframes wc-off { 0%, 55% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(0.96); } }

/* "it's already here": a soft glow */
.wc-clock.is-hello { animation: wc-hello 1.1s ease-out; }
@keyframes wc-hello { 0% { box-shadow: 0 0 0 0 rgba(138, 43, 29, 0.35); } 100% { box-shadow: 0 0 0 14px rgba(138, 43, 29, 0); } }

/* planning a call: the clocks show another time */
.wc-clock.is-planned .wc-case { background: linear-gradient(160deg, #4a3f36, #231c18 55%, #33281f); }
.wc-clock.is-planned .wc-top::after { content: "plan"; margin-left: auto; padding: 1px 4px; border: 1px solid currentColor; border-radius: 3px; font-size: 0.5rem; letter-spacing: 0.15em; }
.wc-clock.is-planned .wc-abbr { display: none; }

/* ---------------------------------------------------------------------
   Search
   --------------------------------------------------------------------- */

.wc-search { position: relative; max-width: 520px; margin-bottom: 16px; }
.wc-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--wc-faint);
    stroke-width: 1.8;
    stroke-linecap: round;
    pointer-events: none;
}
.wc-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px 11px 40px;
    border: 1px solid var(--wc-rule);
    border-radius: 999px;
    background: var(--wc-paper);
    color: var(--wc-ink);
    font: 1rem var(--wc-serif);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wc-search input:focus { outline: none; border-color: var(--wc-accent); box-shadow: 0 0 0 3px rgba(138, 43, 29, 0.1); }
.wc-results {
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--wc-rule);
    border-radius: 14px;
    background: var(--wc-paper);
    box-shadow: 0 18px 40px -16px rgba(40, 30, 10, 0.35);
    animation: wc-pop 0.2s cubic-bezier(.2, .7, .2, 1);
}
@keyframes wc-pop { from { opacity: 0; transform: translateY(-4px); } }
.wc-results li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wc-results li.on { background: var(--wc-wash); }
.wc-results li.is-added { opacity: 0.6; }
.wc-r-name b { font-weight: normal; }
.wc-r-name span { font-size: 0.85rem; color: var(--wc-faint); }
.wc-r-time { font: 0.8rem var(--wc-mono); color: var(--wc-muted); white-space: nowrap; }
.wc-r-none { cursor: default; font-style: italic; color: var(--wc-faint); }

/* ---------------------------------------------------------------------
   Plan a call
   --------------------------------------------------------------------- */

.wc-plan { padding-top: 22px; border-top: 1px solid var(--wc-rule); }
.wc-planner { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.wc-field { display: flex; flex-direction: column; gap: 4px; }
.wc-field span { font-size: 0.78rem; letter-spacing: 0.06em; color: var(--wc-faint); }
.wc-planner input, .wc-planner select {
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--wc-rule);
    border-radius: 10px;
    background: var(--wc-paper);
    color: var(--wc-ink);
    font: 1rem var(--wc-serif);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wc-planner select { max-width: 240px; padding-right: 30px; }
.wc-planner input:focus, .wc-planner select:focus { outline: none; border-color: var(--wc-accent); box-shadow: 0 0 0 3px rgba(138, 43, 29, 0.1); }
.wc-steps { display: inline-flex; border: 1px solid var(--wc-rule); border-radius: 10px; overflow: hidden; height: 40px; }
.wc-steps button { padding: 0 12px; border: 0; background: var(--wc-paper); color: var(--wc-ink); font: 0.92rem var(--wc-serif); cursor: pointer; transition: background 0.2s ease; }
.wc-steps button + button { border-left: 1px solid var(--wc-rule); }
.wc-steps button:hover { background: var(--wc-wash); }
.wc-go, .wc-reset {
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--wc-ink);
    border-radius: 999px;
    background: var(--wc-ink);
    color: #fff;
    font: 0.95rem var(--wc-serif);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.wc-go:hover { background: #33302a; transform: translateY(-1px); }
.wc-reset { background: var(--wc-paper); color: var(--wc-ink); border-color: var(--wc-rule); }
.wc-reset:hover { border-color: var(--wc-ink); }
.wc-planner button:focus-visible { outline: 2px solid var(--wc-accent); outline-offset: 2px; }
main.wc-main .wc-shift-text { margin-top: 14px; font-size: 0.98rem; color: var(--wc-muted); }
main.wc-main .wc-shift-text b { color: var(--wc-ink); font-weight: normal; font-style: italic; }
.wc-plan-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0 24px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
.wc-plan-list li {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    grid-template-areas: "dot city time" ". word day";
    column-gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--wc-rule);
    animation: wc-row 0.4s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes wc-row { from { opacity: 0; transform: translateY(3px); } }
.wc-pl-dot { grid-area: dot; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--wc-faint); }
.v-good .wc-pl-dot { background: #2f7650; }
.v-ok .wc-pl-dot { background: #d9a13b; }
.v-bad .wc-pl-dot { background: #9aa3b5; }
.wc-pl-city { grid-area: city; }
.wc-pl-time { grid-area: time; font: 0.95rem var(--wc-mono); text-align: right; }
.wc-pl-word { grid-area: word; font-size: 0.8rem; font-style: italic; color: var(--wc-faint); }
.wc-pl-day { grid-area: day; font-size: 0.8rem; color: var(--wc-faint); text-align: right; }

/* the visitor's own clock */
.wc-grid .wc-clock.is-you { border-color: #d8b9b1; box-shadow: 0 0 0 1px rgba(138, 43, 29, 0.15), 0 6px 18px rgba(40, 30, 10, 0.06); }
.wc-clock.is-you .wc-diff { color: var(--wc-accent); }
main.wc-main .wc-home-note { margin-top: 8px; font-size: 0.85rem; font-style: italic; color: var(--wc-muted); text-align: right; }

/* ---------------------------------------------------------------------
   Phones
   --------------------------------------------------------------------- */

@media (max-width: 700px) {
    .wc-planner select { max-width: 100%; }
    .wc-field { flex: 1 1 140px; }
    .wc-hero { grid-template-columns: 1fr; }
    .wc-home { order: -1; justify-self: end; }
    .wc-big .wc-d { width: 26px; height: 45px; }
    .wc-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .wc-grid .wc-clock { padding: 8px 8px 10px; border-radius: 12px; }
    .wc-d { width: 15px; height: 26px; }
    .wc-glass { padding: 7px 8px 7px 8px; }
    .wc-colon { gap: 7px; }
    .wc-colon i { width: 3px; height: 3px; }
    .wc-sky { width: 22px; }
    .wc-name::after { display: none; }
    main.wc-main .wc-name { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .wc-clock, .wc-clock *, .wc-hero-text > *, .wc-home, .wc-results { animation: none !important; transition: none !important; }
}
